From 2b089ed086d5c51f8c013b4721b4712e9c519fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 23 Oct 2022 07:32:23 +0700 Subject: [PATCH 1/2] environment: set -ffile-prefix-map We're setting -fdebug-prefix-map to strip directory prefixes from debug info, which will help ccache and reproducibility. However, -fdebug-prefix-map doesn't help with those macros like __FILE__ and __BASE_FILE__, which needs another flags: -fmacro-prefix-map. Replaces -fdebug-prefix-map with -ffile-prefix-map which is an alias for both `-fdebug-prefix-map` and `-fmacro-prefix-map`. (This flag is available since GCC 8 and Clang 10) --- .../environment/configure/debug-debug-prefix-map.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/environment/configure/debug-debug-prefix-map.sh b/common/environment/configure/debug-debug-prefix-map.sh index 40b3a7b46bcc1b..d7eb0402f18bfe 100644 --- a/common/environment/configure/debug-debug-prefix-map.sh +++ b/common/environment/configure/debug-debug-prefix-map.sh @@ -1,16 +1,16 @@ local _wrksrc="$wrksrc${build_wrksrc:+/$build_wrksrc}" case "$build_style" in cmake) - CFLAGS="${CFLAGS} -fdebug-prefix-map=$_wrksrc/${cmake_builddir:-build}=." - CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$_wrksrc/${cmake_builddir:-build}=." + CFLAGS="${CFLAGS} -ffile-prefix-map=$_wrksrc/${cmake_builddir:-build}=." + CXXFLAGS="${CXXFLAGS} -ffile-prefix-map=$_wrksrc/${cmake_builddir:-build}=." ;; meson) - CFLAGS="${CFLAGS} -fdebug-prefix-map=$_wrksrc/${meson_builddir:-build}=." - CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$_wrksrc/${meson_builddir:-build}=." + CFLAGS="${CFLAGS} -ffile-prefix-map=$_wrksrc/${meson_builddir:-build}=." + CXXFLAGS="${CXXFLAGS} -ffile-prefix-map=$_wrksrc/${meson_builddir:-build}=." ;; *) - CFLAGS="${CFLAGS} -fdebug-prefix-map=$_wrksrc=." - CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$_wrksrc=." + CFLAGS="${CFLAGS} -ffile-prefix-map=$_wrksrc=." + CXXFLAGS="${CXXFLAGS} -ffile-prefix-map=$_wrksrc=." esac unset _wrksrc From 3493cf6ecfa13a6f3f82d6fa8460ae1d6a058a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 7 Nov 2022 16:26:46 +0700 Subject: [PATCH 2/2] python3: strip -ffile-prefix-map too --- srcpkgs/python3/template | 1 + 1 file changed, 1 insertion(+) diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template index 335e2cc02d1a56..2eddb5bc62bbb0 100644 --- a/srcpkgs/python3/template +++ b/srcpkgs/python3/template @@ -121,6 +121,7 @@ do_install() { ${DESTDIR}/usr/bin/python${version%.*}-config fi sed -i -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \ + -e "s,-ffile-prefix-map=[^[:space:]]*=[.],," \ -e "s,-I./External,," \ ${DESTDIR}/usr/bin/python${version%.*}-config \ ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \