Skip to content

Commit

Permalink
8313374: --enable-ccache's CCACHE_BASEDIR breaks builds
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
Jan Kratochvil authored and Yuri Nesterenko committed Aug 23, 2023
1 parent d1de3d0 commit 571c435
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions make/common/NativeCompilation.gmk
Expand Up @@ -215,7 +215,21 @@ DEPENDENCY_TARGET_SED_PATTERN := \
# The fix-deps-file macro is used to adjust the contents of the generated make
# dependency files to contain paths compatible with make.
#
REWRITE_PATHS_RELATIVE = false
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
REWRITE_PATHS_RELATIVE = true
endif

# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
endif

ifeq ($(REWRITE_PATHS_RELATIVE), true)
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
MakeCommandRelative = \
$(CD) $(WORKSPACE_ROOT) && \
Expand Down

1 comment on commit 571c435

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.