diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 9274081c4d62..03eca8a26843 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -100,7 +100,10 @@ future versions of Clang. Modified Compiler Flags ----------------------- -- ... +- On ELF, ``-gz`` now defaults to ``-gz=zlib`` with the integrated assembler. + It produces ``SHF_COMPRESSED`` style compression of debug information. GNU + binutils 2.26 or newer, or lld is required to link produced object files. Use + ``-gz=zlib-gnu`` to get the old behavior. New Pragmas in Clang -------------------- diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0b5f33541060..8e8bf9d9028e 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1155,8 +1155,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections, OPT_compress_debug_sections_EQ)) { if (A->getOption().getID() == OPT_compress_debug_sections) { - // TODO: be more clever about the compression type auto-detection - Opts.setCompressDebugSections(llvm::DebugCompressionType::GNU); + Opts.setCompressDebugSections(llvm::DebugCompressionType::Z); } else { auto DCT = llvm::StringSwitch(A->getValue()) .Case("none", llvm::DebugCompressionType::None) diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index 77b99b201364..87047be3c2bc 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -224,8 +224,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts, if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections, OPT_compress_debug_sections_EQ)) { if (A->getOption().getID() == OPT_compress_debug_sections) { - // TODO: be more clever about the compression type auto-detection - Opts.CompressDebugSections = llvm::DebugCompressionType::GNU; + Opts.CompressDebugSections = llvm::DebugCompressionType::Z; } else { Opts.CompressDebugSections = llvm::StringSwitch(A->getValue())