[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250317171738.GA950672@ax162>
Date: Mon, 17 Mar 2025 10:17:38 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Ben Hutchings <ben@...adent.org.uk>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
Masahiro Yamada <masahiroy@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>,
Jonathan Corbet <corbet@....net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH v2] kbuild: make all file references relative to source
root
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
Powered by blists - more mailing lists