<div dir="ltr">It's fine :) The problem may be that users with older pre-2.26 binutils may have older GNU as as well. Their GNU as may not recognize --compress-debug-sections=zlib.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 15, 2019 at 3:39 AM Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ray,<br>
<br>
I've temporarily reverted this here:<br>
<br>
echristo@jhereg ~/s/llvm-project> git llvm push<br>
Pushing 1 commit:<br>
  fda79815a33 Temporarily revert "Change -gz and<br>
-Wa,--compress-debug-sections to use gABI compression<br>
(SHF_COMPRESSED)"<br>
Sending        cfe/trunk/docs/ReleaseNotes.rst<br>
Sending        cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
Sending        cfe/trunk/tools/driver/cc1as_main.cpp<br>
Transmitting file data ...done<br>
Committing transaction...<br>
Committed revision 360703.<br>
Committed fda79815a33 to svn.<br>
<br>
>From my message:<br>
<br>
    This affects users of older (pre 2.26) binutils in such a way that<br>
they can't necessarily<br>
    work around it as it doesn't support the compress option on the<br>
command line. Reverting<br>
    to unblock them and we can revisit whether to make this change now<br>
or fix how we want<br>
    to express the option.<br>
<br>
I'm not sure what we want to do here, but wanted to unblock people in<br>
the meantime. What do you think?<br>
<br>
Thanks!<br>
<br>
-eric<br>
<br>
<br>
On Thu, May 9, 2019 at 7:05 PM Fangrui Song via cfe-commits<br>
<<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: maskray<br>
> Date: Thu May  9 19:08:21 2019<br>
> New Revision: 360403<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=360403&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=360403&view=rev</a><br>
> Log:<br>
> Change -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)<br>
><br>
> Since July 15, 2015 (binutils-gdb commit<br>
> 19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas<br>
> --compress-debug-sections=zlib (gcc -gz) means zlib-gabi:<br>
> SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug).<br>
><br>
> clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It<br>
> is 2019 now and it is not unreasonable to assume users of the new<br>
> feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661).<br>
><br>
> Change clang's default accordingly to improve standard conformance.<br>
> zlib-gnu becomes out of fashion and gets poorer toolchain support.<br>
> Its mangled names confuse tools and are more likely to cause problems.<br>
><br>
> Reviewed By: compnerd<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D61689" rel="noreferrer" target="_blank">https://reviews.llvm.org/D61689</a><br>
><br>
> Modified:<br>
>     cfe/trunk/docs/ReleaseNotes.rst<br>
>     cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
>     cfe/trunk/tools/driver/cc1as_main.cpp<br>
><br>
> Modified: cfe/trunk/docs/ReleaseNotes.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=360403&r1=360402&r2=360403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=360403&r1=360402&r2=360403&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/docs/ReleaseNotes.rst (original)<br>
> +++ cfe/trunk/docs/ReleaseNotes.rst Thu May  9 19:08:21 2019<br>
> @@ -77,7 +77,10 @@ Modified Compiler Flags<br>
><br>
>  - `clang -dumpversion` now returns the version of Clang itself.<br>
><br>
> -- ...<br>
> +- On ELF, ``-gz`` now defaults to ``-gz=zlib``. It produces ``SHF_COMPRESSED``<br>
> +  style compression of debug information. GNU binutils 2.26 or newer, or lld is<br>
> +  required to link produced object files. Use ``-gz=zlib-gnu`` to get the old<br>
> +  behavior.<br>
><br>
>  New Pragmas in Clang<br>
>  --------------------<br>
><br>
> Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=360403&r1=360402&r2=360403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=360403&r1=360402&r2=360403&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)<br>
> +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu May  9 19:08:21 2019<br>
> @@ -1052,8 +1052,7 @@ static bool ParseCodeGenArgs(CodeGenOpti<br>
>    if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,<br>
>                                       OPT_compress_debug_sections_EQ)) {<br>
>      if (A->getOption().getID() == OPT_compress_debug_sections) {<br>
> -      // TODO: be more clever about the compression type auto-detection<br>
> -      Opts.setCompressDebugSections(llvm::DebugCompressionType::GNU);<br>
> +      Opts.setCompressDebugSections(llvm::DebugCompressionType::Z);<br>
>      } else {<br>
>        auto DCT = llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())<br>
>                       .Case("none", llvm::DebugCompressionType::None)<br>
><br>
> Modified: cfe/trunk/tools/driver/cc1as_main.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=360403&r1=360402&r2=360403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=360403&r1=360402&r2=360403&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/tools/driver/cc1as_main.cpp (original)<br>
> +++ cfe/trunk/tools/driver/cc1as_main.cpp Thu May  9 19:08:21 2019<br>
> @@ -221,8 +221,7 @@ bool AssemblerInvocation::CreateFromArgs<br>
>    if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,<br>
>                                       OPT_compress_debug_sections_EQ)) {<br>
>      if (A->getOption().getID() == OPT_compress_debug_sections) {<br>
> -      // TODO: be more clever about the compression type auto-detection<br>
> -      Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;<br>
> +      Opts.CompressDebugSections = llvm::DebugCompressionType::Z;<br>
>      } else {<br>
>        Opts.CompressDebugSections =<br>
>            llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">宋方睿</div></div>