diff options
author | fanquake <fanquake@gmail.com> | 2021-04-21 13:26:12 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-04-21 13:26:49 +0800 |
commit | e507acb1184fc3e378bf33e38dce97ca3008f19c (patch) | |
tree | 69b9bad388dd221a927d6152bdf1979b1bf7de55 | |
parent | 2bce9329e8b90a5f9e84ad03d0fe5a1857684d3e (diff) | |
parent | 7abac98d3e3c1bc8ad66cb5c05184b9c5cc674d5 (diff) |
Merge #20353: configure: Support -fdebug-prefix-map and -fmacro-prefix-map
7abac98d3e3c1bc8ad66cb5c05184b9c5cc674d5 configure: Support -f{debug,macro}-prefix-map (Anthony Towns)
Pull request description:
When bitcoin is checked out in two directories (eg via git worktree) object files between the two will differ due to the full path being included in the debug section. `-fdebug-prefix-map` is used to replace this with "." to avoid this unnecessary difference and allow ccache to share objects between worktrees (provided the source and compile options are the same).
Also provide `-fmacro-prefix-map` if supported so that the working dir is not encoded in `__FILE__` macros.
ACKs for top commit:
practicalswift:
cr ACK 7abac98d3e3c1bc8ad66cb5c05184b9c5cc674d5: patch looks correct
fanquake:
ACK 7abac98d3e3c1bc8ad66cb5c05184b9c5cc674d5
Tree-SHA512: b6a37c1728ec3b2e552f244da0e66db113c1e7662c7ac502e12ff466f3dbfbfefae12695ca135137c50dbb1c4c5d84059116c0cd09b391a17466dc77b8726679
-rw-r--r-- | configure.ac | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index cce97e9259..d1707dfd64 100644 --- a/configure.ac +++ b/configure.ac @@ -1640,6 +1640,10 @@ if test "x$use_ccache" != "xno"; then CXX="$ac_cv_path_CCACHE $CXX" fi AC_MSG_RESULT($use_ccache) + if test "x$use_ccache" = "xyes"; then + AX_CHECK_COMPILE_FLAG([-fdebug-prefix-map=A=B],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -fdebug-prefix-map=\$(abs_srcdir)=."],,[[$CXXFLAG_WERROR]]) + AX_CHECK_PREPROC_FLAG([-fmacro-prefix-map=A=B],[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -fmacro-prefix-map=\$(abs_srcdir)=."],,[[$CXXFLAG_WERROR]]) + fi fi dnl enable wallet |