From 9d39007a490be1801fd448abaeebb04a1164fefe 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] 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 40b3a7b46bcc..d7eb0402f18b 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