Skip to content

Commit 462cf39

Browse files
committed
[Driver] Fix -gz=zlib options for linker also on FreeBSD
ccb4124 fixed translating -gz=zlib to --compress-debug-sections for linker invocation for several ToolChains, but omitted FreeBSD. Differential Revision: https://reviews.llvm.org/D97752
1 parent c0d4b44 commit 462cf39

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

clang/lib/Driver/ToolChains/FreeBSD.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
290290

291291
bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
292292
bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
293+
addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
293294
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
294295

295296
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {

clang/test/Driver/compress.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
// RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib -x assembler %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
2727
// RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
28+
// RUN: %clang -### -target x86_64-unknown-freebsd -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
2829
// CHECK-OPT_GZ_EQ_ZLIB: {{.* "-cc1(as)?".* "--compress-debug-sections=zlib"}}
2930
// CHECK-OPT_GZ_EQ_ZLIB: "--compress-debug-sections=zlib"
3031

0 commit comments

Comments
 (0)