8217613: [AOT] TEST_OPTS_AOT_MODULES doesn't work on mac
Reviewed-by: tbell, kvn, iignatyev
--- a/make/RunTests.gmk Thu Jan 24 01:01:11 2019 +0100
+++ b/make/RunTests.gmk Wed Jan 23 14:10:31 2019 -0800
@@ -129,19 +129,13 @@
$1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE))
$1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt)
- ifeq ($(OPENJDK_TARGET_OS), windows)
- $1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD)))
- else
- $1_LD := $$(LD)
- endif
-
# Create jaotc flags.
# VM flags which don't affect AOT code generation are filtered out: -Xcomp, -XX:+-TieredCompilation
$1_JAOTC_OPTS := \
-J-Xmx4g --info \
$$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \
$$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
- --linker-path $$($1_LD) \
+ --linker-path $$(LD_JAOTC) \
#
ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), )
@@ -155,12 +149,14 @@
$$(call MakeTargetDir)
$$(call ExecuteWithLog, $$@, \
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \
- $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
+ $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
)
$$(call ExecuteWithLog, $$@.check, \
- $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \
- $$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \
- > $$@.verify-aot \
+ $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \
+ $$($1_VM_OPTIONS) -XX:+UnlockDiagnosticVMOptions \
+ -XX:+PrintAOT -XX:+UseAOTStrictLoading \
+ -XX:AOTLibrary=$$@ -version \
+ > $$@.verify-aot \
)
$1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB)
--- a/make/RunTestsPrebuilt.gmk Thu Jan 24 01:01:11 2019 +0100
+++ b/make/RunTestsPrebuilt.gmk Wed Jan 23 14:10:31 2019 -0800
@@ -254,26 +254,22 @@
# Setup LD for AOT support
ifneq ($(DEVKIT_HOME), )
ifeq ($(OPENJDK_TARGET_OS), windows)
- LD := $(DEVKIT_HOME)/VC/bin/x64/link
+ LD_JAOTC := $(DEVKIT_HOME)/VC/bin/x64/link.exe
LIBRARY_PREFIX :=
SHARED_LIBRARY_SUFFIX := .dll
- EXE_SUFFIX := .exe
else ifeq ($(OPENJDK_TARGET_OS), linux)
- LD := $(DEVKIT_HOME)/bin/ld
+ LD_JAOTC := $(DEVKIT_HOME)/bin/ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so
- EXE_SUFFIX :=
else ifeq ($(OPENJDK_TARGET_OS), macosx)
- LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
+ LD_JAOTC := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .dylib
- EXE_SUFFIX :=
else ifeq ($(OPENJDK_TARGET_OS), solaris)
# Prefer system linker for AOT on Solaris.
- LD := ld
+ LD_JAOTC := ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so
- EXE_SUFFIX :=
endif
else
LD := ld
@@ -315,10 +311,9 @@
OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
NUM_CORES := $(NUM_CORES), \
MEMORY_SIZE := $(MEMORY_SIZE), \
- LD := $(LD), \
+ LD_JAOTC := $(LD_JAOTC), \
LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
- EXE_SUFFIX := $(EXE_SUFFIX), \
include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
$(CUSTOM_NEW_SPEC_LINE), \
)
--- a/make/autoconf/spec.gmk.in Thu Jan 24 01:01:11 2019 +0100
+++ b/make/autoconf/spec.gmk.in Wed Jan 23 14:10:31 2019 -0800
@@ -487,6 +487,9 @@
# The linker can be gcc or ld on unix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@
+# Linker used by the jaotc tool for AOT compilation.
+LD_JAOTC:=@LD_JAOTC@
+
# Xcode SDK path
SDKROOT:=@SDKROOT@
--- a/make/autoconf/toolchain.m4 Thu Jan 24 01:01:11 2019 +0100
+++ b/make/autoconf/toolchain.m4 Wed Jan 23 14:10:31 2019 -0800
@@ -715,12 +715,18 @@
AC_MSG_RESULT([yes])
fi
LDCXX="$LD"
+ # jaotc being a windows program expects the linker to be supplied with exe suffix.
+ LD_JAOTC="$LD$EXE_SUFFIX"
else
# All other toolchains use the compiler to link.
LD="$CC"
LDCXX="$CXX"
+ # jaotc expects 'ld' as the linker rather than the compiler.
+ BASIC_CHECK_TOOLS([LD_JAOTC], ld)
+ BASIC_FIXUP_EXECUTABLE(LD_JAOTC)
fi
AC_SUBST(LD)
+ AC_SUBST(LD_JAOTC)
# FIXME: it should be CXXLD, according to standard (cf CXXCPP)
AC_SUBST(LDCXX)