[clang] 462cf39 - [Driver] Fix -gz=zlib options for linker also on FreeBSD
Ed Maste via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 2 05:45:43 PST 2021
Author: Ed Maste
Date: 2021-03-02T08:44:24-05:00
New Revision: 462cf39a5c180621b56f7602270ce33eb7b68d23
URL: https://github.com/llvm/llvm-project/commit/462cf39a5c180621b56f7602270ce33eb7b68d23
DIFF: https://github.com/llvm/llvm-project/commit/462cf39a5c180621b56f7602270ce33eb7b68d23.diff
LOG: [Driver] Fix -gz=zlib options for linker also on FreeBSD
ccb4124a4172 fixed translating -gz=zlib to --compress-debug-sections for
linker invocation for several ToolChains, but omitted FreeBSD.
Differential Revision: https://reviews.llvm.org/D97752
Added:
Modified:
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/test/Driver/compress.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index 4524d9b8a85c..d59bb6f8c3b0 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -290,6 +290,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
+ 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 9e3bf81f73e6..e6eff3f54dab 100644
--- a/clang/test/Driver/compress.c
+++ b/clang/test/Driver/compress.c
@@ -25,6 +25,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
// 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