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)
This commit is contained in:
parent
e02dc5110b
commit
3dcac23aff
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue