[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d250e864d6d81cc02e2599f710872f72d58a3c29.camel@decadent.org.uk>
Date: Sun, 16 Mar 2025 20:08:37 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Thomas Weißschuh <linux@...ssschuh.net>, Masahiro
Yamada <masahiroy@...nel.org>, Nathan Chancellor <nathan@...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>
Cc: 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 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.
Also, in some older versions of gcc the -ffile-prefix-map option didn't
affect assembly sources - gas only understands --debug-prefix-map and
gcc did not do the necessary conversion. But this works properly since
at least gcc 12, so I wouldn't worry too much about it.
Ben.
--
Ben Hutchings
Lowery's Law:
If it jams, force it. If it breaks, it needed replacing anyway.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists