[Buildroot] [git commit] package/gcc: map debug prefix when reproducible

Yann E. MORIN yann.morin.1998 at free.fr
Tue Feb 7 22:23:19 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=f9a92ea1cb1dd2aa9b3f9c83c04d7d01c1f6e148
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

When building with BR2_REPRODUCIBLE the toolchain wrapper passes
-fdebug-prefix-map for all packages that are built.  But this doesn't
affect the target libraries (like libgcc) built by GCC's build system.

GCC 4.3 added a configure option to set the debug prefix map for these
libraries, which is used here to avoid encoding potentially
non-reproducible build paths into the debug data.

Signed-off-by: John Keeping <john at metanate.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
 package/gcc/gcc.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index ec6f3b550a..6dfd93f2a4 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -84,6 +84,10 @@ HOST_GCC_COMMON_CONF_OPTS = \
 	--with-bugurl="http://bugs.buildroot.net/" \
 	--without-zstd
 
+ifeq ($(BR2_REPRODUCIBLE),y)
+HOST_GCC_COMMON_CONF_OPTS += --with-debug-prefix-map=$(BASE_DIR)=buildroot
+endif
+
 # Don't build documentation. It takes up extra space / build time,
 # and sometimes needs specific makeinfo versions to work
 HOST_GCC_COMMON_CONF_ENV = \



More information about the buildroot mailing list