From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id DEC01385AC3B for ; Mon, 12 Sep 2022 09:46:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DEC01385AC3B 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-x235.google.com with SMTP id z20so9867022ljq.3 for ; Mon, 12 Sep 2022 02:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=vz7pFDKOH0cArKJqxXPF9Q2iPLxJnP4wSZkmrC8D4M4=; b=P1uZCpeOs2dA97XuTwRplnOmbHJH51LbxAHju9isjHtD8rc1w3qkOKbUnvBK2jb0OX OFm7Ei0RLribXc708hqKZ04ZsYGTRblXox9FSdmOzFF2ViLzEiDKU7j6aatn+ObyYZYO eiR6NP5puzrKMyPSv3nPPMQIQOvWWDg9Qr3kU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=vz7pFDKOH0cArKJqxXPF9Q2iPLxJnP4wSZkmrC8D4M4=; b=2CzifAouj83+lmfSq0FRmvWPuOIthp6QnL+xY8CzBw2nlmJboRjooTa+8JkhJYmprK yIk4TDAGDX6F/8LTiOdD8UM8JsM3+ZLGLkjhaaXizUG1sDMvDIHOAj2erJt3e9dpgU3S aVZrSOa1c+amQUdsxcxXrMp/3yF2QTBpha250BTUfdDTzWooBfsj3p9Aq0PROfDIlKPi 7De6iYOG2u5coZuCQW02ZfShofnLQe147pXgyrqd6HlwmsqcocKBdDZ6YQJMfX7wDAzB 33JF8YUhiWGhM3KhOqJacMRqGOp5rPWyC0tNsLUOgKHHSZx3EhCUjtKgVB2m5tglcH15 28QQ== X-Gm-Message-State: ACgBeo3cOc/J+CVkEQNoScsDw4G7ErTvB7TTtlRM4GL4rV6xj7lALk/k 14Hfyi9CMDQaL8V/hXWzHdlBcW1itA/tGVLi X-Google-Smtp-Source: AA6agR4LZ4+5m/aDNBXbM3P5ihyx3K+JU36dGbA+GAqyDGC/ylmtXkAAUtDqhMRFy3GNZhWkaK/glg== X-Received: by 2002:a05:651c:160b:b0:261:d3c7:4d92 with SMTP id f11-20020a05651c160b00b00261d3c74d92mr7071014ljq.23.1662975968788; Mon, 12 Sep 2022 02:46:08 -0700 (PDT) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id a23-20020ac25e77000000b00492ea54beeasm964110lfr.306.2022.09.12.02.46.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Sep 2022 02:46:08 -0700 (PDT) Message-ID: Date: Mon, 12 Sep 2022 11:46:07 +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 To: gcc-patches@gcc.gnu.org Cc: Vagrant Cascadian References: <20220829092917.477788-1-rv@rasmusvillemoes.dk> From: Rasmus Villemoes In-Reply-To: <20220829092917.477788-1-rv@rasmusvillemoes.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 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,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 List-Id: 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