From patchwork Thu Apr 21 08:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1620037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Fi91jb/G; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Scl0kybr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KkWVt5gqdz9sDX for ; Thu, 21 Apr 2022 18:51:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 70739385624F for ; Thu, 21 Apr 2022 08:51:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id AD32D3856DDA for ; Thu, 21 Apr 2022 08:18:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD32D3856DDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 81ACC1F752 for ; Thu, 21 Apr 2022 08:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650529129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qT/Zz1A9r6RvTRivloESOX4PlTsnlyLKpowTKnHZrpo=; b=Fi91jb/GC45SnyBs10kLJZdh8HPFHP9DFPvpL8bGPLTJxxlG/skbJd6W/UgfErJ0nJGi+D YCvXQ2Hu1jVH1R/zTs6ZsHJIPiHlk7tVIW5jDsJ5CCdOdeXESGNXlPULmaobHtVdqwWZeb NVssLKzWBBvpEMAE+33e8R4tp4TxOe8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650529129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qT/Zz1A9r6RvTRivloESOX4PlTsnlyLKpowTKnHZrpo=; b=Scl0kybrqqUOVgwh2mwFPmHtk6Jc1RLduES9Nb3RSEIwffpxKzypE8NJFG3QTdpSd9pQ/B 5B519gZ5h0u+zdCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 55DA913A84 for ; Thu, 21 Apr 2022 08:18:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id w5l9E2kTYWL6JAAAMHmgww (envelope-from ) for ; Thu, 21 Apr 2022 08:18:49 +0000 Message-ID: <6b2dc307-aba9-4dca-90ab-aabd83538601@suse.cz> Date: Thu, 21 Apr 2022 10:18:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][PUSHED] Support --compress-debug-sections for ld.mold. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Pushed to master. Cheers, Martin gcc/ChangeLog: * configure.ac: Enable compressed debug sections for mold linker. * configure: Regenerate. --- 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