Skip to content

Commit 7abac98

Browse files
committed
configure: Support -f{debug,macro}-prefix-map
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.
1 parent 7e37329 commit 7abac98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

configure.ac

+4
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,10 @@ if test "x$use_ccache" != "xno"; then
14961496
CXX="$ac_cv_path_CCACHE $CXX"
14971497
fi
14981498
AC_MSG_RESULT($use_ccache)
1499+
if test "x$use_ccache" = "xyes"; then
1500+
AX_CHECK_COMPILE_FLAG([-fdebug-prefix-map=A=B],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -fdebug-prefix-map=\$(abs_srcdir)=."],,[[$CXXFLAG_WERROR]])
1501+
AX_CHECK_PREPROC_FLAG([-fmacro-prefix-map=A=B],[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -fmacro-prefix-map=\$(abs_srcdir)=."],,[[$CXXFLAG_WERROR]])
1502+
fi
14991503
fi
15001504

15011505
dnl enable wallet

0 commit comments

Comments
 (0)