[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-29 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment.

In D114115#3477967 , @probinson wrote:

> 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`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-29 Thread Petr Hosek via Phabricator via cfe-commits
phosek updated this revision to Diff 426182.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

Files:
  clang/lib/Driver/ToolChains/Fuchsia.cpp
  clang/test/Driver/compress.c


Index: clang/test/Driver/compress.c
===
--- clang/test/Driver/compress.c
+++ clang/test/Driver/compress.c
@@ -26,6 +26,7 @@
 // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib -x assembler %s 
2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | 
FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // RUN: %clang -### -target x86_64-unknown-freebsd -gz=zlib %s 2>&1 | 
FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
+// RUN: %clang -### -target x86_64-unknown-fuchsia -gz=zlib %s 2>&1 | 
FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // CHECK-OPT_GZ_EQ_ZLIB: {{.* "-cc1(as)?".* "--compress-debug-sections=zlib"}}
 // CHECK-OPT_GZ_EQ_ZLIB: "--compress-debug-sections=zlib"
 
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,6 +127,7 @@
   D.getLTOMode() == LTOK_Thin);
   }
 
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,


Index: clang/test/Driver/compress.c
===
--- clang/test/Driver/compress.c
+++ clang/test/Driver/compress.c
@@ -26,6 +26,7 @@
 // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib -x assembler %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // RUN: %clang -### -target x86_64-unknown-freebsd -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
+// RUN: %clang -### -target x86_64-unknown-fuchsia -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
 // CHECK-OPT_GZ_EQ_ZLIB: {{.* "-cc1(as)?".* "--compress-debug-sections=zlib"}}
 // CHECK-OPT_GZ_EQ_ZLIB: "--compress-debug-sections=zlib"
 
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,6 +127,7 @@
   D.getLTOMode() == LTOK_Thin);
   }
 
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-27 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment.

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).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-27 Thread Douglas Yung via Phabricator via cfe-commits
dyung added a comment.

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-27 Thread Tom Weaver via Phabricator via cfe-commits
TWeaver added a comment.

Hello all,

really sorry but I've had to revert this patch due to failures on windows build 
bots:

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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2022-04-26 Thread Petr Hosek via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG19190cc651ef: [Driver] Support for compressed debug info on 
Fuchsia (authored by phosek).
Herald added a subscriber: MaskRay.
Herald added a project: All.

Changed prior to commit:
  https://reviews.llvm.org/D114115?vs=388005&id=425424#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

Files:
  clang/lib/Driver/ToolChains/Fuchsia.cpp
  clang/test/Driver/fuchsia.c


Index: clang/test/Driver/fuchsia.c
===
--- clang/test/Driver/fuchsia.c
+++ clang/test/Driver/fuchsia.c
@@ -253,6 +253,13 @@
 // CHECK-THINLTO: "-plugin-opt=thinlto"
 // CHECK-THINLTO: "-plugin-opt=jobs=8"
 
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
+// RUN: --sysroot=%S/platform \
+// RUN: -Og -gz 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-GZ
+// CHECK-GZ: {{.*}}clang{{.*}}" "--compress-debug-sections=zlib"
+// CHECK-GZ: {{.*}}ld.lld{{.*}}" "--compress-debug-sections=zlib"
+
 // RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
 // RUN: -gsplit-dwarf -g -c %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,6 +127,7 @@
   D.getLTOMode() == LTOK_Thin);
   }
 
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,


Index: clang/test/Driver/fuchsia.c
===
--- clang/test/Driver/fuchsia.c
+++ clang/test/Driver/fuchsia.c
@@ -253,6 +253,13 @@
 // CHECK-THINLTO: "-plugin-opt=thinlto"
 // CHECK-THINLTO: "-plugin-opt=jobs=8"
 
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
+// RUN: --sysroot=%S/platform \
+// RUN: -Og -gz 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-GZ
+// CHECK-GZ: {{.*}}clang{{.*}}" "--compress-debug-sections=zlib"
+// CHECK-GZ: {{.*}}ld.lld{{.*}}" "--compress-debug-sections=zlib"
+
 // RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
 // RUN: -gsplit-dwarf -g -c %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,6 +127,7 @@
   D.getLTOMode() == LTOK_Thin);
   }
 
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2021-11-30 Thread Roland McGrath via Phabricator via cfe-commits
mcgrathr accepted this revision.
mcgrathr added a comment.
This revision is now accepted and ready to land.

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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2021-11-30 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment.

@mcgrathr Ping.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114115/new/

https://reviews.llvm.org/D114115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114115: [Driver] Support for compressed debug info on Fuchsia

2021-11-17 Thread Petr Hosek via Phabricator via cfe-commits
phosek created this revision.
phosek added a reviewer: mcgrathr.
Herald added a subscriber: abrachet.
phosek requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Pass the --compress-debug-sections=zlib argument to the linker when
the use of compressed debug info is requested.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114115

Files:
  clang/lib/Driver/ToolChains/Fuchsia.cpp
  clang/test/Driver/fuchsia.c


Index: clang/test/Driver/fuchsia.c
===
--- clang/test/Driver/fuchsia.c
+++ clang/test/Driver/fuchsia.c
@@ -250,6 +250,13 @@
 // CHECK-THINLTO: "-plugin-opt=thinlto"
 // CHECK-THINLTO: "-plugin-opt=jobs=8"
 
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
+// RUN: --sysroot=%S/platform \
+// RUN: -Og -gz 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-GZ
+// CHECK-GZ: {{.*}}clang{{.*}}" "--compress-debug-sections=zlib"
+// CHECK-GZ: {{.*}}ld.lld{{.*}}" "--compress-debug-sections=zlib"
+
 // RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
 // RUN: -gsplit-dwarf -g -c %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -128,6 +128,7 @@
 
   bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
   ToolChain.addProfileRTLibs(Args, CmdArgs);
 


Index: clang/test/Driver/fuchsia.c
===
--- clang/test/Driver/fuchsia.c
+++ clang/test/Driver/fuchsia.c
@@ -250,6 +250,13 @@
 // CHECK-THINLTO: "-plugin-opt=thinlto"
 // CHECK-THINLTO: "-plugin-opt=jobs=8"
 
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
+// RUN: --sysroot=%S/platform \
+// RUN: -Og -gz 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-GZ
+// CHECK-GZ: {{.*}}clang{{.*}}" "--compress-debug-sections=zlib"
+// CHECK-GZ: {{.*}}ld.lld{{.*}}" "--compress-debug-sections=zlib"
+
 // RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
 // RUN: -gsplit-dwarf -g -c %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -128,6 +128,7 @@
 
   bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
   ToolChain.addProfileRTLibs(Args, CmdArgs);
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits