This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Support for compressed debug info on Fuchsia
ClosedPublic

Authored by phosek on Nov 17 2021, 11:35 AM.

Details

Diff Detail

Event Timeline

phosek created this revision.Nov 17 2021, 11:35 AM
phosek requested review of this revision.Nov 17 2021, 11:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 11:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mcgrathr accepted this revision.Nov 30 2021, 10:47 AM

lgtm, but we should be sure to advise users that their debugging tools may need build adjustments to ensure they support the compressed formats.

This revision is now accepted and ready to land.Nov 30 2021, 10:47 AM
This revision was landed with ongoing or failed builds.Apr 26 2022, 11:47 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2022, 11:47 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
TWeaver added a subscriber: TWeaver.EditedApr 27 2022, 4:32 AM

Hello all,

really sorry but I've had to revert this patch due to failures on the following build bot:

http://lab.llvm.org:8011/#/builders/216/builds/3484

dyung added a subscriber: dyung.Apr 27 2022, 11:43 AM

I think the problem here is that if zlib is not available, you won't get the clang command line you expect:

https://lab.llvm.org/buildbot/#/builders/216/builds/3519

Input was:
<<<<<<
             1: clang version 15.0.0 (https://github.com/llvm/llvm-project.git 2d0c897212d0551966b26eae986209ea31c4f032) 
             2: Target: x86_64-unknown-fuchsia 
             3: Thread model: posix 
             4: InstalledDir: c:\buildbot-root\llvm-clang-x86_64-sie-win\build\bin 
             5: clang: warning: cannot compress debug sections (zlib not installed) [-Wdebug-compression-unavailable] 
             6:  "c:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\bin\\clang.exe" "-cc1" "-triple" "x86_64-unknown-fuchsia" "-emit-obj" "--mrelax-relocations" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "fuchsia.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\tools\\clang\\test\\Driver" "-resource-dir" "c:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\lib\\clang\\15.0.0" "-isysroot" "C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\Driver/platform" "-internal-isystem" "c:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\lib\\clang\\15.0.0\\include" "-internal-externc-isystem" "C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\Driver/platform\\include" "-Og" "-fdebug-compilation-dir=C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\tools\\clang\\test\\Driver" "-ferror-limit" "19" "-fsanitize=safe-stack" "-stack-protector" "2" "-fgnuc-version=4.2.1" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "C:\\Users\\BUILDB~1\\AppData\\Local\\Temp\\lit-tmp-f3r87ykv\\fuchsia-9a49da.o" "-x" "c" "C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\Driver\\fuchsia.c" 
             7:  "c:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\bin\\ld.lld" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr" "--sysroot=C:\\buildbot-root\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\Driver/platform" "-pie" "--build-id" "--hash-style=gnu" "--eh-frame-hdr" "-dynamic-linker" "ld.so.1" "-o" "a.out" "Scrt1.o" "-LC:\\buildbot-root\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\Driver/platform\\lib" "--compress-debug-sections=zlib" "C:\\Users\\BUILDB~1\\AppData\\Local\\Temp\\lit-tmp-f3r87ykv\\fuchsia-9a49da.o" "c:\\buildbot-root\\llvm-clang-x86_64-sie-win\\build\\lib\\clang\\15.0.0\\lib\\fuchsia\\libclang_rt.builtins-x86_64.a" "-lc" 
>>>>>>

Since lld does produce the expected argument, it suggests that maybe LLD isn't doing any detection of whether zlib is available like the compiler is.

Lit is aware of zlib's presence or absence, you could use REQUIRES: zlib (or you might factor that bit out into its own test with the REQUIRES).

phosek updated this revision to Diff 426182.Apr 29 2022, 3:40 PM

Lit is aware of zlib's presence or absence, you could use REQUIRES: zlib (or you might factor that bit out into its own test with the REQUIRES).

I have moved that test to clang/test/Driver/compress.c which already has REQUIRES: zlib.

This revision was landed with ongoing or failed builds.Apr 29 2022, 3:41 PM