提交 657aa7f5 编写于 作者: P phh

Merge

...@@ -208,7 +208,7 @@ TARGETS_ZERO = $(addsuffix zero,$(TARGETS)) ...@@ -208,7 +208,7 @@ TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS) BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
......
...@@ -162,20 +162,6 @@ ifndef HOTSPOT_VM_DISTRO ...@@ -162,20 +162,6 @@ ifndef HOTSPOT_VM_DISTRO
endif endif
endif endif
ifeq ($(OS_VENDOR), Darwin)
# MACOSX FIXME: we should be able to run test_gamma (see MACOSX_PORT-214)
ifeq ($(ALWAYS_PASS_TEST_GAMMA),)
# ALWAYS_PASS_TEST_GAMMA wasn't set so we default to true on MacOS X
# until MACOSX_PORT-214 is fixed
ALWAYS_PASS_TEST_GAMMA=true
endif
endif
ifeq ($(ALWAYS_PASS_TEST_GAMMA), true)
TEST_GAMMA_STATUS= echo 'exit 0';
else
TEST_GAMMA_STATUS=
endif
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \ BUILDTREE = \
...@@ -353,12 +339,10 @@ env.sh: $(BUILDTREE_MAKE) ...@@ -353,12 +339,10 @@ env.sh: $(BUILDTREE_MAKE)
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
{ \ { \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
echo "export JAVA_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
) > $@ ) > $@
env.csh: env.sh env.csh: env.sh
...@@ -412,7 +396,7 @@ JAVA_FLAG/32 = -d32 ...@@ -412,7 +396,7 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/64 = -d64 JAVA_FLAG/64 = -d64
WRONG_DATA_MODE_MSG = \ WRONG_DATA_MODE_MSG = \
echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
CROSS_COMPILING_MSG = \ CROSS_COMPILING_MSG = \
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run." echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
...@@ -420,20 +404,78 @@ CROSS_COMPILING_MSG = \ ...@@ -420,20 +404,78 @@ CROSS_COMPILING_MSG = \
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@echo Creating $@ ... @echo Creating $@ ...
$(QUIETLY) ( \ $(QUIETLY) ( \
echo '#!/bin/sh'; \ echo "#!/bin/sh"; \
echo ""; \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo '. ./env.sh'; \ echo ""; \
echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \ echo "# Include environment settings for gamma run"; \
echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ echo ""; \
echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ echo ". ./env.sh"; \
echo "then"; \ echo ""; \
echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ echo "# Do not run gamma test for cross compiles"; \
echo ""; \
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
echo " $(CROSS_COMPILING_MSG)"; \
echo " exit 0"; \
echo "fi"; \ echo "fi"; \
echo ""; \
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
echo ""; \
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
echo " $(NO_JAVA_HOME_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Check JAVA_HOME version to be used for the test"; \
echo ""; \
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
echo "if [ \$$? -ne 0 ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Use gamma_g if it exists"; \
echo ""; \
echo "GAMMA_PROG=gamma"; \
echo "if [ -f gamma_g ]; then "; \
echo " GAMMA_PROG=gamma_g"; \
echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
echo ""; \
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
echo " fi"; \
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo " fi"; \
echo "fi"; \
echo ""; \
echo "# Compile Queens program for test"; \
echo ""; \
echo "rm -f Queens.class"; \ echo "rm -f Queens.class"; \
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ echo ""; \
echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ echo "# Set library path solely for gamma launcher test run"; \
$(TEST_GAMMA_STATUS) \ echo ""; \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "export LD_LIBRARY_PATH"; \
echo "unset LD_LIBRARY_PATH_32"; \
echo "unset LD_LIBRARY_PATH_64"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo " export DYLD_LIBRARY_PATH"; \
echo "fi"; \
echo ""; \
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
echo ""; \
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
) > $@ ) > $@
$(QUIETLY) chmod +x $@ $(QUIETLY) chmod +x $@
......
...@@ -142,6 +142,7 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html ...@@ -142,6 +142,7 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so # client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
ifndef BUILD_CLIENT_ONLY ifndef BUILD_CLIENT_ONLY
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
...@@ -150,7 +151,6 @@ endif ...@@ -150,7 +151,6 @@ endif
ifneq ($(ZERO_BUILD), true) ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif endif
......
...@@ -50,7 +50,24 @@ ifeq ($(LINK_INTO),AOUT) ...@@ -50,7 +50,24 @@ ifeq ($(LINK_INTO),AOUT)
LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
else else
LAUNCHER.o = launcher.o LAUNCHER.o = launcher.o
LFLAGS_LAUNCHER += -L`pwd` LFLAGS_LAUNCHER += -L`pwd`
# The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
# freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
# the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
# first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
# statically linked with CoreFoundation framework libs. Unfortunately, gamma's
# unique searchpath results in some unresolved symbols in the framework
# libraries, because JDK libraries are inadvertently discovered first on the
# searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
# So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
# To resolve this, gamma needs to also statically link with the CoreFoundation
# framework libraries.
ifeq ($(OS_VENDOR),Darwin)
LFLAGS_LAUNCHER += -framework CoreFoundation
endif
LIBS_LAUNCHER += -l$(JVM) $(LIBS) LIBS_LAUNCHER += -l$(JVM) $(LIBS)
endif endif
......
...@@ -337,8 +337,8 @@ ifeq ($(OS_VENDOR), Darwin) ...@@ -337,8 +337,8 @@ ifeq ($(OS_VENDOR), Darwin)
$(LIBJVM).dSYM: $(LIBJVM) $(LIBJVM).dSYM: $(LIBJVM)
dsymutil $(LIBJVM) dsymutil $(LIBJVM)
# no launcher or libjvm_db for macosx # no libjvm_db for macosx
build: $(LIBJVM) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM
echo "Doing vm.make build:" echo "Doing vm.make build:"
else else
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
......
...@@ -326,11 +326,10 @@ env.sh: $(BUILDTREE_MAKE) ...@@ -326,11 +326,10 @@ env.sh: $(BUILDTREE_MAKE)
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
{ \ { \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
) > $@ ) > $@
env.csh: env.sh env.csh: env.sh
...@@ -384,7 +383,7 @@ JAVA_FLAG/32 = -d32 ...@@ -384,7 +383,7 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/64 = -d64 JAVA_FLAG/64 = -d64
WRONG_DATA_MODE_MSG = \ WRONG_DATA_MODE_MSG = \
echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
CROSS_COMPILING_MSG = \ CROSS_COMPILING_MSG = \
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run." echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
...@@ -392,19 +391,78 @@ CROSS_COMPILING_MSG = \ ...@@ -392,19 +391,78 @@ CROSS_COMPILING_MSG = \
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@echo Creating $@ ... @echo Creating $@ ...
$(QUIETLY) ( \ $(QUIETLY) ( \
echo '#!/bin/sh'; \ echo "#!/bin/sh"; \
echo ""; \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo '. ./env.sh'; \ echo ""; \
echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \ echo "# Include environment settings for gamma run"; \
echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ echo ""; \
echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ echo ". ./env.sh"; \
echo "then"; \ echo ""; \
echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ echo "# Do not run gamma test for cross compiles"; \
echo ""; \
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
echo " $(CROSS_COMPILING_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
echo ""; \
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
echo " $(NO_JAVA_HOME_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Check JAVA_HOME version to be used for the test"; \
echo ""; \
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
echo "if [ \$$? -ne 0 ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo "fi"; \ echo "fi"; \
echo ""; \
echo "# Use gamma_g if it exists"; \
echo ""; \
echo "GAMMA_PROG=gamma"; \
echo "if [ -f gamma_g ]; then "; \
echo " GAMMA_PROG=gamma_g"; \
echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
echo ""; \
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
echo " fi"; \
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo " fi"; \
echo "fi"; \
echo ""; \
echo "# Compile Queens program for test"; \
echo ""; \
echo "rm -f Queens.class"; \ echo "rm -f Queens.class"; \
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ echo ""; \
echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ echo "# Set library path solely for gamma launcher test run"; \
echo ""; \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "export LD_LIBRARY_PATH"; \
echo "unset LD_LIBRARY_PATH_32"; \
echo "unset LD_LIBRARY_PATH_64"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo " export DYLD_LIBRARY_PATH"; \
echo "fi"; \
echo ""; \
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
echo ""; \
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
) > $@ ) > $@
$(QUIETLY) chmod +x $@ $(QUIETLY) chmod +x $@
......
...@@ -118,7 +118,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) ...@@ -118,7 +118,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
env.ksh env.csh jdkpath.sh .dbxrc test_gamma env.sh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
...@@ -313,22 +313,19 @@ sa.make: $(BUILDTREE_MAKE) ...@@ -313,22 +313,19 @@ sa.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@ ) > $@
env.ksh: $(BUILDTREE_MAKE) env.sh: $(BUILDTREE_MAKE)
@echo Creating $@ ... @echo Creating $@ ...
$(QUIETLY) ( \ $(QUIETLY) ( \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
[ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
{ \ { \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "unset LD_LIBRARY_PATH_32"; \
echo "unset LD_LIBRARY_PATH_64"; \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \
) > $@ ) > $@
env.csh: env.ksh env.csh: env.sh
@echo Creating $@ ... @echo Creating $@ ...
$(QUIETLY) ( \ $(QUIETLY) ( \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
...@@ -384,23 +381,86 @@ JAVA_FLAG/32 = -d32 ...@@ -384,23 +381,86 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/64 = -d64 JAVA_FLAG/64 = -d64
WRONG_DATA_MODE_MSG = \ WRONG_DATA_MODE_MSG = \
echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
CROSS_COMPILING_MSG = \
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@echo Creating $@ ... @echo Creating $@ ...
$(QUIETLY) ( \ $(QUIETLY) ( \
echo '#!/bin/ksh'; \ echo "#!/bin/sh"; \
echo ""; \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo '. ./env.ksh'; \ echo ""; \
echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ echo "# Include environment settings for gamma run"; \
echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ echo ""; \
echo "then"; \ echo ". ./env.sh"; \
echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ echo ""; \
echo "# Do not run gamma test for cross compiles"; \
echo ""; \
echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
echo " $(CROSS_COMPILING_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
echo ""; \
echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
echo " $(NO_JAVA_HOME_MSG)"; \
echo " exit 0"; \
echo "fi"; \
echo ""; \
echo "# Check JAVA_HOME version to be used for the test"; \
echo ""; \
echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
echo "if [ \$$? -ne 0 ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo "fi"; \ echo "fi"; \
echo ""; \
echo "# Use gamma_g if it exists"; \
echo ""; \
echo "GAMMA_PROG=gamma"; \
echo "if [ -f gamma_g ]; then "; \
echo " GAMMA_PROG=gamma_g"; \
echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
echo ""; \
echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
echo " if [ ! -f \$${JVM_LIB} ]; then"; \
echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
echo " fi"; \
echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
echo " $(WRONG_DATA_MODE_MSG)"; \
echo " exit 0"; \
echo " fi"; \
echo "fi"; \
echo ""; \
echo "# Compile Queens program for test"; \
echo ""; \
echo "rm -f Queens.class"; \ echo "rm -f Queens.class"; \
echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ echo ""; \
echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ echo "# Set library path solely for gamma launcher test run"; \
echo ""; \
echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo "export LD_LIBRARY_PATH"; \
echo "unset LD_LIBRARY_PATH_32"; \
echo "unset LD_LIBRARY_PATH_64"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
echo " export DYLD_LIBRARY_PATH"; \
echo "fi"; \
echo ""; \
echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
echo ""; \
echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
) > $@ ) > $@
$(QUIETLY) chmod +x $@ $(QUIETLY) chmod +x $@
......
...@@ -301,6 +301,12 @@ static char cpu_arch[] = "sparc"; ...@@ -301,6 +301,12 @@ static char cpu_arch[] = "sparc";
#error Add appropriate cpu_arch setting #error Add appropriate cpu_arch setting
#endif #endif
// Compiler variant
#ifdef COMPILER2
#define COMPILER_VARIANT "server"
#else
#define COMPILER_VARIANT "client"
#endif
#ifndef _ALLBSD_SOURCE #ifndef _ALLBSD_SOURCE
// pid_t gettid() // pid_t gettid()
...@@ -2507,7 +2513,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) { ...@@ -2507,7 +2513,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
static char saved_jvm_path[MAXPATHLEN] = {0}; static char saved_jvm_path[MAXPATHLEN] = {0};
// Find the full path to the current module, libjvm.so or libjvm_g.so // Find the full path to the current module, libjvm or libjvm_g
void os::jvm_path(char *buf, jint buflen) { void os::jvm_path(char *buf, jint buflen) {
// Error checking. // Error checking.
if (buflen < MAXPATHLEN) { if (buflen < MAXPATHLEN) {
...@@ -2532,11 +2538,11 @@ void os::jvm_path(char *buf, jint buflen) { ...@@ -2532,11 +2538,11 @@ void os::jvm_path(char *buf, jint buflen) {
if (Arguments::created_by_gamma_launcher()) { if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Typical value for buf is // Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and // the right place in the string, then assume we are installed in a JDK and
// we're done. Otherwise, check for a JAVA_HOME environment variable and fix // we're done. Otherwise, check for a JAVA_HOME environment variable and
// up the path so it looks like libjvm.so is installed there (append a // construct a path to the JVM being overridden.
// fake suffix hotspot/libjvm.so).
const char *p = buf + strlen(buf) - 1; const char *p = buf + strlen(buf) - 1;
for (int count = 0; p > buf && count < 5; ++count) { for (int count = 0; p > buf && count < 5; ++count) {
for (--p; p > buf && *p != '/'; --p) for (--p; p > buf && *p != '/'; --p)
...@@ -2550,7 +2556,7 @@ void os::jvm_path(char *buf, jint buflen) { ...@@ -2550,7 +2556,7 @@ void os::jvm_path(char *buf, jint buflen) {
char* jrelib_p; char* jrelib_p;
int len; int len;
// Check the current module name "libjvm.so" or "libjvm_g.so". // Check the current module name "libjvm" or "libjvm_g".
p = strrchr(buf, '/'); p = strrchr(buf, '/');
assert(strstr(p, "/libjvm") == p, "invalid library name"); assert(strstr(p, "/libjvm") == p, "invalid library name");
p = strstr(p, "_g") ? "_g" : ""; p = strstr(p, "_g") ? "_g" : "";
...@@ -2563,19 +2569,32 @@ void os::jvm_path(char *buf, jint buflen) { ...@@ -2563,19 +2569,32 @@ void os::jvm_path(char *buf, jint buflen) {
// modules image doesn't have "jre" subdirectory // modules image doesn't have "jre" subdirectory
len = strlen(buf); len = strlen(buf);
jrelib_p = buf + len; jrelib_p = buf + len;
snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch);
// Add the appropriate library subdir
snprintf(jrelib_p, buflen-len, "/jre/lib");
if (0 != access(buf, F_OK)) {
snprintf(jrelib_p, buflen-len, "/lib");
}
// Add the appropriate client or server subdir
len = strlen(buf);
jrelib_p = buf + len;
snprintf(jrelib_p, buflen-len, "/%s", COMPILER_VARIANT);
if (0 != access(buf, F_OK)) { if (0 != access(buf, F_OK)) {
snprintf(jrelib_p, buflen-len, "/lib/%s", cpu_arch); snprintf(jrelib_p, buflen-len, "");
} }
// If the path exists within JAVA_HOME, add the JVM library name
// to complete the path to JVM being overridden. Otherwise fallback
// to the path to the current library.
if (0 == access(buf, F_OK)) { if (0 == access(buf, F_OK)) {
// Use current module name "libjvm[_g].so" instead of // Use current module name "libjvm[_g]" instead of
// "libjvm"debug_only("_g")".so" since for fastdebug version // "libjvm"debug_only("_g")"" since for fastdebug version
// we should have "libjvm.so" but debug_only("_g") adds "_g"! // we should have "libjvm" but debug_only("_g") adds "_g"!
len = strlen(buf); len = strlen(buf);
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p); snprintf(buf + len, buflen-len, "/libjvm%s%s", p, JNI_LIB_SUFFIX);
} else { } else {
// Go back to path of .so // Fall back to path of current library
rp = realpath(dli_fname, buf); rp = realpath(dli_fname, buf);
if (rp == NULL) if (rp == NULL)
return; return;
......
...@@ -701,6 +701,14 @@ GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative) ...@@ -701,6 +701,14 @@ GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
char libjava[MAXPATHLEN]; char libjava[MAXPATHLEN];
if (GetApplicationHome(path, pathsize)) { if (GetApplicationHome(path, pathsize)) {
/* Is the JRE universal, i.e. no arch dir? */
sprintf(libjava, "%s/jre/lib/" JAVA_DLL, path);
if (access(libjava, F_OK) == 0) {
strcat(path, "/jre");
goto found;
}
/* Is JRE co-located with the application? */ /* Is JRE co-located with the application? */
sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch); sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
if (access(libjava, F_OK) == 0) { if (access(libjava, F_OK) == 0) {
...@@ -734,7 +742,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) ...@@ -734,7 +742,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
return JNI_TRUE; return JNI_TRUE;
#else #else
Dl_info dlinfo; Dl_info dlinfo;
void *libjvm; void *libjvm;
if (_launcher_debug) { if (_launcher_debug) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册