Skip to content
Snippets Groups Projects
Unverified Commit 91d25c85 authored by Vagrant Cascadian's avatar Vagrant Cascadian Committed by Johannes Schauer Marin Rodrigues
Browse files

Makefile: Use relative paths for debugging symbols.

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/



Series-to: u-boot

Signed-off-by: default avatarVagrant Cascadian <vagrant@reproducible-builds.org>
parent a9ef1d1e
Branches repro
Tags
No related merge requests found
Pipeline #1007 passed
...@@ -607,14 +607,18 @@ endif ...@@ -607,14 +607,18 @@ endif
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks) KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
# change __FILE__ to the relative path from the srctree # change __FILE__ and debugging symbols to the relative path from the
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) # srctree
KBUILD_CFLAGS += $(call cc-option,-ffile-prefix-map=$(srctree)/=)
KBUILD_CFLAGS += -g KBUILD_CFLAGS += -g
# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format> # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
# option to the assembler. # option to the assembler.
KBUILD_AFLAGS += -g KBUILD_AFLAGS += -g
# Use relative paths in debugging symbols
KBUILD_AFLAGS += --debug-prefix-map=$(srctree)/=
# Report stack usage if supported # Report stack usage if supported
# ARC tools based on GCC 7.1 has an issue with stack usage # ARC tools based on GCC 7.1 has an issue with stack usage
# with naked functions, see commit message for more details # with naked functions, see commit message for more details
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment