Message ID | 5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com |
---|---|
State | New |
Headers | show |
Series | [bug#64129] gnu: clang-runtime-15: Fix address sanitizer support | expand |
Hi Tobias and all, I can confirm instrumented builds are also broken with [ mailto:clang-runtime@15 | clang-runtime@15 ] at the moment(using `clang -fprofile-instr-generate`) because `libclang_rt.profile-x86_64.a` doesn't exist. In my opinion your suggested patch is just fine, as I believe we have to keep static files for this package: - clang's driver actually explicitly link static files for some of them: [ https://github.com/llvm/llvm-project/blob/4c6f95be29c6ce0f89663a5103c58ee63d76cda3/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1070-L1072 | https://github.com/llvm/llvm-project/blob/4c6f95be29c6ce0f89663a5103c58ee63d76cda3/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1070-L1072 ] - I couldn't find a recent explanation for this and all compiler-rt components, but this forum post explains why there are both static libs and shared libs: [ https://discourse.llvm.org/t/asan-static-linking-on-android/29223/3 | https://discourse.llvm.org/t/asan-static-linking-on-android/29223/3 ] (basically they use static linking to intercept only calls from the main binary and not from dependent libraries, thanks to a glibc load order behavior, but the trick doesn't work on android and other platforms so they LD_PRELOAD a shared lib). By a quick glance at the installed components I couldn't find any static library that we can remove (most of them only exist as a static library, and the others are sanitizers). Regards, Philippe
Hi Tobias & Philippe, I was reluctant about keeping all those .a files due to the extra size, but based on your analysis, we have no choice but to keep them. So pushed as commit ae92d98b9375e1d753bd9ab495ed5c7dcd3f1af5. Thank you! Ludo’.
Thanks Ludo! ----- Mail original ----- > De: "Ludovic Courtès" <ludovic.courtes@inria.fr> > À: "Philippe Virouleau" <philippe.virouleau@inria.fr>, "Tobias Kortkamp" <tobias.kortkamp@gmail.com> > Cc: 64129-done@debbugs.gnu.org > Envoyé: Jeudi 13 Juillet 2023 18:02:41 > Objet: Re: bug#64129: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support > Hi Tobias & Philippe, > > I was reluctant about keeping all those .a files due to the extra size, > but based on your analysis, we have no choice but to keep them. > > So pushed as commit ae92d98b9375e1d753bd9ab495ed5c7dcd3f1af5. > > Thank you! > > Ludo’.
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index f59c8e9592..9764552a62 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -699,12 +699,7 @@ (define-public clang-runtime-15 #~(modify-phases #$phases (add-after 'unpack 'change-directory (lambda _ - (chdir "compiler-rt"))) - (add-after 'install 'delete-static-libraries - ;; Reduce size from 33 MiB to 7.4 MiB. - (lambda _ - (for-each delete-file - (find-files #$output "\\.a(\\.syms)?$")))))))) + (chdir "compiler-rt"))))))) (native-inputs (modify-inputs (package-native-inputs template) (prepend gcc-12))) ;libfuzzer fails to build with GCC 11