From 7ec9b3abd9dc8d24bc75f2b5b365ad78e2b09b8d Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Wed, 15 Apr 2020 17:00:32 -0500 Subject: [PATCH] toolchain/toolchain-wrapper: reproducible builds: omit absolute paths from debug symbols In GCC6 the compiler was made smarter to omit the flag -fdebug-prefix-map from the DWARF DW_AT_producer section[1]. That flag contains the absolute path '$(BASE_DIR)' which breaks reproducibility. Prior to GCC6 however, the only way to omit the flag is to use -gno-record-gcc-switches which omits all flags. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=266cc0c181549c2fb6b50f8f26213cdc89101026 Signed-off-by: Brandon Maier [Arnout: invert condition to ifeq (,) instead of ifneq (,y)] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- toolchain/toolchain-wrapper.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index bc8d77b892..cbf46f15fa 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -32,6 +32,9 @@ endif ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_7),) TOOLCHAIN_WRAPPER_OPTS += -DBR_NEED_SOURCE_DATE_EPOCH endif +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_6),) +TOOLCHAIN_WRAPPER_OPTS += -gno-record-gcc-switches +endif endif # Disable -ftree-loop-distribute-patterns on microblaze to