Message ID | 20220829092917.477788-1-rv@rasmusvillemoes.dk |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1331985wro; Mon, 29 Aug 2022 02:30:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4gtOZT6SZQVaZfgHyqZ9vlIeWJvXtX9TZBy4Ewntfp4lTKg3HsMtKuUnWbSS5eAF9dW1Gi X-Received: by 2002:aa7:dc10:0:b0:440:b446:c0cc with SMTP id b16-20020aa7dc10000000b00440b446c0ccmr15879437edu.34.1661765419483; Mon, 29 Aug 2022 02:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661765419; cv=none; d=google.com; s=arc-20160816; b=J/lBYIGAMRGfoewu9N89UmZUw4++q6/92i282azV3dwBZtfnFoAp4zFscLkKnUVUGG 2PKadwAyEqep5sGiiz+xOACqM/e1Zk3BeOgr+ZTtM6Neb6RHcLA+dnwKcUmDqPz5jjg3 90kg3XZekoApmZH3J7tWKWCzomZAVyvXwcJ5oPvXuaBDPILBTJEtTVm/a8lCUmXi5VzM Lu9vifKBPZWXCysQNqzrrUBYulY11qkQd8mfIc/lD+7ARZea5JzVHiUjWjyg5W84XIGy vnuGaYizMQs0JzlOcadhf5DQYyNyO8ameBIpeN0skS9nxdzJbhY8ppw/twgsxFFnDg33 QWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=9V4ExW8j5ojkOHfPFYxcO0CBWQCFLV/om95aqolYuCc=; b=ip2hJx9CLMl5myrlddjn225Q1kLS97KF4uzh+0L5gQF3zlkffnK8U6F7VPJRba6WM1 6/MDLqO+cymr143wu0lfVS1+1cBiBO/raIDz+Qa0u3tPKDNUs4vCGQG1/DdZOKc/L7V5 AzL3qbG4vLxeTlCeskh1wG93650QtTXlYalbVA+1tubLuVZXyyhVwNSzU9C5485WbZb+ yzuzqdlF+xsrbGuN+FYX2oXGwEGPvCbjVWyI2AsbKbTOwEhgGgINuX89teO5N5enDnVi j/eqW4fHGIQXH3glBUaoOPhR5B8aSIXGGs1M4IoE0zz8hzQDoPVK5zYsQF6+Tvl0s1Ps t9rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Z9uEF7So; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f2-20020a50a6c2000000b0043ddc200046si6126711edc.454.2022.08.29.02.30.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 02:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Z9uEF7So; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A998E3857BB8 for <ouuuleilei@gmail.com>; Mon, 29 Aug 2022 09:29:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id 036493858D32 for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 09:29:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 036493858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rasmusvillemoes.dk Received: by mail-lf1-x12a.google.com with SMTP id p5so7172117lfc.6 for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 02:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=9V4ExW8j5ojkOHfPFYxcO0CBWQCFLV/om95aqolYuCc=; b=Z9uEF7SosepF8F9FgFS7P4LhAf8JKcY1DcHAPiLhzQ/xocmzz2yvSL5MzLLT12JXRn aZjV0d3Y1uITuHv9tgqMbCmpQLl2mXwMAUC9vlYfVbgzxoSJLX9MeP/41TWc8082VdXD ewxIRI9PK5YZ6lJCYVD/+8aC8n9ak71F5T98Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=9V4ExW8j5ojkOHfPFYxcO0CBWQCFLV/om95aqolYuCc=; b=qJ+W0RA7YVElz5Kd7O1rRzjwG3N+2eFUEgFzAekKhcsy1OsX6pFjAJXNZvqiNXOk4G Zd4sTa7D3FdDpNnoIdW4JKwIqOzt8ggIK9douXbPAZ/EvOSzLdiI95neko727CIA10Hi DphX3ItJWHVwezd87IK15wKK1WhNRp+X46VyM41M+qq/ZRvCamBCkIrI8wofR2z6+p1P WOV/IfneEl3z6nKVSwf0pe0TlsftcobElUcGOxm2NYo+U49XyH+YmuGoDDEecToj71Gw bjh+UKZNbTeNrtsZ3HchwGR/qsmKhDzdyuHrpZK5ZFuX/fcYNhHA2Gh12DTAGHGjWqw6 /rMA== X-Gm-Message-State: ACgBeo3UwqgN8LDluUOEgCS9HEvzYAsJ4SGIcpvxbfo/rWwjiIjEHsYg 9TJoSiFk6hmBWtnDWxyU51vqnHhgFU640teN X-Received: by 2002:a05:6512:2608:b0:494:7168:888a with SMTP id bt8-20020a056512260800b004947168888amr496780lfb.440.1661765365572; Mon, 29 Aug 2022 02:29:25 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id f13-20020a056512092d00b00492ed031aacsm1208533lft.173.2022.08.29.02.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 02:29:24 -0700 (PDT) From: Rasmus Villemoes <rv@rasmusvillemoes.dk> To: gcc-patches@gcc.gnu.org Subject: [PATCH] gcc: honour -ffile-prefix-map in ASM_MAP [PR93371] Date: Mon, 29 Aug 2022 11:29:17 +0200 Message-Id: <20220829092917.477788-1-rv@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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> Cc: Vagrant Cascadian <vagrant@debian.org>, Rasmus Villemoes <rv@rasmusvillemoes.dk> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742487336242298094?= X-GMAIL-MSGID: =?utf-8?q?1742487336242298094?= |
Series |
gcc: honour -ffile-prefix-map in ASM_MAP [PR93371]
|
|
Commit Message
Rasmus Villemoes
Aug. 29, 2022, 9:29 a.m. UTC
-ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map and -fdebug-prefix-map. However, when building .S or .s files, gas is not called with the appropriate --debug-prefix-map option when -ffile-prefix-map is used. While the user can specify -fdebug-prefix-map when building assembly files via gcc, it's more ergonomic to also support -ffile-prefix-map; especially since for .S files that could contain the __FILE__ macro, one would then also have to specify -fmacro-prefix-map. gcc: PR driver/93371 * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. --- I've tested that this works as expected, both by looking at how gas is now invoked, and by running 'strings' on the generated .o file. But I don't know how to add something to the testsuite for this. I stumbled on this since it came up on the U-Boot mailing list: https://lore.kernel.org/u-boot/4ed9f811-5244-54ef-b58e-83dba51510e4@prevas.dk/ . gcc/gcc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 29/08/2022 11.29, Rasmus Villemoes wrote: > -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map > and -fdebug-prefix-map. However, when building .S or .s files, gas is > not called with the appropriate --debug-prefix-map option when > -ffile-prefix-map is used. > > While the user can specify -fdebug-prefix-map when building assembly > files via gcc, it's more ergonomic to also support -ffile-prefix-map; > especially since for .S files that could contain the __FILE__ macro, > one would then also have to specify -fmacro-prefix-map. > > gcc: > PR driver/93371 > * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. > --- > > I've tested that this works as expected, both by looking at how gas is > now invoked, and by running 'strings' on the generated .o file. But I > don't know how to add something to the testsuite for this. Is this ok for trunk? If so, how about older maintained branches? And does anyone have ideas for how I could add a test case? > > I stumbled on this since it came up on the U-Boot mailing list: > https://lore.kernel.org/u-boot/4ed9f811-5244-54ef-b58e-83dba51510e4@prevas.dk/ > . > > gcc/gcc.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/gcc.cc b/gcc/gcc.cc > index b6d562a92f0..44eafc60187 100644 > --- a/gcc/gcc.cc > +++ b/gcc/gcc.cc > @@ -878,7 +878,7 @@ proper position among the other output files. */ > #endif > > #ifdef HAVE_AS_DEBUG_PREFIX_MAP > -#define ASM_MAP " %{fdebug-prefix-map=*:--debug-prefix-map %*}" > +#define ASM_MAP " %{ffile-prefix-map=*:--debug-prefix-map %*} %{fdebug-prefix-map=*:--debug-prefix-map %*}" > #else > #define ASM_MAP "" > #endif
On 12/09/2022 11.46, Rasmus Villemoes wrote: > On 29/08/2022 11.29, Rasmus Villemoes wrote: >> -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map >> and -fdebug-prefix-map. However, when building .S or .s files, gas is >> not called with the appropriate --debug-prefix-map option when >> -ffile-prefix-map is used. >> >> While the user can specify -fdebug-prefix-map when building assembly >> files via gcc, it's more ergonomic to also support -ffile-prefix-map; >> especially since for .S files that could contain the __FILE__ macro, >> one would then also have to specify -fmacro-prefix-map. >> >> gcc: >> PR driver/93371 >> * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. >> --- >> >> I've tested that this works as expected, both by looking at how gas is >> now invoked, and by running 'strings' on the generated .o file. But I >> don't know how to add something to the testsuite for this. > > Is this ok for trunk? If so, how about older maintained branches? > > And does anyone have ideas for how I could add a test case? ping. > >> >> I stumbled on this since it came up on the U-Boot mailing list: >> https://lore.kernel.org/u-boot/4ed9f811-5244-54ef-b58e-83dba51510e4@prevas.dk/ >> . >> >> gcc/gcc.cc | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gcc/gcc.cc b/gcc/gcc.cc >> index b6d562a92f0..44eafc60187 100644 >> --- a/gcc/gcc.cc >> +++ b/gcc/gcc.cc >> @@ -878,7 +878,7 @@ proper position among the other output files. */ >> #endif >> >> #ifdef HAVE_AS_DEBUG_PREFIX_MAP >> -#define ASM_MAP " %{fdebug-prefix-map=*:--debug-prefix-map %*}" >> +#define ASM_MAP " %{ffile-prefix-map=*:--debug-prefix-map %*} %{fdebug-prefix-map=*:--debug-prefix-map %*}" >> #else >> #define ASM_MAP "" >> #endif >
On 27/09/2022 08.54, Rasmus Villemoes wrote: > On 12/09/2022 11.46, Rasmus Villemoes wrote: >> On 29/08/2022 11.29, Rasmus Villemoes wrote: >>> -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map >>> and -fdebug-prefix-map. However, when building .S or .s files, gas is >>> not called with the appropriate --debug-prefix-map option when >>> -ffile-prefix-map is used. >>> >>> While the user can specify -fdebug-prefix-map when building assembly >>> files via gcc, it's more ergonomic to also support -ffile-prefix-map; >>> especially since for .S files that could contain the __FILE__ macro, >>> one would then also have to specify -fmacro-prefix-map. >>> >>> gcc: >>> PR driver/93371 >>> * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. >>> --- >>> >>> I've tested that this works as expected, both by looking at how gas is >>> now invoked, and by running 'strings' on the generated .o file. But I >>> don't know how to add something to the testsuite for this. >> >> Is this ok for trunk? If so, how about older maintained branches? >> >> And does anyone have ideas for how I could add a test case? > > ping. > ping^2
On 8/29/22 03:29, Rasmus Villemoes wrote: > -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map > and -fdebug-prefix-map. However, when building .S or .s files, gas is > not called with the appropriate --debug-prefix-map option when > -ffile-prefix-map is used. > > While the user can specify -fdebug-prefix-map when building assembly > files via gcc, it's more ergonomic to also support -ffile-prefix-map; > especially since for .S files that could contain the __FILE__ macro, > one would then also have to specify -fmacro-prefix-map. > > gcc: > PR driver/93371 > * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. OK. Sorry for the long delay. jeff
On 01/11/2022 21.11, Jeff Law wrote: > > On 8/29/22 03:29, Rasmus Villemoes wrote: >> -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map >> and -fdebug-prefix-map. However, when building .S or .s files, gas is >> not called with the appropriate --debug-prefix-map option when >> -ffile-prefix-map is used. >> >> While the user can specify -fdebug-prefix-map when building assembly >> files via gcc, it's more ergonomic to also support -ffile-prefix-map; >> especially since for .S files that could contain the __FILE__ macro, >> one would then also have to specify -fmacro-prefix-map. >> >> gcc: >> PR driver/93371 >> * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. > > OK. Sorry for the long delay. Thanks, and no problem. However, when I try to push the new master branch I get $ git push origin master fatal: remote error: service not enabled: /git/gcc.git I do gcc patches sufficiently rare that I may have forgotten the right procedure, but this is what I think I've done previously (along with running a "git gcc-verify HEAD" to ensure there's a proper changelog fragment to extract, with gcc-verify being a suitable alias). Have I simply lost by commit bit? Rasmus
On 11/2/22 06:35, Rasmus Villemoes wrote: > On 01/11/2022 21.11, Jeff Law wrote: >> On 8/29/22 03:29, Rasmus Villemoes wrote: >>> -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map >>> and -fdebug-prefix-map. However, when building .S or .s files, gas is >>> not called with the appropriate --debug-prefix-map option when >>> -ffile-prefix-map is used. >>> >>> While the user can specify -fdebug-prefix-map when building assembly >>> files via gcc, it's more ergonomic to also support -ffile-prefix-map; >>> especially since for .S files that could contain the __FILE__ macro, >>> one would then also have to specify -fmacro-prefix-map. >>> >>> gcc: >>> PR driver/93371 >>> * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. >> OK. Sorry for the long delay. > Thanks, and no problem. > > However, when I try to push the new master branch I get > > $ git push origin master > fatal: remote error: service not enabled: /git/gcc.git > > I do gcc patches sufficiently rare that I may have forgotten the right > procedure, but this is what I think I've done previously (along with > running a "git gcc-verify HEAD" to ensure there's a proper changelog > fragment to extract, with gcc-verify being a suitable alias). > > Have I simply lost by commit bit? No idea what that error means. If I had to guess, it'd be that you've got an anonymous checkout tree which is obviously unsuitable for pushing or something of that nature. It's probably just faster/easier for me to push it for you. I'll take care of it momentarily. Jeff
On 02/11/2022 16.45, Jeff Law wrote: > > On 11/2/22 06:35, Rasmus Villemoes wrote: >> However, when I try to push the new master branch I get >> >> $ git push origin master >> fatal: remote error: service not enabled: /git/gcc.git >> >> I do gcc patches sufficiently rare that I may have forgotten the right >> procedure, but this is what I think I've done previously (along with >> running a "git gcc-verify HEAD" to ensure there's a proper changelog >> fragment to extract, with gcc-verify being a suitable alias). >> >> Have I simply lost by commit bit? > > No idea what that error means. If I had to guess, it'd be that you've > got an anonymous checkout tree which is obviously unsuitable for pushing > or something of that nature. > > It's probably just faster/easier for me to push it for you. I'll take > care of it momentarily. Thanks. I think I found out what was wrong (though I know it has worked for me previously): My remote url was git://gcc.gnu.org/git/gcc.git , and I used to rely on my .ssh/config specifying "villemoes" as username when accessing gcc.gnu.org. For some reason that no longer worked, but updating the remote url to git+ssh://villemoes@gcc.gnu.org/git/gcc.git seemed to do the trick. What do you think about applying this to older branches? IMO it's a defect from when the umbrella -ffile-prefix-map was introduced, and the potential for regressions should be very low, but I can also see how it might not really qualify as a bug fix. Rasmus
On 11/3/22 07:29, Rasmus Villemoes wrote: > On 02/11/2022 16.45, Jeff Law wrote: >> On 11/2/22 06:35, Rasmus Villemoes wrote: >>> However, when I try to push the new master branch I get >>> >>> $ git push origin master >>> fatal: remote error: service not enabled: /git/gcc.git >>> >>> I do gcc patches sufficiently rare that I may have forgotten the right >>> procedure, but this is what I think I've done previously (along with >>> running a "git gcc-verify HEAD" to ensure there's a proper changelog >>> fragment to extract, with gcc-verify being a suitable alias). >>> >>> Have I simply lost by commit bit? >> No idea what that error means. If I had to guess, it'd be that you've >> got an anonymous checkout tree which is obviously unsuitable for pushing >> or something of that nature. >> >> It's probably just faster/easier for me to push it for you. I'll take >> care of it momentarily. > Thanks. > > I think I found out what was wrong (though I know it has worked for me > previously): My remote url was git://gcc.gnu.org/git/gcc.git , and I > used to rely on my .ssh/config specifying "villemoes" as username when > accessing gcc.gnu.org. For some reason that no longer worked, but > updating the remote url to git+ssh://villemoes@gcc.gnu.org/git/gcc.git > seemed to do the trick. Good to know you got it sorted out. > > What do you think about applying this to older branches? IMO it's a > defect from when the umbrella -ffile-prefix-map was introduced, and the > potential for regressions should be very low, but I can also see how it > might not really qualify as a bug fix. I'd probably lean against backporting. Generally we try to limit backporting to regression fixes, incorrect code generation issues and the like. This seems much less serious. Jeff
diff --git a/gcc/gcc.cc b/gcc/gcc.cc index b6d562a92f0..44eafc60187 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -878,7 +878,7 @@ proper position among the other output files. */ #endif #ifdef HAVE_AS_DEBUG_PREFIX_MAP -#define ASM_MAP " %{fdebug-prefix-map=*:--debug-prefix-map %*}" +#define ASM_MAP " %{ffile-prefix-map=*:--debug-prefix-map %*} %{fdebug-prefix-map=*:--debug-prefix-map %*}" #else #define ASM_MAP "" #endif