aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorbobv <none@none>2010-08-03 08:13:38 -0400
committerbobv <none@none>2010-08-03 08:13:38 -0400
commitbdabaa2f80947252e9a8bea284ddfc529c4d4ce2 (patch)
tree8f49097b5faea170476a5f5222ac00fc4ba40995 /make
parent7091355cea37e4893d8490c33ddfd14e84713ccc (diff)
6953477: Increase portability and flexibility of building Hotspot
Summary: A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail. Reviewed-by: phh, never, coleenp, dholmes
Diffstat (limited to 'make')
-rw-r--r--make/Makefile8
-rw-r--r--make/defs.make8
-rw-r--r--make/linux/makefiles/build_vm_def.sh9
-rw-r--r--make/linux/makefiles/buildtree.make4
-rw-r--r--make/linux/makefiles/defs.make44
-rw-r--r--make/linux/makefiles/gcc.make33
-rw-r--r--make/linux/makefiles/product.make6
-rw-r--r--make/linux/makefiles/sa.make7
-rw-r--r--make/linux/makefiles/saproc.make4
-rw-r--r--make/linux/makefiles/vm.make21
-rw-r--r--make/solaris/makefiles/defs.make10
11 files changed, 126 insertions, 28 deletions
diff --git a/make/Makefile b/make/Makefile
index 130a73cdb..6bfb16a11 100644
--- a/make/Makefile
+++ b/make/Makefile
@@ -90,9 +90,15 @@ ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
JDK_DIRS=bin include jre lib demo
all: all_product all_fastdebug
+ifndef BUILD_CLIENT_ONLY
all_product: product product1 productkernel docs export_product
all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
all_debug: jvmg jvmg1 jvmgkernel docs export_debug
+else
+all_product: product1 docs export_product
+all_fastdebug: fastdebug1 docs export_fastdebug
+all_debug: jvmg1 docs export_debug
+endif
all_optimized: optimized optimized1 optimizedkernel docs export_optimized
allzero: all_productzero all_fastdebugzero
@@ -295,6 +301,8 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
$(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
$(install-file)
else
+$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
+ $(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
$(install-file)
$(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
diff --git a/make/defs.make b/make/defs.make
index be4eda0f1..528d9405b 100644
--- a/make/defs.make
+++ b/make/defs.make
@@ -192,13 +192,16 @@ ifneq ($(OSNAME),windows)
# Use uname output for SRCARCH, but deal with platform differences. If ARCH
# is not explicitly listed below, it is treated as x86.
- SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 zero,$(ARCH)))
+ SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
ARCH/ = x86
ARCH/sparc = sparc
ARCH/sparc64= sparc
ARCH/ia64 = ia64
ARCH/amd64 = x86
ARCH/x86_64 = x86
+ ARCH/ppc64 = ppc
+ ARCH/ppc = ppc
+ ARCH/arm = arm
ARCH/zero = zero
# BUILDARCH is usually the same as SRCARCH, except for sparcv9
@@ -223,6 +226,9 @@ ifneq ($(OSNAME),windows)
LIBARCH/sparc = sparc
LIBARCH/sparcv9 = sparcv9
LIBARCH/ia64 = ia64
+ LIBARCH/ppc64 = ppc
+ LIBARCH/ppc = ppc
+ LIBARCH/arm = arm
LIBARCH/zero = $(ZERO_LIBARCH)
LP64_ARCH = sparcv9 amd64 ia64 zero
diff --git a/make/linux/makefiles/build_vm_def.sh b/make/linux/makefiles/build_vm_def.sh
index 51a07b9bf..2b6f906ee 100644
--- a/make/linux/makefiles/build_vm_def.sh
+++ b/make/linux/makefiles/build_vm_def.sh
@@ -1,5 +1,12 @@
#!/bin/sh
-nm --defined-only $* | awk '
+# If we're cross compiling use that path for nm
+if [ "$ALT_COMPILER_PATH" != "" ]; then
+NM=$ALT_COMPILER_PATH/nm
+else
+NM=nm
+fi
+
+$NM --defined-only $* | awk '
{ if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" }
'
diff --git a/make/linux/makefiles/buildtree.make b/make/linux/makefiles/buildtree.make
index b7ce6513c..af34617f4 100644
--- a/make/linux/makefiles/buildtree.make
+++ b/make/linux/makefiles/buildtree.make
@@ -339,12 +339,16 @@ JAVA_FLAG/64 = -d64
WRONG_DATA_MODE_MSG = \
echo "JAVA_HOME must point to $(DATA_MODE)bit JDK."
+CROSS_COMPILING_MSG = \
+ echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
+
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@echo Creating $@ ...
$(QUIETLY) ( \
echo '#!/bin/sh'; \
$(BUILDTREE_COMMENT); \
echo '. ./env.sh'; \
+ echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \
echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \
echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \
echo "then"; \
diff --git a/make/linux/makefiles/defs.make b/make/linux/makefiles/defs.make
index 29ef407ad..561f7f581 100644
--- a/make/linux/makefiles/defs.make
+++ b/make/linux/makefiles/defs.make
@@ -98,6 +98,22 @@ ifeq ($(ARCH), i686)
HS_ARCH = x86
endif
+# ARM
+ifeq ($(ARCH), arm)
+ ARCH_DATA_MODEL = 32
+ PLATFORM = linux-arm
+ VM_PLATFORM = linux_arm
+ HS_ARCH = arm
+endif
+
+# PPC
+ifeq ($(ARCH), ppc)
+ ARCH_DATA_MODEL = 32
+ PLATFORM = linux-ppc
+ VM_PLATFORM = linux_ppc
+ HS_ARCH = ppc
+endif
+
JDK_INCLUDE_SUBDIR=linux
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
@@ -107,22 +123,32 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
-
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
+
+ifndef BUILD_CLIENT_ONLY
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
+endif
+
ifneq ($(ZERO_BUILD), true)
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)/libjvm.so
- EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
- EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
- else
- ifeq ($(ARCH),ia64)
- else
- EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
- EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
- endif
endif
endif
+
+# Serviceability Binaries
+# No SA Support for PPC, IA64, ARM or zero
+ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
+ $(EXPORT_LIB_DIR)/sa-jdi.jar
+ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
+ $(EXPORT_LIB_DIR)/sa-jdi.jar
+ADD_SA_BINARIES/ppc =
+ADD_SA_BINARIES/ia64 =
+ADD_SA_BINARIES/arm =
+ADD_SA_BINARIES/zero =
+
+EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
+
+
diff --git a/make/linux/makefiles/gcc.make b/make/linux/makefiles/gcc.make
index e7ed00e91..4b35ae535 100644
--- a/make/linux/makefiles/gcc.make
+++ b/make/linux/makefiles/gcc.make
@@ -25,8 +25,14 @@
#------------------------------------------------------------------------
# CC, CPP & AS
+ifdef ALT_COMPILER_PATH
+CPP = $(ALT_COMPILER_PATH)/g++
+CC = $(ALT_COMPILER_PATH)/gcc
+else
CPP = g++
CC = gcc
+endif
+
AS = $(CC) -c
# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
@@ -67,18 +73,31 @@ ARCHFLAG/amd64 = -m64
ARCHFLAG/ia64 =
ARCHFLAG/sparc = -m32 -mcpu=v9
ARCHFLAG/sparcv9 = -m64 -mcpu=v9
+ARCHFLAG/arm = -fsigned-char
ARCHFLAG/zero = $(ZERO_ARCHFLAG)
+ifndef E500V2
+ARCHFLAG/ppc = -mcpu=powerpc
+endif
CFLAGS += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LFLAGS += $(ARCHFLAG)
ASFLAGS += $(ARCHFLAG)
+ifdef E500V2
+CFLAGS += -DE500V2
+endif
+
# Use C++ Interpreter
ifdef CC_INTERP
CFLAGS += -DCC_INTERP
endif
+# Build for embedded targets
+ifdef JAVASE_EMBEDDED
+ CFLAGS += -DJAVASE_EMBEDDED
+endif
+
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -171,6 +190,8 @@ AOUT_FLAGS += -export-dynamic
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
+DEBUG_CFLAGS/arm = -g
+DEBUG_CFLAGS/ppc = -g
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
@@ -181,3 +202,15 @@ ifeq ($(DEBUG_BINARIES), true)
DEBUG_CFLAGS = -g
CFLAGS += $(DEBUG_CFLAGS)
endif
+
+# If we are building HEADLESS, pass on to VM
+# so it can set the java.awt.headless property
+ifdef HEADLESS
+CFLAGS += -DHEADLESS
+endif
+
+# We are building Embedded for a small device
+# favor code space over speed
+ifdef MINIMIZE_RAM_USAGE
+CFLAGS += -DMINIMIZE_RAM_USAGE
+endif
diff --git a/make/linux/makefiles/product.make b/make/linux/makefiles/product.make
index 82ed58a1f..ff768b6a6 100644
--- a/make/linux/makefiles/product.make
+++ b/make/linux/makefiles/product.make
@@ -46,7 +46,11 @@ VERSION = optimized
# use -g to strip library as -x will discard its symbol table; -x is fine for
# executables.
-STRIP = strip
+ifdef CROSS_COMPILE_ARCH
+ STRIP = $(ALT_COMPILER_PATH)/strip
+else
+ STRIP = strip
+endif
STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
STRIP_AOUT = $(STRIP) -x $@ || exit 1;
diff --git a/make/linux/makefiles/sa.make b/make/linux/makefiles/sa.make
index f7a1a208b..19d68083e 100644
--- a/make/linux/makefiles/sa.make
+++ b/make/linux/makefiles/sa.make
@@ -55,10 +55,13 @@ SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VE
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA
-# also, we don't build SA on Itanium or zero.
+# also, we don't build SA on Itanium, PowerPC, ARM or zero.
all:
- if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
+ if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
+ -a "$(SRCARCH)" != "arm" \
+ -a "$(SRCARCH)" != "ppc" \
+ -a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
diff --git a/make/linux/makefiles/saproc.make b/make/linux/makefiles/saproc.make
index 1da5c217d..bc4fc66c5 100644
--- a/make/linux/makefiles/saproc.make
+++ b/make/linux/makefiles/saproc.make
@@ -53,10 +53,10 @@ ifeq ($(DEBUG_BINARIES), true)
endif
# if $(AGENT_DIR) does not exist, we don't build SA
-# also, we don't build SA on Itanium or zero.
+# also, we don't build SA on Itanium, PPC, ARM or zero.
checkAndBuildSA:
- $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
+ $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f vm.make $(LIBSAPROC); \
fi
diff --git a/make/linux/makefiles/vm.make b/make/linux/makefiles/vm.make
index 0f8bccd2a..3449d0496 100644
--- a/make/linux/makefiles/vm.make
+++ b/make/linux/makefiles/vm.make
@@ -98,6 +98,7 @@ CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS)
LIBS += -lm -ldl -lpthread
@@ -210,15 +211,17 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
$(LINK_LIB.CC/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
[ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
- if [ -x /usr/sbin/selinuxenabled ] ; then \
- /usr/sbin/selinuxenabled; \
- if [ $$? = 0 ] ; then \
- /usr/bin/chcon -t textrel_shlib_t $@; \
- if [ $$? != 0 ]; then \
- echo "ERROR: Cannot chcon $@"; \
- fi \
- fi \
- fi \
+ if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \
+ if [ -x /usr/sbin/selinuxenabled ] ; then \
+ /usr/sbin/selinuxenabled; \
+ if [ $$? = 0 ] ; then \
+ /usr/bin/chcon -t textrel_shlib_t $@; \
+ if [ $$? != 0 ]; then \
+ echo "ERROR: Cannot chcon $@"; \
+ fi \
+ fi \
+ fi \
+ fi \
}
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
diff --git a/make/solaris/makefiles/defs.make b/make/solaris/makefiles/defs.make
index 9e1d981ce..637b3b49c 100644
--- a/make/solaris/makefiles/defs.make
+++ b/make/solaris/makefiles/defs.make
@@ -70,20 +70,24 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
+ifneq ($(BUILD_CLIENT_ONLY),true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so
+endif
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)/libjvm.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so
- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so
- EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.so
- EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.so
+ ifneq ($(BUILD_CLIENT_ONLY), true)
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
+ endif
endif
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so