Skip to content

Commit 030b17d

Browse files
committed
Temporarily revert "Change -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)"
This affects users of older (pre 2.26) binutils in such a way that they can't necessarily work around it as it doesn't support the compress option on the command line. Reverting to unblock them and we can revisit whether to make this change now or fix how we want to express the option. This reverts commit bdb2133/r360403. llvm-svn: 360703
1 parent ee51d85 commit 030b17d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ Modified Compiler Flags
7777

7878
- `clang -dumpversion` now returns the version of Clang itself.
7979

80-
- On ELF, ``-gz`` now defaults to ``-gz=zlib``. It produces ``SHF_COMPRESSED``
81-
style compression of debug information. GNU binutils 2.26 or newer, or lld is
82-
required to link produced object files. Use ``-gz=zlib-gnu`` to get the old
83-
behavior.
80+
- ...
8481

8582
New Pragmas in Clang
8683
--------------------

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
10521052
if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
10531053
OPT_compress_debug_sections_EQ)) {
10541054
if (A->getOption().getID() == OPT_compress_debug_sections) {
1055-
Opts.setCompressDebugSections(llvm::DebugCompressionType::Z);
1055+
// TODO: be more clever about the compression type auto-detection
1056+
Opts.setCompressDebugSections(llvm::DebugCompressionType::GNU);
10561057
} else {
10571058
auto DCT = llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
10581059
.Case("none", llvm::DebugCompressionType::None)

clang/tools/driver/cc1as_main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
221221
if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
222222
OPT_compress_debug_sections_EQ)) {
223223
if (A->getOption().getID() == OPT_compress_debug_sections) {
224-
Opts.CompressDebugSections = llvm::DebugCompressionType::Z;
224+
// TODO: be more clever about the compression type auto-detection
225+
Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;
225226
} else {
226227
Opts.CompressDebugSections =
227228
llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())

0 commit comments

Comments
 (0)