Skip to content

Commit 18ea311

Browse files
SendaoYanPaul Hohensee
SendaoYan
authored and
Paul Hohensee
committed
8313374: --enable-ccache's CCACHE_BASEDIR breaks builds
Backport-of: c37acdb0880f9ac013ba88c436ce980647e6d0a9
1 parent 955bae2 commit 18ea311

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

make/common/NativeCompilation.gmk

+14
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,21 @@ DEPENDENCY_TARGET_SED_PATTERN := \
215215
# The fix-deps-file macro is used to adjust the contents of the generated make
216216
# dependency files to contain paths compatible with make.
217217
#
218+
REWRITE_PATHS_RELATIVE = false
218219
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
220+
REWRITE_PATHS_RELATIVE = true
221+
endif
222+
223+
# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
224+
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
225+
# its compiler. The compiler then produces relative dependency files.
226+
# make does not know a relative and absolute filename is the same so it will
227+
# ignore such dependencies.
228+
ifneq ($(CCACHE), )
229+
REWRITE_PATHS_RELATIVE = true
230+
endif
231+
232+
ifeq ($(REWRITE_PATHS_RELATIVE), true)
219233
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
220234
MakeCommandRelative = \
221235
$(CD) $(WORKSPACE_ROOT) && \

0 commit comments

Comments
 (0)