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

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 11:35:58 PST 2021


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114115.388005.patch
Type: text/x-patch
Size: 1282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211117/ec28ba36/attachment.bin>


More information about the cfe-commits mailing list