[clang] 4bdb505 - [Driver] Support for compressed debug info on Fuchsia

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 29 15:41:06 PDT 2022


Author: Petr Hosek
Date: 2022-04-29T15:38:51-07:00
New Revision: 4bdb505d62659491b8b935e0c2e19584839eab74

URL: https://github.com/llvm/llvm-project/commit/4bdb505d62659491b8b935e0c2e19584839eab74
DIFF: https://github.com/llvm/llvm-project/commit/4bdb505d62659491b8b935e0c2e19584839eab74.diff

LOG: [Driver] Support for compressed debug info on Fuchsia

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

Differential Revision: https://reviews.llvm.org/D114115

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp
index 9e0b259dfcae..6fe6f7f82feb 100644
--- a/clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ b/clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,6 +127,7 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
                   D.getLTOMode() == LTOK_Thin);
   }
 
+  addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,

diff  --git a/clang/test/Driver/compress.c b/clang/test/Driver/compress.c
index 4e701673944c..8b440a624e9f 100644
--- a/clang/test/Driver/compress.c
+++ b/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"
 


        


More information about the cfe-commits mailing list