From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 652A53856DD2; Thu, 21 Apr 2022 08:19:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 652A53856DD2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-8212] Support --compress-debug-sections for ld.mold. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: 504b02c70abcc31e0e9b56e69f82f85b5261bca9 X-Git-Newrev: 811c7fbd147991645e6116897f07d8a406b864e6 Message-Id: <20220421081935.652A53856DD2@sourceware.org> Date: Thu, 21 Apr 2022 08:19:35 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 08:19:35 -0000 https://gcc.gnu.org/g:811c7fbd147991645e6116897f07d8a406b864e6 commit r12-8212-g811c7fbd147991645e6116897f07d8a406b864e6 Author: Martin Liska Date: Thu Apr 21 10:17:34 2022 +0200 Support --compress-debug-sections for ld.mold. gcc/ChangeLog: * configure.ac: Enable compressed debug sections for mold linker. * configure: Regenerate. Diff: --- gcc/configure | 10 ++++++++-- gcc/configure.ac | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/configure b/gcc/configure index 1c1195e95cb..5ce0557719a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -30623,7 +30623,10 @@ $as_echo_n "checking linker for compressed debug sections... " >&6; } # In binutils 2.26, gld gained support for the ELF gABI format. if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=0 - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ + 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" @@ -30636,7 +30639,10 @@ if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=1 fi elif echo "$ld_ver" | grep GNU > /dev/null; then - if test "$ld_vers_major" -lt 2 \ + 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 gcc_cv_ld_compress_debug=0 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then diff --git a/gcc/configure.ac b/gcc/configure.ac index ea67fb62292..23bee7010a3 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -6264,7 +6264,10 @@ AC_MSG_CHECKING(linker for compressed debug sections) # In binutils 2.26, gld gained support for the ELF gABI format. if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=0 - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \ + 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" @@ -6277,7 +6280,10 @@ if test $in_tree_ld = yes ; then gcc_cv_ld_compress_debug=1 fi elif echo "$ld_ver" | grep GNU > /dev/null; then - if test "$ld_vers_major" -lt 2 \ + 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 gcc_cv_ld_compress_debug=0 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then