[PATCH 1/4] kbuild: make all file references relative to source root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-fmacro-prefix-map only affects __FILE__ and __BASE_FILE__.
Other references, for example in debug information, is not affected.
This makes handling of file references in the compiler output harder to
use and creates problems for reproducible builds.

Switch to -ffile-prefix map which affects all references.

Suggested-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/lkml/c49cc967294f9a3a4a34f69b6a8727a6d3959ed8.camel@xxxxxxxxxxxxxxx/
Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 30242e731a0d19faa0ffbeada8313e77c4105b41..7b1683bb60e2f473b255fb8a0bde97b15d19ddb6 100644
--- a/Makefile
+++ b/Makefile
@@ -1067,7 +1067,7 @@ endif
 
 # change __FILE__ to the relative path to the source directory
 ifdef building_out_of_srctree
-KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot)/=)
+KBUILD_CPPFLAGS += $(call cc-option,-ffile-prefix-map=$(srcroot)/=)
 KBUILD_RUSTFLAGS += --remap-path-prefix=$(srcroot)/=
 endif
 

-- 
2.48.1





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux