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
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits