From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id AE8C73858412 for ; Tue, 27 Sep 2022 06:54:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE8C73858412 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-lj1-x233.google.com with SMTP id j24so9884080lja.4 for ; Mon, 26 Sep 2022 23:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=OmWNzFUys/zWeX9s2j2P2o0ltiTiaiwim1lkuJewxoM=; b=ReSjeg59s4XGDjIwALkNLRQTwKy1GtySvYOI9EoWMEFReZlSmftMa5Yq8w8QUAx9Bb oYhatbS/d3hm4GIABNncz90k34FZ1xJHUv1SN2LvQBLcTOhhOwr0oK+zdI29/uAtxRtd cnlCKgA3O8aaSEf0c/3HHi0A5F640FEKugjRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=OmWNzFUys/zWeX9s2j2P2o0ltiTiaiwim1lkuJewxoM=; b=u/JfX4NL0xXyb74V7GVuJbrd1ppojUGnLWjslnpy1wtySSupdzBFr6wZ2ZkPrxkj1I 0EzJw5a3t3pmom99EFg0ayfzcDhunfjF1mvLoK5hxHAxs7C/5Z1a1hDmH+rtA1hrHyoQ lAcc/SKjZpWOOtDqodZ6KAxuxKi6QvJMpifXyW0y4tVAKe1VEJ8Z0oOB3Mdog6y+5Eog EQfhIfEFlCRgaR34dSj4Hfp5K9hoKSfnJhVetbYfWT0U7Xn4I1wyiVEVrv9tseIJqM/U 3eZkNMpARim5CEODM2TTjee5IJHWdktW0O6ep28pycS3AR/cZC4cdWH3riY4uuDFUpZu XUDg== X-Gm-Message-State: ACrzQf1RZCjCcG1oVnWg0Eq84vM+QpjV5CuacZWhikQdarB1sVEi3xau Xv5WzG8e2Ctfv7AwuVVEG60a8Mis53DjxEXx X-Google-Smtp-Source: AMsMyM7o73JMZ/fWaFsEvfFW80Myc51kp1Cim2ZdzwVA8BY/8KROqWtye1W8oWCX1ezFaorTD9tPhA== X-Received: by 2002:a05:651c:199f:b0:26c:4a66:aa4e with SMTP id bx31-20020a05651c199f00b0026c4a66aa4emr9636756ljb.321.1664261690602; Mon, 26 Sep 2022 23:54:50 -0700 (PDT) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id w7-20020a05651204c700b004972b0bb426sm67395lfq.257.2022.09.26.23.54.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 23:54:50 -0700 (PDT) Message-ID: <49ad2c54-f179-3ef2-a0ce-85ec842da416@rasmusvillemoes.dk> Date: Tue, 27 Sep 2022 08:54:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] gcc: honour -ffile-prefix-map in ASM_MAP [PR93371] Content-Language: en-US From: Rasmus Villemoes To: gcc-patches@gcc.gnu.org Cc: Vagrant Cascadian , Jonathan Wakely , Jakub Jelinek , Joseph Myers , Jeff Law References: <20220829092917.477788-1-rv@rasmusvillemoes.dk> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 >