Skip to content

Commit

Permalink
[Driver] Support for compressed debug info on Fuchsia
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petrhosek committed Apr 27, 2022
1 parent 6d6288f commit 2d0c897
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions clang/lib/Driver/ToolChains/Fuchsia.cpp
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Driver/fuchsia.c
Expand Up @@ -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
Expand Down

0 comments on commit 2d0c897

Please sign in to comment.