diff --git a/config/Config-build.in b/config/Config-build.in index 8c6271124a..f81e4e2ea9 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -85,6 +85,15 @@ menu "Global build settings" help If enabled, config.seed will be stored in /etc/build.config of firmware. + config REPRODUCIBLE_DEBUG_INFO + bool "Make debug information reproducible" + default BUILDBOT + help + This strips the local build path out of debug information. This has the + advantage of making it reproducible, but the disadvantage of making local + debugging using ./scripts/remote-gdb harder, since the debug data will + no longer point to the full path on the build host. + config COLLECT_KERNEL_DEBUG bool prompt "Collect kernel debug information" diff --git a/rules.mk b/rules.mk index ef187a0348..9dcb74947a 100644 --- a/rules.mk +++ b/rules.mk @@ -144,7 +144,7 @@ ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),) ifeq ($(CONFIG_GCC_USE_IREMAP),y) iremap = -iremap$(1):$(2) else - iremap = -ffile-prefix-map=$(1)=$(2) + iremap = -f$(if $(CONFIG_REPRODUCIBLE_DEBUG_INFO),file,macro)-prefix-map=$(1)=$(2) endif endif