Author: Petr Hosek
Date: 2022-04-27T11:24:41-07:00
New Revision: 2d0c897212d0551966b26eae986209ea31c4f032

URL: 
https://github.com/llvm/llvm-project/commit/2d0c897212d0551966b26eae986209ea31c4f032
DIFF: 
https://github.com/llvm/llvm-project/commit/2d0c897212d0551966b26eae986209ea31c4f032.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/fuchsia.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp 
b/clang/lib/Driver/ToolChains/Fuchsia.cpp
index 9e0b259dfcae7..6fe6f7f82feb2 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/fuchsia.c b/clang/test/Driver/fuchsia.c
index 888f6b1a2c4b7..07bb12b547ddf 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -253,6 +253,15 @@
 // 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{{[^"]*}}"
+// CHECK-GZ: "--compress-debug-sections=zlib"
+// CHECK-GZ: "{{[^"]*}}ld.lld{{[^"]*}}"
+// CHECK-GZ: "--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


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

Reply via email to