diff options
author | Vagrant Cascadian <vagrant@reproducible-builds.org> | 2022-08-18 10:31:34 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-26 15:00:33 -0400 |
commit | 87ff53379fc0fbb689b97dbd51a65569061d86a7 (patch) | |
tree | 5e90d2ac2ccc3c844670d1ef8701d231939ff086 | |
parent | fc62aa7fb3b075ed4cea14c37f866c84a192be0f (diff) | |
download | u-boot-WIP/2022-08-26-assorted-fixes.zip u-boot-WIP/2022-08-26-assorted-fixes.tar.gz u-boot-WIP/2022-08-26-assorted-fixes.tar.bz2 |
Makefile: Use relative paths for debugging symbols.WIP/2022-08-26-assorted-fixes
The KBUILD_CFLAGS and KBUILD_AFLAGS variables are adjusted to use
-ffile-prefix-map and --debug-prefix-map, respectively, to use
relative paths for occurrences of __FILE__ and debug paths.
This enables reproducible builds regardless of the absolute path to
the build directory:
https://reproducible-builds.org/docs/build-path/
Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Acked-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
-rw-r--r-- | Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -751,14 +751,18 @@ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) # Enabled with W=2, disabled by default as noisy KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) -# change __FILE__ to the relative path from the srctree -KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +# change __FILE__ and debugging symbols to the relative path from the +# srctree +KBUILD_CFLAGS += $(call cc-option,-ffile-prefix-map=$(srctree)/=) KBUILD_CFLAGS += -g # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format> # option to the assembler. KBUILD_AFLAGS += -g +# Use relative paths in debugging symbols +KBUILD_AFLAGS += --debug-prefix-map=$(srctree)/= + # Report stack usage if supported # ARC tools based on GCC 7.1 has an issue with stack usage # with naked functions, see commit message for more details |