Message ID | 20220701065725.3839926-1-maskray@google.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 079243858014 for <patchwork@sourceware.org>; Fri, 1 Jul 2022 06:58:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 079243858014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656658684; bh=lts0/FP0tTekBKA6zAxAEXd52TiFeeLxr9/FjAntIXM=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=yaSUExtyKejMwwBRTZ9gejm+ni3YjxVnqtl/qVTTyKgpSgM9AyrWEiT8MygMGwV/G +H94v+SsyBF4SS8YYnA1IFySfyI5tlF+4wXzUS0OwEED86J7rQJhJ3lSMDNJqJM15B UySY0w1iQbQ7uGdVd1n/WQ+1HHT29SHB8S1bhLiE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by sourceware.org (Postfix) with ESMTPS id 863593858419 for <gcc-patches@gcc.gnu.org>; Fri, 1 Jul 2022 06:57:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 863593858419 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-3178a95ec78so13037387b3.4 for <gcc-patches@gcc.gnu.org>; Thu, 30 Jun 2022 23:57:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=lts0/FP0tTekBKA6zAxAEXd52TiFeeLxr9/FjAntIXM=; b=WjnVichwg3/YuR9lynuhMgq49r2IvBLCJFly+0tsM2GmNa9Dcg+YQ6VpWUWoz1l15g bsuvQivpzoXIcc99aCiO8F0jY5H9OMVWhXRDYm+Zzs0JKvwaBWOIRsEf34T96HFeknp1 jPLDI0bkfBu5iRzN49UiYsREMOF+hJ95Cc8zbJq867WyU0TPTRcJR78ZHegjQS/S/JwQ DIBhUCQfEsFQEGOKaZsWgcU+0dLD0vlQIMgwtMoEzD7NMkaXN1xmwb15Zjhvf0Boxbp+ edadM8tYvD6/+vDXfA1QiEolWY+jhG4tmfcgsJXwQx2EeV3hQIP634bkUW6OWe3Z4BMD SwHg== X-Gm-Message-State: AJIora9dCMSLKA0JseT/qHR1EuO47qkwZ0kTpIpBWl9sIrzmo2ed0MFj 70VzaL8uWO2zoXsf2hEf+sdAtBhA5GToZUXjCzKDkmNTk3ZCKd0IydnufKQ4mIQkHPEdEGws63c zIUdUXeRg07v7aqAPcwTS7nyemm9t8HXIW1ge4VX1VmGgIsBAYtR5HukkLj+CQt5ILg== X-Google-Smtp-Source: AGRyM1urW6/uZpTqFEF4S3lI9o0xjmqsGkP01YRCKD/82kT7Yt7ER2ViOOGA/ASPn0IyHSJvjlyAvV2Wu/4j X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:2e5b:78f:605a:c739]) (user=maskray job=sendgmr) by 2002:a25:86c2:0:b0:66c:8c65:ff25 with SMTP id y2-20020a2586c2000000b0066c8c65ff25mr14101693ybm.396.1656658649803; Thu, 30 Jun 2022 23:57:29 -0700 (PDT) Date: Thu, 30 Jun 2022 23:57:25 -0700 Message-Id: <20220701065725.3839926-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] Remove legacy -gz=zlib-gnu To: gcc-patches@gcc.gnu.org, "H.J. Lu" <hjl.tools@gmail.com>, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-19.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Fangrui Song via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Fangrui Song <maskray@google.com> Cc: Fangrui Song <i@maskray.me> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Remove legacy -gz=zlib-gnu
|
|
Commit Message
Fangrui Song
July 1, 2022, 6:57 a.m. UTC
From: Fangrui Song <i@maskray.me>
SHF_COMPRESSED style zlib has been supported since binutils 2.26
and the legacy zlib-gnu option hasn't gain adoption.
According to Debian Code Search (`gz=zlib-gnu`), no project uses
-gz=zlib-gnu (valgrind has a configure to use -gz=zlib).
Remove support for the legacy zlib-gnu and simplify configure.ac by
removing zlib-gnu ld/as check.
---
gcc/common.opt | 3 ---
gcc/configure | 33 ++++++---------------------------
gcc/configure.ac | 29 ++++-------------------------
gcc/doc/invoke.texi | 11 +++++------
gcc/gcc.cc | 22 ++--------------------
5 files changed, 17 insertions(+), 81 deletions(-)
Comments
On Thu, Jun 30, 2022 at 11:58 PM Fangrui Song via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > From: Fangrui Song <i@maskray.me> > > SHF_COMPRESSED style zlib has been supported since binutils 2.26 > and the legacy zlib-gnu option hasn't gain adoption. > According to Debian Code Search (`gz=zlib-gnu`), no project uses > -gz=zlib-gnu (valgrind has a configure to use -gz=zlib). > Remove support for the legacy zlib-gnu and simplify configure.ac by > removing zlib-gnu ld/as check. A couple of things, you are missing a changelog. Second, why remove something which is still working? Third, why not just make gz=zlib-gnu as an alias to gz=zlib instead so if someone used it before it will still work. we try not to remove options; have them emit a warning and be ignored (or moved over to the closed option). Thanks, Andrew > --- > gcc/common.opt | 3 --- > gcc/configure | 33 ++++++--------------------------- > gcc/configure.ac | 29 ++++------------------------- > gcc/doc/invoke.texi | 11 +++++------ > gcc/gcc.cc | 22 ++-------------------- > 5 files changed, 17 insertions(+), 81 deletions(-) > > diff --git a/gcc/common.opt b/gcc/common.opt > index e7a51e882ba..8754d93d545 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) > EnumValue > Enum(compressed_debug_sections) String(zlib) Value(1) > > -EnumValue > -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) > - > gz > Common Driver > Generate compressed debug sections. > diff --git a/gcc/configure b/gcc/configure > index 62872d132ea..ca87e875e9d 100755 > --- a/gcc/configure > +++ b/gcc/configure > @@ -19674,7 +19674,7 @@ else > lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > lt_status=$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 19679 "configure" > +#line 19677 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -19780,7 +19780,7 @@ else > lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > lt_status=$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 19785 "configure" > +#line 19783 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -29711,20 +29711,13 @@ else > if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > then > gcc_cv_as_compress_debug=0 > - # Since binutils 2.26, gas supports --compress-debug-sections=type, > + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > # defaulting to the ELF gABI format. > - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > then > gcc_cv_as_compress_debug=2 > gcc_cv_as_compress_debug_option="--compress-debug-sections" > gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > - # Before binutils 2.26, gas only supported --compress-debug-options and > - # emitted the traditional GNU format. > - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > - then > - gcc_cv_as_compress_debug=1 > - gcc_cv_as_compress_debug_option="--compress-debug-sections" > - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > else > gcc_cv_as_compress_debug=0 > fi > @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } > > { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 > $as_echo_n "checking linker for compressed debug sections... " >&6; } > -# gold/gld support compressed debug sections since binutils 2.19/2.21 > -# In binutils 2.26, gld gained support for the ELF gABI format. > +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > if test $in_tree_ld = yes ; then > gcc_cv_ld_compress_debug=0 > if test $ld_is_mold = yes; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > - gcc_cv_ld_compress_debug=2 > - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > - && test $in_tree_ld_is_elf = yes; then > - gcc_cv_ld_compress_debug=1 > fi > elif echo "$ld_ver" | grep GNU > /dev/null; then > if test $ld_is_mold = yes; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > elif test "$ld_vers_major" -lt 2 \ > - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > gcc_cv_ld_compress_debug=0 > - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > - gcc_cv_ld_compress_debug=1 > else > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > fi > - if test $ld_is_gold = yes; then > - gcc_cv_ld_compress_debug=2 > - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - fi > else > case "${target}" in > *-*-solaris2*) > diff --git a/gcc/configure.ac b/gcc/configure.ac > index 446747311a6..f40f75271c2 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], > if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > then > gcc_cv_as_compress_debug=0 > - # Since binutils 2.26, gas supports --compress-debug-sections=type, > + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > # defaulting to the ELF gABI format. > - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > then > gcc_cv_as_compress_debug=2 > gcc_cv_as_compress_debug_option="--compress-debug-sections" > gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > - # Before binutils 2.26, gas only supported --compress-debug-options and > - # emitted the traditional GNU format. > - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > - then > - gcc_cv_as_compress_debug=1 > - gcc_cv_as_compress_debug_option="--compress-debug-sections" > - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > else > gcc_cv_as_compress_debug=0 > fi]) > @@ -6131,42 +6124,28 @@ fi > AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) > > AC_MSG_CHECKING(linker for compressed debug sections) > -# gold/gld support compressed debug sections since binutils 2.19/2.21 > -# In binutils 2.26, gld gained support for the ELF gABI format. > +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > if test $in_tree_ld = yes ; then > gcc_cv_ld_compress_debug=0 > if test $ld_is_mold = yes; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > - gcc_cv_ld_compress_debug=2 > - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > - && test $in_tree_ld_is_elf = yes; then > - gcc_cv_ld_compress_debug=1 > fi > elif echo "$ld_ver" | grep GNU > /dev/null; then > if test $ld_is_mold = yes; then > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > elif test "$ld_vers_major" -lt 2 \ > - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > gcc_cv_ld_compress_debug=0 > - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > - gcc_cv_ld_compress_debug=1 > else > gcc_cv_ld_compress_debug=3 > gcc_cv_ld_compress_debug_option="--compress-debug-sections" > fi > - if test $ld_is_gold = yes; then > - gcc_cv_ld_compress_debug=2 > - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > - fi > else > changequote(,)dnl > case "${target}" in > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 757775ea576..467659cb094 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -10775,12 +10775,11 @@ location views are enabled. > Produce compressed debug sections in DWARF format, if that is supported. > If @var{type} is not given, the default type depends on the capabilities > of the assembler and linker used. @var{type} may be one of > -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib > -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib > -compression in traditional GNU format). If the linker doesn't support > -writing compressed debug sections, the option is rejected. Otherwise, > -if the assembler does not support them, @option{-gz} is silently ignored > -when producing object files. > +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib > +compression in ELF gABI format). If the linker doesn't support writing > +compressed debug sections, the option is rejected. Otherwise, if the > +assembler does not support them, @option{-gz} is silently ignored when > +producing object files. > > @item -femit-struct-debug-baseonly > @opindex femit-struct-debug-baseonly > diff --git a/gcc/gcc.cc b/gcc/gcc.cc > index 5cbb38560b2..660cd6f4ef4 100644 > --- a/gcc/gcc.cc > +++ b/gcc/gcc.cc > @@ -827,22 +827,11 @@ proper position among the other output files. */ > /* No linker support. */ > #define LINK_COMPRESS_DEBUG_SPEC \ > " %{gz*:%e-gz is not supported in this configuration} " > -#elif HAVE_LD_COMPRESS_DEBUG == 1 > -/* GNU style on input, GNU ld options. Reject, not useful. */ > -#define LINK_COMPRESS_DEBUG_SPEC \ > - " %{gz*:%e-gz is not supported in this configuration} " > -#elif HAVE_LD_COMPRESS_DEBUG == 2 > -/* GNU style, GNU gold options. */ > -#define LINK_COMPRESS_DEBUG_SPEC \ > - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > #elif HAVE_LD_COMPRESS_DEBUG == 3 > /* ELF gABI style. */ > #define LINK_COMPRESS_DEBUG_SPEC \ > " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" > #else > #error Unknown value for HAVE_LD_COMPRESS_DEBUG. > #endif > @@ -891,18 +880,11 @@ proper position among the other output files. */ > /* No assembler support. Ignore silently. */ > #define ASM_COMPRESS_DEBUG_SPEC \ > " %{gz*:} " > -#elif HAVE_AS_COMPRESS_DEBUG == 1 > -/* GNU style, GNU as options. */ > -#define ASM_COMPRESS_DEBUG_SPEC \ > - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ > - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ > - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > #elif HAVE_AS_COMPRESS_DEBUG == 2 > /* ELF gABI style. */ > #define ASM_COMPRESS_DEBUG_SPEC \ > " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ > - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ > - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" > #else > #error Unknown value for HAVE_AS_COMPRESS_DEBUG. > #endif > -- > 2.37.0.rc0.161.g10f37bed90-goog >
On 2022-07-01, Andrew Pinski wrote: >On Thu, Jun 30, 2022 at 11:58 PM Fangrui Song via Gcc-patches ><gcc-patches@gcc.gnu.org> wrote: >> >> From: Fangrui Song <i@maskray.me> >> >> SHF_COMPRESSED style zlib has been supported since binutils 2.26 >> and the legacy zlib-gnu option hasn't gain adoption. >> According to Debian Code Search (`gz=zlib-gnu`), no project uses >> -gz=zlib-gnu (valgrind has a configure to use -gz=zlib). >> Remove support for the legacy zlib-gnu and simplify configure.ac by >> removing zlib-gnu ld/as check. > >A couple of things, you are missing a changelog. Sorry. >Second, why remove something which is still working? It's unused and its existence causes confusion: the paradox of choice. People may assume the support may be good but newer DWARF consumers may not support the legacy format. The other motivation is to clean up it a bit. I foresee that someone will add --compress-debug-sections=zstd to binutils and configure.ac and gcc/gcc.cc would become more messy. >Third, why not just make gz=zlib-gnu as an alias to gz=zlib instead so >if someone used it before it will still work. we try not to remove >options; have them emit a warning and be ignored (or moved over to the >closed option). Changing the semantics of -gz=zlib-gnu would be even more confusing. >Thanks, >Andrew > >> --- >> gcc/common.opt | 3 --- >> gcc/configure | 33 ++++++--------------------------- >> gcc/configure.ac | 29 ++++------------------------- >> gcc/doc/invoke.texi | 11 +++++------ >> gcc/gcc.cc | 22 ++-------------------- >> 5 files changed, 17 insertions(+), 81 deletions(-) >> >> diff --git a/gcc/common.opt b/gcc/common.opt >> index e7a51e882ba..8754d93d545 100644 >> --- a/gcc/common.opt >> +++ b/gcc/common.opt >> @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) >> EnumValue >> Enum(compressed_debug_sections) String(zlib) Value(1) >> >> -EnumValue >> -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) >> - >> gz >> Common Driver >> Generate compressed debug sections. >> diff --git a/gcc/configure b/gcc/configure >> index 62872d132ea..ca87e875e9d 100755 >> --- a/gcc/configure >> +++ b/gcc/configure >> @@ -19674,7 +19674,7 @@ else >> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 >> lt_status=$lt_dlunknown >> cat > conftest.$ac_ext <<_LT_EOF >> -#line 19679 "configure" >> +#line 19677 "configure" >> #include "confdefs.h" >> >> #if HAVE_DLFCN_H >> @@ -19780,7 +19780,7 @@ else >> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 >> lt_status=$lt_dlunknown >> cat > conftest.$ac_ext <<_LT_EOF >> -#line 19785 "configure" >> +#line 19783 "configure" >> #include "confdefs.h" >> >> #if HAVE_DLFCN_H >> @@ -29711,20 +29711,13 @@ else >> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null >> then >> gcc_cv_as_compress_debug=0 >> - # Since binutils 2.26, gas supports --compress-debug-sections=type, >> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, >> # defaulting to the ELF gABI format. >> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 >> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 >> then >> gcc_cv_as_compress_debug=2 >> gcc_cv_as_compress_debug_option="--compress-debug-sections" >> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >> - # Before binutils 2.26, gas only supported --compress-debug-options and >> - # emitted the traditional GNU format. >> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 >> - then >> - gcc_cv_as_compress_debug=1 >> - gcc_cv_as_compress_debug_option="--compress-debug-sections" >> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >> else >> gcc_cv_as_compress_debug=0 >> fi >> @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } >> >> { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 >> $as_echo_n "checking linker for compressed debug sections... " >&6; } >> -# gold/gld support compressed debug sections since binutils 2.19/2.21 >> -# In binutils 2.26, gld gained support for the ELF gABI format. >> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. >> if test $in_tree_ld = yes ; then >> gcc_cv_ld_compress_debug=0 >> if test $ld_is_mold = yes; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ >> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then >> - gcc_cv_ld_compress_debug=2 >> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ >> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ >> - && test $in_tree_ld_is_elf = yes; then >> - gcc_cv_ld_compress_debug=1 >> fi >> elif echo "$ld_ver" | grep GNU > /dev/null; then >> if test $ld_is_mold = yes; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> elif test "$ld_vers_major" -lt 2 \ >> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then >> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >> gcc_cv_ld_compress_debug=0 >> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >> - gcc_cv_ld_compress_debug=1 >> else >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> fi >> - if test $ld_is_gold = yes; then >> - gcc_cv_ld_compress_debug=2 >> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - fi >> else >> case "${target}" in >> *-*-solaris2*) >> diff --git a/gcc/configure.ac b/gcc/configure.ac >> index 446747311a6..f40f75271c2 100644 >> --- a/gcc/configure.ac >> +++ b/gcc/configure.ac >> @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], >> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null >> then >> gcc_cv_as_compress_debug=0 >> - # Since binutils 2.26, gas supports --compress-debug-sections=type, >> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, >> # defaulting to the ELF gABI format. >> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 >> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 >> then >> gcc_cv_as_compress_debug=2 >> gcc_cv_as_compress_debug_option="--compress-debug-sections" >> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >> - # Before binutils 2.26, gas only supported --compress-debug-options and >> - # emitted the traditional GNU format. >> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 >> - then >> - gcc_cv_as_compress_debug=1 >> - gcc_cv_as_compress_debug_option="--compress-debug-sections" >> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >> else >> gcc_cv_as_compress_debug=0 >> fi]) >> @@ -6131,42 +6124,28 @@ fi >> AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) >> >> AC_MSG_CHECKING(linker for compressed debug sections) >> -# gold/gld support compressed debug sections since binutils 2.19/2.21 >> -# In binutils 2.26, gld gained support for the ELF gABI format. >> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. >> if test $in_tree_ld = yes ; then >> gcc_cv_ld_compress_debug=0 >> if test $ld_is_mold = yes; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ >> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then >> - gcc_cv_ld_compress_debug=2 >> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ >> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ >> - && test $in_tree_ld_is_elf = yes; then >> - gcc_cv_ld_compress_debug=1 >> fi >> elif echo "$ld_ver" | grep GNU > /dev/null; then >> if test $ld_is_mold = yes; then >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> elif test "$ld_vers_major" -lt 2 \ >> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then >> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >> gcc_cv_ld_compress_debug=0 >> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >> - gcc_cv_ld_compress_debug=1 >> else >> gcc_cv_ld_compress_debug=3 >> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> fi >> - if test $ld_is_gold = yes; then >> - gcc_cv_ld_compress_debug=2 >> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >> - fi >> else >> changequote(,)dnl >> case "${target}" in >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >> index 757775ea576..467659cb094 100644 >> --- a/gcc/doc/invoke.texi >> +++ b/gcc/doc/invoke.texi >> @@ -10775,12 +10775,11 @@ location views are enabled. >> Produce compressed debug sections in DWARF format, if that is supported. >> If @var{type} is not given, the default type depends on the capabilities >> of the assembler and linker used. @var{type} may be one of >> -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib >> -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib >> -compression in traditional GNU format). If the linker doesn't support >> -writing compressed debug sections, the option is rejected. Otherwise, >> -if the assembler does not support them, @option{-gz} is silently ignored >> -when producing object files. >> +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib >> +compression in ELF gABI format). If the linker doesn't support writing >> +compressed debug sections, the option is rejected. Otherwise, if the >> +assembler does not support them, @option{-gz} is silently ignored when >> +producing object files. >> >> @item -femit-struct-debug-baseonly >> @opindex femit-struct-debug-baseonly >> diff --git a/gcc/gcc.cc b/gcc/gcc.cc >> index 5cbb38560b2..660cd6f4ef4 100644 >> --- a/gcc/gcc.cc >> +++ b/gcc/gcc.cc >> @@ -827,22 +827,11 @@ proper position among the other output files. */ >> /* No linker support. */ >> #define LINK_COMPRESS_DEBUG_SPEC \ >> " %{gz*:%e-gz is not supported in this configuration} " >> -#elif HAVE_LD_COMPRESS_DEBUG == 1 >> -/* GNU style on input, GNU ld options. Reject, not useful. */ >> -#define LINK_COMPRESS_DEBUG_SPEC \ >> - " %{gz*:%e-gz is not supported in this configuration} " >> -#elif HAVE_LD_COMPRESS_DEBUG == 2 >> -/* GNU style, GNU gold options. */ >> -#define LINK_COMPRESS_DEBUG_SPEC \ >> - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ >> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ >> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " >> #elif HAVE_LD_COMPRESS_DEBUG == 3 >> /* ELF gABI style. */ >> #define LINK_COMPRESS_DEBUG_SPEC \ >> " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ >> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ >> - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " >> + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" >> #else >> #error Unknown value for HAVE_LD_COMPRESS_DEBUG. >> #endif >> @@ -891,18 +880,11 @@ proper position among the other output files. */ >> /* No assembler support. Ignore silently. */ >> #define ASM_COMPRESS_DEBUG_SPEC \ >> " %{gz*:} " >> -#elif HAVE_AS_COMPRESS_DEBUG == 1 >> -/* GNU style, GNU as options. */ >> -#define ASM_COMPRESS_DEBUG_SPEC \ >> - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ >> - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ >> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " >> #elif HAVE_AS_COMPRESS_DEBUG == 2 >> /* ELF gABI style. */ >> #define ASM_COMPRESS_DEBUG_SPEC \ >> " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ >> - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ >> - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " >> + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" >> #else >> #error Unknown value for HAVE_AS_COMPRESS_DEBUG. >> #endif >> -- >> 2.37.0.rc0.161.g10f37bed90-goog >>
On 7/1/22 09:20, Fangrui Song via Gcc-patches wrote: > On 2022-07-01, Andrew Pinski wrote: >> On Thu, Jun 30, 2022 at 11:58 PM Fangrui Song via Gcc-patches >> <gcc-patches@gcc.gnu.org> wrote: >>> >>> From: Fangrui Song <i@maskray.me> >>> >>> SHF_COMPRESSED style zlib has been supported since binutils 2.26 >>> and the legacy zlib-gnu option hasn't gain adoption. >>> According to Debian Code Search (`gz=zlib-gnu`), no project uses >>> -gz=zlib-gnu (valgrind has a configure to use -gz=zlib). >>> Remove support for the legacy zlib-gnu and simplify configure.ac by >>> removing zlib-gnu ld/as check. >> >> A couple of things, you are missing a changelog. > > Sorry. > >> Second, why remove something which is still working? Hi. I do support the option removal, while I would replace the removal with a warning saying no compression will be used. > > It's unused and its existence causes confusion: the paradox of choice. > People may assume the support may be good but newer DWARF consumers may > not support the legacy format. Agree, the compression format is legacy. I verified all openSUSE packages (15k) and there's no project actively using it. > > The other motivation is to clean up it a bit. I foresee that someone > will add --compress-debug-sections=zstd to binutils and configure.ac and > gcc/gcc.cc would become more messy. The argument makes sense, it will be even bigger mess. @Richi: Is it something we can deprecate for GCC 13? Martin > >> Third, why not just make gz=zlib-gnu as an alias to gz=zlib instead so >> if someone used it before it will still work. we try not to remove >> options; have them emit a warning and be ignored (or moved over to the >> closed option). > > Changing the semantics of -gz=zlib-gnu would be even more confusing. > >> Thanks, >> Andrew >> >>> --- >>> gcc/common.opt | 3 --- >>> gcc/configure | 33 ++++++--------------------------- >>> gcc/configure.ac | 29 ++++------------------------- >>> gcc/doc/invoke.texi | 11 +++++------ >>> gcc/gcc.cc | 22 ++-------------------- >>> 5 files changed, 17 insertions(+), 81 deletions(-) >>> >>> diff --git a/gcc/common.opt b/gcc/common.opt >>> index e7a51e882ba..8754d93d545 100644 >>> --- a/gcc/common.opt >>> +++ b/gcc/common.opt >>> @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) >>> EnumValue >>> Enum(compressed_debug_sections) String(zlib) Value(1) >>> >>> -EnumValue >>> -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) >>> - >>> gz >>> Common Driver >>> Generate compressed debug sections. >>> diff --git a/gcc/configure b/gcc/configure >>> index 62872d132ea..ca87e875e9d 100755 >>> --- a/gcc/configure >>> +++ b/gcc/configure >>> @@ -19674,7 +19674,7 @@ else >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 >>> lt_status=$lt_dlunknown >>> cat > conftest.$ac_ext <<_LT_EOF >>> -#line 19679 "configure" >>> +#line 19677 "configure" >>> #include "confdefs.h" >>> >>> #if HAVE_DLFCN_H >>> @@ -19780,7 +19780,7 @@ else >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 >>> lt_status=$lt_dlunknown >>> cat > conftest.$ac_ext <<_LT_EOF >>> -#line 19785 "configure" >>> +#line 19783 "configure" >>> #include "confdefs.h" >>> >>> #if HAVE_DLFCN_H >>> @@ -29711,20 +29711,13 @@ else >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null >>> then >>> gcc_cv_as_compress_debug=0 >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, >>> # defaulting to the ELF gABI format. >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 >>> then >>> gcc_cv_as_compress_debug=2 >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >>> - # Before binutils 2.26, gas only supported --compress-debug-options and >>> - # emitted the traditional GNU format. >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 >>> - then >>> - gcc_cv_as_compress_debug=1 >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >>> else >>> gcc_cv_as_compress_debug=0 >>> fi >>> @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } >>> >>> { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 >>> $as_echo_n "checking linker for compressed debug sections... " >&6; } >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 >>> -# In binutils 2.26, gld gained support for the ELF gABI format. >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. >>> if test $in_tree_ld = yes ; then >>> gcc_cv_ld_compress_debug=0 >>> if test $ld_is_mold = yes; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then >>> - gcc_cv_ld_compress_debug=2 >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> - && test $in_tree_ld_is_elf = yes; then >>> - gcc_cv_ld_compress_debug=1 >>> fi >>> elif echo "$ld_ver" | grep GNU > /dev/null; then >>> if test $ld_is_mold = yes; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> elif test "$ld_vers_major" -lt 2 \ >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >>> gcc_cv_ld_compress_debug=0 >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >>> - gcc_cv_ld_compress_debug=1 >>> else >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> fi >>> - if test $ld_is_gold = yes; then >>> - gcc_cv_ld_compress_debug=2 >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - fi >>> else >>> case "${target}" in >>> *-*-solaris2*) >>> diff --git a/gcc/configure.ac b/gcc/configure.ac >>> index 446747311a6..f40f75271c2 100644 >>> --- a/gcc/configure.ac >>> +++ b/gcc/configure.ac >>> @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null >>> then >>> gcc_cv_as_compress_debug=0 >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, >>> # defaulting to the ELF gABI format. >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 >>> then >>> gcc_cv_as_compress_debug=2 >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >>> - # Before binutils 2.26, gas only supported --compress-debug-options and >>> - # emitted the traditional GNU format. >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 >>> - then >>> - gcc_cv_as_compress_debug=1 >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" >>> else >>> gcc_cv_as_compress_debug=0 >>> fi]) >>> @@ -6131,42 +6124,28 @@ fi >>> AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) >>> >>> AC_MSG_CHECKING(linker for compressed debug sections) >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 >>> -# In binutils 2.26, gld gained support for the ELF gABI format. >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. >>> if test $in_tree_ld = yes ; then >>> gcc_cv_ld_compress_debug=0 >>> if test $ld_is_mold = yes; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then >>> - gcc_cv_ld_compress_debug=2 >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ >>> - && test $in_tree_ld_is_elf = yes; then >>> - gcc_cv_ld_compress_debug=1 >>> fi >>> elif echo "$ld_ver" | grep GNU > /dev/null; then >>> if test $ld_is_mold = yes; then >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> elif test "$ld_vers_major" -lt 2 \ >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >>> gcc_cv_ld_compress_debug=0 >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then >>> - gcc_cv_ld_compress_debug=1 >>> else >>> gcc_cv_ld_compress_debug=3 >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> fi >>> - if test $ld_is_gold = yes; then >>> - gcc_cv_ld_compress_debug=2 >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" >>> - fi >>> else >>> changequote(,)dnl >>> case "${target}" in >>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >>> index 757775ea576..467659cb094 100644 >>> --- a/gcc/doc/invoke.texi >>> +++ b/gcc/doc/invoke.texi >>> @@ -10775,12 +10775,11 @@ location views are enabled. >>> Produce compressed debug sections in DWARF format, if that is supported. >>> If @var{type} is not given, the default type depends on the capabilities >>> of the assembler and linker used. @var{type} may be one of >>> -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib >>> -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib >>> -compression in traditional GNU format). If the linker doesn't support >>> -writing compressed debug sections, the option is rejected. Otherwise, >>> -if the assembler does not support them, @option{-gz} is silently ignored >>> -when producing object files. >>> +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib >>> +compression in ELF gABI format). If the linker doesn't support writing >>> +compressed debug sections, the option is rejected. Otherwise, if the >>> +assembler does not support them, @option{-gz} is silently ignored when >>> +producing object files. >>> >>> @item -femit-struct-debug-baseonly >>> @opindex femit-struct-debug-baseonly >>> diff --git a/gcc/gcc.cc b/gcc/gcc.cc >>> index 5cbb38560b2..660cd6f4ef4 100644 >>> --- a/gcc/gcc.cc >>> +++ b/gcc/gcc.cc >>> @@ -827,22 +827,11 @@ proper position among the other output files. */ >>> /* No linker support. */ >>> #define LINK_COMPRESS_DEBUG_SPEC \ >>> " %{gz*:%e-gz is not supported in this configuration} " >>> -#elif HAVE_LD_COMPRESS_DEBUG == 1 >>> -/* GNU style on input, GNU ld options. Reject, not useful. */ >>> -#define LINK_COMPRESS_DEBUG_SPEC \ >>> - " %{gz*:%e-gz is not supported in this configuration} " >>> -#elif HAVE_LD_COMPRESS_DEBUG == 2 >>> -/* GNU style, GNU gold options. */ >>> -#define LINK_COMPRESS_DEBUG_SPEC \ >>> - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " >>> #elif HAVE_LD_COMPRESS_DEBUG == 3 >>> /* ELF gABI style. */ >>> #define LINK_COMPRESS_DEBUG_SPEC \ >>> " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ >>> - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " >>> + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" >>> #else >>> #error Unknown value for HAVE_LD_COMPRESS_DEBUG. >>> #endif >>> @@ -891,18 +880,11 @@ proper position among the other output files. */ >>> /* No assembler support. Ignore silently. */ >>> #define ASM_COMPRESS_DEBUG_SPEC \ >>> " %{gz*:} " >>> -#elif HAVE_AS_COMPRESS_DEBUG == 1 >>> -/* GNU style, GNU as options. */ >>> -#define ASM_COMPRESS_DEBUG_SPEC \ >>> - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ >>> - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " >>> #elif HAVE_AS_COMPRESS_DEBUG == 2 >>> /* ELF gABI style. */ >>> #define ASM_COMPRESS_DEBUG_SPEC \ >>> " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ >>> - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ >>> - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " >>> + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" >>> #else >>> #error Unknown value for HAVE_AS_COMPRESS_DEBUG. >>> #endif >>> -- >>> 2.37.0.rc0.161.g10f37bed90-goog >>>
On Tue, Sep 20, 2022 at 2:55 PM Martin Liška <mliska@suse.cz> wrote: > > On 7/1/22 09:20, Fangrui Song via Gcc-patches wrote: > > On 2022-07-01, Andrew Pinski wrote: > >> On Thu, Jun 30, 2022 at 11:58 PM Fangrui Song via Gcc-patches > >> <gcc-patches@gcc.gnu.org> wrote: > >>> > >>> From: Fangrui Song <i@maskray.me> > >>> > >>> SHF_COMPRESSED style zlib has been supported since binutils 2.26 > >>> and the legacy zlib-gnu option hasn't gain adoption. > >>> According to Debian Code Search (`gz=zlib-gnu`), no project uses > >>> -gz=zlib-gnu (valgrind has a configure to use -gz=zlib). > >>> Remove support for the legacy zlib-gnu and simplify configure.ac by > >>> removing zlib-gnu ld/as check. > >> > >> A couple of things, you are missing a changelog. > > > > Sorry. > > > >> Second, why remove something which is still working? > > Hi. > > I do support the option removal, while I would replace the removal with a warning > saying no compression will be used. > > > > > It's unused and its existence causes confusion: the paradox of choice. > > People may assume the support may be good but newer DWARF consumers may > > not support the legacy format. > > Agree, the compression format is legacy. I verified all openSUSE packages (15k) > and there's no project actively using it. > > > > > The other motivation is to clean up it a bit. I foresee that someone > > will add --compress-debug-sections=zstd to binutils and configure.ac and > > gcc/gcc.cc would become more messy. > > The argument makes sense, it will be even bigger mess. > > @Richi: Is it something we can deprecate for GCC 13? What's the practical difference between zlib and zlib-gnu? Can we just map zlib-gnu to zlib? If it's all configure time what's the point in "deprecating" it? Richard. > > Martin > > > > >> Third, why not just make gz=zlib-gnu as an alias to gz=zlib instead so > >> if someone used it before it will still work. we try not to remove > >> options; have them emit a warning and be ignored (or moved over to the > >> closed option). > > > > Changing the semantics of -gz=zlib-gnu would be even more confusing. > > > >> Thanks, > >> Andrew > >> > >>> --- > >>> gcc/common.opt | 3 --- > >>> gcc/configure | 33 ++++++--------------------------- > >>> gcc/configure.ac | 29 ++++------------------------- > >>> gcc/doc/invoke.texi | 11 +++++------ > >>> gcc/gcc.cc | 22 ++-------------------- > >>> 5 files changed, 17 insertions(+), 81 deletions(-) > >>> > >>> diff --git a/gcc/common.opt b/gcc/common.opt > >>> index e7a51e882ba..8754d93d545 100644 > >>> --- a/gcc/common.opt > >>> +++ b/gcc/common.opt > >>> @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) > >>> EnumValue > >>> Enum(compressed_debug_sections) String(zlib) Value(1) > >>> > >>> -EnumValue > >>> -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) > >>> - > >>> gz > >>> Common Driver > >>> Generate compressed debug sections. > >>> diff --git a/gcc/configure b/gcc/configure > >>> index 62872d132ea..ca87e875e9d 100755 > >>> --- a/gcc/configure > >>> +++ b/gcc/configure > >>> @@ -19674,7 +19674,7 @@ else > >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > >>> lt_status=$lt_dlunknown > >>> cat > conftest.$ac_ext <<_LT_EOF > >>> -#line 19679 "configure" > >>> +#line 19677 "configure" > >>> #include "confdefs.h" > >>> > >>> #if HAVE_DLFCN_H > >>> @@ -19780,7 +19780,7 @@ else > >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > >>> lt_status=$lt_dlunknown > >>> cat > conftest.$ac_ext <<_LT_EOF > >>> -#line 19785 "configure" > >>> +#line 19783 "configure" > >>> #include "confdefs.h" > >>> > >>> #if HAVE_DLFCN_H > >>> @@ -29711,20 +29711,13 @@ else > >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > >>> then > >>> gcc_cv_as_compress_debug=0 > >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, > >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > >>> # defaulting to the ELF gABI format. > >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > >>> then > >>> gcc_cv_as_compress_debug=2 > >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" > >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > >>> - # Before binutils 2.26, gas only supported --compress-debug-options and > >>> - # emitted the traditional GNU format. > >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > >>> - then > >>> - gcc_cv_as_compress_debug=1 > >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" > >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > >>> else > >>> gcc_cv_as_compress_debug=0 > >>> fi > >>> @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } > >>> > >>> { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 > >>> $as_echo_n "checking linker for compressed debug sections... " >&6; } > >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 > >>> -# In binutils 2.26, gld gained support for the ELF gABI format. > >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > >>> if test $in_tree_ld = yes ; then > >>> gcc_cv_ld_compress_debug=0 > >>> if test $ld_is_mold = yes; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > >>> - gcc_cv_ld_compress_debug=2 > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> - && test $in_tree_ld_is_elf = yes; then > >>> - gcc_cv_ld_compress_debug=1 > >>> fi > >>> elif echo "$ld_ver" | grep GNU > /dev/null; then > >>> if test $ld_is_mold = yes; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> elif test "$ld_vers_major" -lt 2 \ > >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > >>> gcc_cv_ld_compress_debug=0 > >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > >>> - gcc_cv_ld_compress_debug=1 > >>> else > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> fi > >>> - if test $ld_is_gold = yes; then > >>> - gcc_cv_ld_compress_debug=2 > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - fi > >>> else > >>> case "${target}" in > >>> *-*-solaris2*) > >>> diff --git a/gcc/configure.ac b/gcc/configure.ac > >>> index 446747311a6..f40f75271c2 100644 > >>> --- a/gcc/configure.ac > >>> +++ b/gcc/configure.ac > >>> @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], > >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > >>> then > >>> gcc_cv_as_compress_debug=0 > >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, > >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > >>> # defaulting to the ELF gABI format. > >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > >>> then > >>> gcc_cv_as_compress_debug=2 > >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" > >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > >>> - # Before binutils 2.26, gas only supported --compress-debug-options and > >>> - # emitted the traditional GNU format. > >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > >>> - then > >>> - gcc_cv_as_compress_debug=1 > >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" > >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > >>> else > >>> gcc_cv_as_compress_debug=0 > >>> fi]) > >>> @@ -6131,42 +6124,28 @@ fi > >>> AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) > >>> > >>> AC_MSG_CHECKING(linker for compressed debug sections) > >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 > >>> -# In binutils 2.26, gld gained support for the ELF gABI format. > >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > >>> if test $in_tree_ld = yes ; then > >>> gcc_cv_ld_compress_debug=0 > >>> if test $ld_is_mold = yes; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > >>> - gcc_cv_ld_compress_debug=2 > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > >>> - && test $in_tree_ld_is_elf = yes; then > >>> - gcc_cv_ld_compress_debug=1 > >>> fi > >>> elif echo "$ld_ver" | grep GNU > /dev/null; then > >>> if test $ld_is_mold = yes; then > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> elif test "$ld_vers_major" -lt 2 \ > >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > >>> gcc_cv_ld_compress_debug=0 > >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > >>> - gcc_cv_ld_compress_debug=1 > >>> else > >>> gcc_cv_ld_compress_debug=3 > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> fi > >>> - if test $ld_is_gold = yes; then > >>> - gcc_cv_ld_compress_debug=2 > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > >>> - fi > >>> else > >>> changequote(,)dnl > >>> case "${target}" in > >>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > >>> index 757775ea576..467659cb094 100644 > >>> --- a/gcc/doc/invoke.texi > >>> +++ b/gcc/doc/invoke.texi > >>> @@ -10775,12 +10775,11 @@ location views are enabled. > >>> Produce compressed debug sections in DWARF format, if that is supported. > >>> If @var{type} is not given, the default type depends on the capabilities > >>> of the assembler and linker used. @var{type} may be one of > >>> -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib > >>> -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib > >>> -compression in traditional GNU format). If the linker doesn't support > >>> -writing compressed debug sections, the option is rejected. Otherwise, > >>> -if the assembler does not support them, @option{-gz} is silently ignored > >>> -when producing object files. > >>> +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib > >>> +compression in ELF gABI format). If the linker doesn't support writing > >>> +compressed debug sections, the option is rejected. Otherwise, if the > >>> +assembler does not support them, @option{-gz} is silently ignored when > >>> +producing object files. > >>> > >>> @item -femit-struct-debug-baseonly > >>> @opindex femit-struct-debug-baseonly > >>> diff --git a/gcc/gcc.cc b/gcc/gcc.cc > >>> index 5cbb38560b2..660cd6f4ef4 100644 > >>> --- a/gcc/gcc.cc > >>> +++ b/gcc/gcc.cc > >>> @@ -827,22 +827,11 @@ proper position among the other output files. */ > >>> /* No linker support. */ > >>> #define LINK_COMPRESS_DEBUG_SPEC \ > >>> " %{gz*:%e-gz is not supported in this configuration} " > >>> -#elif HAVE_LD_COMPRESS_DEBUG == 1 > >>> -/* GNU style on input, GNU ld options. Reject, not useful. */ > >>> -#define LINK_COMPRESS_DEBUG_SPEC \ > >>> - " %{gz*:%e-gz is not supported in this configuration} " > >>> -#elif HAVE_LD_COMPRESS_DEBUG == 2 > >>> -/* GNU style, GNU gold options. */ > >>> -#define LINK_COMPRESS_DEBUG_SPEC \ > >>> - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > >>> #elif HAVE_LD_COMPRESS_DEBUG == 3 > >>> /* ELF gABI style. */ > >>> #define LINK_COMPRESS_DEBUG_SPEC \ > >>> " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > >>> - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > >>> + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" > >>> #else > >>> #error Unknown value for HAVE_LD_COMPRESS_DEBUG. > >>> #endif > >>> @@ -891,18 +880,11 @@ proper position among the other output files. */ > >>> /* No assembler support. Ignore silently. */ > >>> #define ASM_COMPRESS_DEBUG_SPEC \ > >>> " %{gz*:} " > >>> -#elif HAVE_AS_COMPRESS_DEBUG == 1 > >>> -/* GNU style, GNU as options. */ > >>> -#define ASM_COMPRESS_DEBUG_SPEC \ > >>> - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ > >>> - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ > >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > >>> #elif HAVE_AS_COMPRESS_DEBUG == 2 > >>> /* ELF gABI style. */ > >>> #define ASM_COMPRESS_DEBUG_SPEC \ > >>> " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ > >>> - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ > >>> - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > >>> + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" > >>> #else > >>> #error Unknown value for HAVE_AS_COMPRESS_DEBUG. > >>> #endif > >>> -- > >>> 2.37.0.rc0.161.g10f37bed90-goog > >>> >
On Wed, Sep 21, 2022 at 12:37 AM Richard Biener <richard.guenther@gmail.com> wrote: > > On Tue, Sep 20, 2022 at 2:55 PM Martin Liška <mliska@suse.cz> wrote: > > > > On 7/1/22 09:20, Fangrui Song via Gcc-patches wrote: > > > On 2022-07-01, Andrew Pinski wrote: > > >> On Thu, Jun 30, 2022 at 11:58 PM Fangrui Song via Gcc-patches > > >> <gcc-patches@gcc.gnu.org> wrote: > > >>> > > >>> From: Fangrui Song <i@maskray.me> > > >>> > > >>> SHF_COMPRESSED style zlib has been supported since binutils 2.26 > > >>> and the legacy zlib-gnu option hasn't gain adoption. > > >>> According to Debian Code Search (`gz=zlib-gnu`), no project uses > > >>> -gz=zlib-gnu (valgrind has a configure to use -gz=zlib). > > >>> Remove support for the legacy zlib-gnu and simplify configure.ac by > > >>> removing zlib-gnu ld/as check. > > >> > > >> A couple of things, you are missing a changelog. > > > > > > Sorry. > > > > > >> Second, why remove something which is still working? > > > > Hi. > > > > I do support the option removal, while I would replace the removal with a warning > > saying no compression will be used. > > > > > > > > It's unused and its existence causes confusion: the paradox of choice. > > > People may assume the support may be good but newer DWARF consumers may > > > not support the legacy format. > > > > Agree, the compression format is legacy. I verified all openSUSE packages (15k) > > and there's no project actively using it. > > > > > > > > The other motivation is to clean up it a bit. I foresee that someone > > > will add --compress-debug-sections=zstd to binutils and configure.ac and > > > gcc/gcc.cc would become more messy. > > > > The argument makes sense, it will be even bigger mess. > > > > @Richi: Is it something we can deprecate for GCC 13? > > What's the practical difference between zlib and zlib-gnu? Can we just > map zlib-gnu to zlib? If it's all configure time what's the point in > "deprecating" it? zlib-gnu uses the legacy .zdebug section name with a "ZLIB" magic: http://www.linker-aliens.org/blogs/ali/entry/elf_section_compression/ https://maskray.me/blog/2022-01-23-compressed-debug-sections has some history about how the zlib-gabi replacement: ELFCOMPRESS_ZLIB . FWIW I removed -gz=zlib-gnu from clang and .zdebug support from various llvm-project tools. I cannot really find uses of -gz=zlib-gnu in the wild. Users can always fallback to -Wa, and -Wl, if their tools are so old that ELFCOMPRESS_ZLIB is unsupported. > Richard. > > > > > Martin > > > > > > > >> Third, why not just make gz=zlib-gnu as an alias to gz=zlib instead so > > >> if someone used it before it will still work. we try not to remove > > >> options; have them emit a warning and be ignored (or moved over to the > > >> closed option). > > > > > > Changing the semantics of -gz=zlib-gnu would be even more confusing. > > > > > >> Thanks, > > >> Andrew > > >> > > >>> --- > > >>> gcc/common.opt | 3 --- > > >>> gcc/configure | 33 ++++++--------------------------- > > >>> gcc/configure.ac | 29 ++++------------------------- > > >>> gcc/doc/invoke.texi | 11 +++++------ > > >>> gcc/gcc.cc | 22 ++-------------------- > > >>> 5 files changed, 17 insertions(+), 81 deletions(-) > > >>> > > >>> diff --git a/gcc/common.opt b/gcc/common.opt > > >>> index e7a51e882ba..8754d93d545 100644 > > >>> --- a/gcc/common.opt > > >>> +++ b/gcc/common.opt > > >>> @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) > > >>> EnumValue > > >>> Enum(compressed_debug_sections) String(zlib) Value(1) > > >>> > > >>> -EnumValue > > >>> -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) > > >>> - > > >>> gz > > >>> Common Driver > > >>> Generate compressed debug sections. > > >>> diff --git a/gcc/configure b/gcc/configure > > >>> index 62872d132ea..ca87e875e9d 100755 > > >>> --- a/gcc/configure > > >>> +++ b/gcc/configure > > >>> @@ -19674,7 +19674,7 @@ else > > >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > > >>> lt_status=$lt_dlunknown > > >>> cat > conftest.$ac_ext <<_LT_EOF > > >>> -#line 19679 "configure" > > >>> +#line 19677 "configure" > > >>> #include "confdefs.h" > > >>> > > >>> #if HAVE_DLFCN_H > > >>> @@ -19780,7 +19780,7 @@ else > > >>> lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > > >>> lt_status=$lt_dlunknown > > >>> cat > conftest.$ac_ext <<_LT_EOF > > >>> -#line 19785 "configure" > > >>> +#line 19783 "configure" > > >>> #include "confdefs.h" > > >>> > > >>> #if HAVE_DLFCN_H > > >>> @@ -29711,20 +29711,13 @@ else > > >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > > >>> then > > >>> gcc_cv_as_compress_debug=0 > > >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, > > >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > > >>> # defaulting to the ELF gABI format. > > >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > > >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > > >>> then > > >>> gcc_cv_as_compress_debug=2 > > >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" > > >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > > >>> - # Before binutils 2.26, gas only supported --compress-debug-options and > > >>> - # emitted the traditional GNU format. > > >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > > >>> - then > > >>> - gcc_cv_as_compress_debug=1 > > >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" > > >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > > >>> else > > >>> gcc_cv_as_compress_debug=0 > > >>> fi > > >>> @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } > > >>> > > >>> { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 > > >>> $as_echo_n "checking linker for compressed debug sections... " >&6; } > > >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 > > >>> -# In binutils 2.26, gld gained support for the ELF gABI format. > > >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > > >>> if test $in_tree_ld = yes ; then > > >>> gcc_cv_ld_compress_debug=0 > > >>> if test $ld_is_mold = yes; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > > >>> - gcc_cv_ld_compress_debug=2 > > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> - && test $in_tree_ld_is_elf = yes; then > > >>> - gcc_cv_ld_compress_debug=1 > > >>> fi > > >>> elif echo "$ld_ver" | grep GNU > /dev/null; then > > >>> if test $ld_is_mold = yes; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> elif test "$ld_vers_major" -lt 2 \ > > >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > > >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > > >>> gcc_cv_ld_compress_debug=0 > > >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > > >>> - gcc_cv_ld_compress_debug=1 > > >>> else > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> fi > > >>> - if test $ld_is_gold = yes; then > > >>> - gcc_cv_ld_compress_debug=2 > > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - fi > > >>> else > > >>> case "${target}" in > > >>> *-*-solaris2*) > > >>> diff --git a/gcc/configure.ac b/gcc/configure.ac > > >>> index 446747311a6..f40f75271c2 100644 > > >>> --- a/gcc/configure.ac > > >>> +++ b/gcc/configure.ac > > >>> @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], > > >>> if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null > > >>> then > > >>> gcc_cv_as_compress_debug=0 > > >>> - # Since binutils 2.26, gas supports --compress-debug-sections=type, > > >>> + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, > > >>> # defaulting to the ELF gABI format. > > >>> - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 > > >>> + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 > > >>> then > > >>> gcc_cv_as_compress_debug=2 > > >>> gcc_cv_as_compress_debug_option="--compress-debug-sections" > > >>> gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > > >>> - # Before binutils 2.26, gas only supported --compress-debug-options and > > >>> - # emitted the traditional GNU format. > > >>> - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 > > >>> - then > > >>> - gcc_cv_as_compress_debug=1 > > >>> - gcc_cv_as_compress_debug_option="--compress-debug-sections" > > >>> - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" > > >>> else > > >>> gcc_cv_as_compress_debug=0 > > >>> fi]) > > >>> @@ -6131,42 +6124,28 @@ fi > > >>> AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) > > >>> > > >>> AC_MSG_CHECKING(linker for compressed debug sections) > > >>> -# gold/gld support compressed debug sections since binutils 2.19/2.21 > > >>> -# In binutils 2.26, gld gained support for the ELF gABI format. > > >>> +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. > > >>> if test $in_tree_ld = yes ; then > > >>> gcc_cv_ld_compress_debug=0 > > >>> if test $ld_is_mold = yes; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then > > >>> - gcc_cv_ld_compress_debug=2 > > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ > > >>> - && test $in_tree_ld_is_elf = yes; then > > >>> - gcc_cv_ld_compress_debug=1 > > >>> fi > > >>> elif echo "$ld_ver" | grep GNU > /dev/null; then > > >>> if test $ld_is_mold = yes; then > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> elif test "$ld_vers_major" -lt 2 \ > > >>> - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then > > >>> + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > > >>> gcc_cv_ld_compress_debug=0 > > >>> - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then > > >>> - gcc_cv_ld_compress_debug=1 > > >>> else > > >>> gcc_cv_ld_compress_debug=3 > > >>> gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> fi > > >>> - if test $ld_is_gold = yes; then > > >>> - gcc_cv_ld_compress_debug=2 > > >>> - gcc_cv_ld_compress_debug_option="--compress-debug-sections" > > >>> - fi > > >>> else > > >>> changequote(,)dnl > > >>> case "${target}" in > > >>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > > >>> index 757775ea576..467659cb094 100644 > > >>> --- a/gcc/doc/invoke.texi > > >>> +++ b/gcc/doc/invoke.texi > > >>> @@ -10775,12 +10775,11 @@ location views are enabled. > > >>> Produce compressed debug sections in DWARF format, if that is supported. > > >>> If @var{type} is not given, the default type depends on the capabilities > > >>> of the assembler and linker used. @var{type} may be one of > > >>> -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib > > >>> -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib > > >>> -compression in traditional GNU format). If the linker doesn't support > > >>> -writing compressed debug sections, the option is rejected. Otherwise, > > >>> -if the assembler does not support them, @option{-gz} is silently ignored > > >>> -when producing object files. > > >>> +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib > > >>> +compression in ELF gABI format). If the linker doesn't support writing > > >>> +compressed debug sections, the option is rejected. Otherwise, if the > > >>> +assembler does not support them, @option{-gz} is silently ignored when > > >>> +producing object files. > > >>> > > >>> @item -femit-struct-debug-baseonly > > >>> @opindex femit-struct-debug-baseonly > > >>> diff --git a/gcc/gcc.cc b/gcc/gcc.cc > > >>> index 5cbb38560b2..660cd6f4ef4 100644 > > >>> --- a/gcc/gcc.cc > > >>> +++ b/gcc/gcc.cc > > >>> @@ -827,22 +827,11 @@ proper position among the other output files. */ > > >>> /* No linker support. */ > > >>> #define LINK_COMPRESS_DEBUG_SPEC \ > > >>> " %{gz*:%e-gz is not supported in this configuration} " > > >>> -#elif HAVE_LD_COMPRESS_DEBUG == 1 > > >>> -/* GNU style on input, GNU ld options. Reject, not useful. */ > > >>> -#define LINK_COMPRESS_DEBUG_SPEC \ > > >>> - " %{gz*:%e-gz is not supported in this configuration} " > > >>> -#elif HAVE_LD_COMPRESS_DEBUG == 2 > > >>> -/* GNU style, GNU gold options. */ > > >>> -#define LINK_COMPRESS_DEBUG_SPEC \ > > >>> - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > > >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > > >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > > >>> #elif HAVE_LD_COMPRESS_DEBUG == 3 > > >>> /* ELF gABI style. */ > > >>> #define LINK_COMPRESS_DEBUG_SPEC \ > > >>> " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ > > >>> - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ > > >>> - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > > >>> + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" > > >>> #else > > >>> #error Unknown value for HAVE_LD_COMPRESS_DEBUG. > > >>> #endif > > >>> @@ -891,18 +880,11 @@ proper position among the other output files. */ > > >>> /* No assembler support. Ignore silently. */ > > >>> #define ASM_COMPRESS_DEBUG_SPEC \ > > >>> " %{gz*:} " > > >>> -#elif HAVE_AS_COMPRESS_DEBUG == 1 > > >>> -/* GNU style, GNU as options. */ > > >>> -#define ASM_COMPRESS_DEBUG_SPEC \ > > >>> - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ > > >>> - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ > > >>> - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " > > >>> #elif HAVE_AS_COMPRESS_DEBUG == 2 > > >>> /* ELF gABI style. */ > > >>> #define ASM_COMPRESS_DEBUG_SPEC \ > > >>> " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ > > >>> - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ > > >>> - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " > > >>> + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" > > >>> #else > > >>> #error Unknown value for HAVE_AS_COMPRESS_DEBUG. > > >>> #endif > > >>> -- > > >>> 2.37.0.rc0.161.g10f37bed90-goog > > >>> > >
On 9/21/22 09:36, Richard Biener wrote: > If it's all configure time what's the point in > "deprecating" it? Note it's one of our options -gz where 'zlib-gnu' is one of the possible option values. Martin
On Wed, Sep 21, 2022 at 9:49 AM Martin Liška <mliska@suse.cz> wrote: > > On 9/21/22 09:36, Richard Biener wrote: > > If it's all configure time what's the point in > > "deprecating" it? > > Note it's one of our options -gz where 'zlib-gnu' is one of the possible option values. I see. Not sure if deprecating is really necessary, you need to keep recognizing zlib-gnu as no-op anyway. So I'd just go ahead and remove support for it. > Martin
diff --git a/gcc/common.opt b/gcc/common.opt index e7a51e882ba..8754d93d545 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3424,9 +3424,6 @@ Enum(compressed_debug_sections) String(none) Value(0) EnumValue Enum(compressed_debug_sections) String(zlib) Value(1) -EnumValue -Enum(compressed_debug_sections) String(zlib-gnu) Value(2) - gz Common Driver Generate compressed debug sections. diff --git a/gcc/configure b/gcc/configure index 62872d132ea..ca87e875e9d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -19674,7 +19674,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19679 "configure" +#line 19677 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19780,7 +19780,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19785 "configure" +#line 19783 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -29711,20 +29711,13 @@ else if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null then gcc_cv_as_compress_debug=0 - # Since binutils 2.26, gas supports --compress-debug-sections=type, + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, # defaulting to the ELF gABI format. - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 then gcc_cv_as_compress_debug=2 gcc_cv_as_compress_debug_option="--compress-debug-sections" gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" - # Before binutils 2.26, gas only supported --compress-debug-options and - # emitted the traditional GNU format. - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 - then - gcc_cv_as_compress_debug=1 - gcc_cv_as_compress_debug_option="--compress-debug-sections" - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" else gcc_cv_as_compress_debug=0 fi @@ -30238,42 +30231,28 @@ $as_echo "$gcc_cv_ld_eh_gc_sections_bug" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for compressed debug sections" >&5 $as_echo_n "checking linker for compressed debug sections... " >&6; } -# gold/gld support compressed debug sections since binutils 2.19/2.21 -# In binutils 2.26, gld gained support for the ELF gABI format. +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=0 if test $ld_is_mold = yes; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then - gcc_cv_ld_compress_debug=2 - gcc_cv_ld_compress_debug_option="--compress-debug-sections" elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes; then - gcc_cv_ld_compress_debug=1 fi elif echo "$ld_ver" | grep GNU > /dev/null; then if test $ld_is_mold = yes; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" elif test "$ld_vers_major" -lt 2 \ - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then gcc_cv_ld_compress_debug=0 - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then - gcc_cv_ld_compress_debug=1 else gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" fi - if test $ld_is_gold = yes; then - gcc_cv_ld_compress_debug=2 - gcc_cv_ld_compress_debug_option="--compress-debug-sections" - fi else case "${target}" in *-*-solaris2*) diff --git a/gcc/configure.ac b/gcc/configure.ac index 446747311a6..f40f75271c2 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5733,20 +5733,13 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections], if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null then gcc_cv_as_compress_debug=0 - # Since binutils 2.26, gas supports --compress-debug-sections=type, + # Since binutils 2.26, gas supports --compress-debug-sections=zlib, # defaulting to the ELF gABI format. - elif $gcc_cv_as --compress-debug-sections=zlib-gnu -o conftest.o conftest.s > /dev/null 2>&1 + elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1 then gcc_cv_as_compress_debug=2 gcc_cv_as_compress_debug_option="--compress-debug-sections" gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" - # Before binutils 2.26, gas only supported --compress-debug-options and - # emitted the traditional GNU format. - elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1 - then - gcc_cv_as_compress_debug=1 - gcc_cv_as_compress_debug_option="--compress-debug-sections" - gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections" else gcc_cv_as_compress_debug=0 fi]) @@ -6131,42 +6124,28 @@ fi AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug) AC_MSG_CHECKING(linker for compressed debug sections) -# gold/gld support compressed debug sections since binutils 2.19/2.21 -# In binutils 2.26, gld gained support for the ELF gABI format. +# GNU ld/gold support --compressed-debug-sections=zlib since binutils 2.26. if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=0 if test $ld_is_mold = yes; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then - gcc_cv_ld_compress_debug=2 - gcc_cv_ld_compress_debug_option="--compress-debug-sections" elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 26 -o "$gcc_cv_gld_major_version" -gt 2 \ && test $in_tree_ld_is_elf = yes && test $ld_is_gold = no; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" - elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes; then - gcc_cv_ld_compress_debug=1 fi elif echo "$ld_ver" | grep GNU > /dev/null; then if test $ld_is_mold = yes; then gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" elif test "$ld_vers_major" -lt 2 \ - || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then + || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then gcc_cv_ld_compress_debug=0 - elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then - gcc_cv_ld_compress_debug=1 else gcc_cv_ld_compress_debug=3 gcc_cv_ld_compress_debug_option="--compress-debug-sections" fi - if test $ld_is_gold = yes; then - gcc_cv_ld_compress_debug=2 - gcc_cv_ld_compress_debug_option="--compress-debug-sections" - fi else changequote(,)dnl case "${target}" in diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 757775ea576..467659cb094 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10775,12 +10775,11 @@ location views are enabled. Produce compressed debug sections in DWARF format, if that is supported. If @var{type} is not given, the default type depends on the capabilities of the assembler and linker used. @var{type} may be one of -@samp{none} (don't compress debug sections), @samp{zlib} (use zlib -compression in ELF gABI format), or @samp{zlib-gnu} (use zlib -compression in traditional GNU format). If the linker doesn't support -writing compressed debug sections, the option is rejected. Otherwise, -if the assembler does not support them, @option{-gz} is silently ignored -when producing object files. +@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib +compression in ELF gABI format). If the linker doesn't support writing +compressed debug sections, the option is rejected. Otherwise, if the +assembler does not support them, @option{-gz} is silently ignored when +producing object files. @item -femit-struct-debug-baseonly @opindex femit-struct-debug-baseonly diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 5cbb38560b2..660cd6f4ef4 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -827,22 +827,11 @@ proper position among the other output files. */ /* No linker support. */ #define LINK_COMPRESS_DEBUG_SPEC \ " %{gz*:%e-gz is not supported in this configuration} " -#elif HAVE_LD_COMPRESS_DEBUG == 1 -/* GNU style on input, GNU ld options. Reject, not useful. */ -#define LINK_COMPRESS_DEBUG_SPEC \ - " %{gz*:%e-gz is not supported in this configuration} " -#elif HAVE_LD_COMPRESS_DEBUG == 2 -/* GNU style, GNU gold options. */ -#define LINK_COMPRESS_DEBUG_SPEC \ - " %{gz|gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " #elif HAVE_LD_COMPRESS_DEBUG == 3 /* ELF gABI style. */ #define LINK_COMPRESS_DEBUG_SPEC \ " %{gz|gz=zlib:" LD_COMPRESS_DEBUG_OPTION "=zlib}" \ - " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" \ - " %{gz=zlib-gnu:" LD_COMPRESS_DEBUG_OPTION "=zlib-gnu} " + " %{gz=none:" LD_COMPRESS_DEBUG_OPTION "=none}" #else #error Unknown value for HAVE_LD_COMPRESS_DEBUG. #endif @@ -891,18 +880,11 @@ proper position among the other output files. */ /* No assembler support. Ignore silently. */ #define ASM_COMPRESS_DEBUG_SPEC \ " %{gz*:} " -#elif HAVE_AS_COMPRESS_DEBUG == 1 -/* GNU style, GNU as options. */ -#define ASM_COMPRESS_DEBUG_SPEC \ - " %{gz|gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "}" \ - " %{gz=none:" AS_NO_COMPRESS_DEBUG_OPTION "}" \ - " %{gz=zlib:%e-gz=zlib is not supported in this configuration} " #elif HAVE_AS_COMPRESS_DEBUG == 2 /* ELF gABI style. */ #define ASM_COMPRESS_DEBUG_SPEC \ " %{gz|gz=zlib:" AS_COMPRESS_DEBUG_OPTION "=zlib}" \ - " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" \ - " %{gz=zlib-gnu:" AS_COMPRESS_DEBUG_OPTION "=zlib-gnu} " + " %{gz=none:" AS_COMPRESS_DEBUG_OPTION "=none}" #else #error Unknown value for HAVE_AS_COMPRESS_DEBUG. #endif