Skip to content

Commit 76fa974

Browse files
committed
8255850: Hotspot recompiled on first incremental build
Reviewed-by: ihse
1 parent 622f72b commit 76fa974

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

make/common/JdkNativeCompilation.gmk

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ ifeq ($(STATIC_LIBS), true)
7777
FindStaticLib =
7878
endif
7979

80+
# Returns the module specific java header dir if it exists.
81+
# Param 1 - module name
8082
GetJavaHeaderDir = \
81-
$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
83+
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
8284

8385
# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
8486
ProcessDir = \
@@ -123,15 +125,27 @@ JDK_RCFLAGS=$(RCFLAGS) \
123125
SetupJdkLibrary = $(NamedParamsMacroTemplate)
124126
define SetupJdkLibraryBody
125127
ifeq ($$($1_OUTPUT_DIR), )
126-
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
128+
ifneq ($$(MODULE), )
129+
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
130+
else
131+
$$(error Must specify OUTPUT_DIR in a MODULE free context)
132+
endif
127133
endif
128134

129135
ifeq ($$($1_OBJECT_DIR), )
130-
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
136+
ifneq ($$(MODULE), )
137+
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
138+
else
139+
$$(error Must specify OBJECT_DIR in a MODULE free context)
140+
endif
131141
endif
132142

133143
ifeq ($$($1_SRC), )
134-
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
144+
ifneq ($$(MODULE), )
145+
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
146+
else
147+
$$(error Must specify SRC in a MODULE free context)
148+
endif
135149
else
136150
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
137151
endif
@@ -165,7 +179,8 @@ define SetupJdkLibraryBody
165179
ifneq ($$($1_HEADERS_FROM_SRC), false)
166180
$1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC)))
167181
endif
168-
# Always add the java header dir
182+
183+
# Add the module specific java header dir
169184
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
170185

171186
ifneq ($$($1_EXTRA_HEADER_DIRS), )
@@ -203,11 +218,19 @@ define SetupJdkExecutableBody
203218
$1_TYPE := EXECUTABLE
204219

205220
ifeq ($$($1_OUTPUT_DIR), )
206-
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
221+
ifneq ($$(MODULE), )
222+
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
223+
else
224+
$$(error Must specify OUTPUT_DIR in a MODULE free context)
225+
endif
207226
endif
208227

209228
ifeq ($$($1_OBJECT_DIR), )
210-
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
229+
ifneq ($$(MODULE), )
230+
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
231+
else
232+
$$(error Must specify OBJECT_DIR in a MODULE free context)
233+
endif
211234
endif
212235

213236
ifeq ($$($1_VERSIONINFO_RESOURCE), )

0 commit comments

Comments
 (0)