linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: make all file references relative to source root
Date: Mon, 17 Mar 2025 10:17:38 -0700	[thread overview]
Message-ID: <20250317171738.GA950672@ax162> (raw)
In-Reply-To: <d250e864d6d81cc02e2599f710872f72d58a3c29.camel@decadent.org.uk>

On Sun, Mar 16, 2025 at 08:08:37PM +0100, Ben Hutchings wrote:
> On Sat, 2025-03-15 at 14:20 +0100, Thomas Weißschuh wrote:
> > -fmacro-prefix-map only affects __FILE__ and __BASE_FILE__.
> > Other references, for example in debug information, are not affected.
> > This makes handling of file references in the compiler outputs harder to
> > use and creates problems for reproducible builds.
> > 
> > Switch to -ffile-prefix map which affects all references.
> 
> This appears to cover all the C sources, but not quite all the assembly
> sources:
> 
> [...]
> 
> > --- a/arch/x86/boot/Makefile
> > +++ b/arch/x86/boot/Makefile
> > @@ -54,7 +54,7 @@ targets += cpustr.h
> >  
> >  KBUILD_CFLAGS	:= $(REALMODE_CFLAGS) -D_SETUP
> >  KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
> > -KBUILD_CFLAGS	+= $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
> > +KBUILD_CFLAGS	+= $(call cc-option,-ffile-prefix-map=$(srctree)/=)
> [...]
> 
> I think this addition to KBUILD_CFLAGS needs to be done before the
> assignment to KBUILD_AFLAGS.

This probably belongs in KBUILD_CPPFLAGS then, similar to clang's
'--target' flag and other options that we always want invoked?

Cheers,
Nathan

  reply	other threads:[~2025-03-17 17:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15 13:20 [PATCH v2] kbuild: make all file references relative to source root Thomas Weißschuh
2025-03-16  2:06 ` Masahiro Yamada
2025-03-16 19:08 ` Ben Hutchings
2025-03-17 17:17   ` Nathan Chancellor [this message]
2025-04-29 16:12 ` Matthieu Baerts
2025-05-01 16:48   ` Thomas Weißschuh
2025-05-02 11:33   ` Peter Oberparleiter
2025-04-29 19:51 ` Ville Syrjälä
2025-05-05  7:30   ` Thomas Weißschuh
2025-05-11  3:37     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317171738.GA950672@ax162 \
    --to=nathan@kernel.org \
    --cc=ben@decadent.org.uk \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=masahiroy@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nicolas@fjasle.eu \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).