6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
Summary: Changes to support building with SS12.
Reviewed-by: tbell
--- a/jdk/make/common/Defs-solaris.gmk Tue May 27 17:18:01 2008 -0700
+++ b/jdk/make/common/Defs-solaris.gmk Wed Jun 04 09:38:18 2008 -0700
@@ -197,7 +197,6 @@
# Lint Flags:
# -Xa ANSI C plus K&R, favor ANSI rules
-# -Xarch=XXX Same as 'cc -xarch=XXX'
# -fd report on old style func defs
# -errchk=structarg report on 64bit struct args by value
# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts)
@@ -206,6 +205,7 @@
# -x suppress unused externs
# -u suppress extern func/vars used/defined
# -errfmt=simple use one line errors with position info
+# $(LINT_XARCH_OPTION) See Compiler-sun.gwk
LINTFLAGS_COMMON = -Xa
LINTFLAGS_COMMON += -fd
@@ -224,42 +224,12 @@
# Tell the compilers to never generate globalized names, all the time.
CFLAGS_COMMON += -W0,-noglobal
-# Arch specific settings (determines type of .o files and instruction set)
-ifeq ($(ARCH_FAMILY), sparc)
- ifdef VIS_NEEDED
- XARCH_VALUE/32=v8plusa
- XARCH_VALUE/64=v9a
- else
- # Someday this should change to improve optimization on UltraSPARC
- # and abandon the old v8-only machines like the SPARCstation 10.
- # Indications with Mustang is that alacrity runs do not show a
- # big improvement using v8plus over v8, but other benchmarks might.
- XARCH_VALUE/32=v8
- XARCH_VALUE/64=v9
- endif
-endif
-ifeq ($(ARCH_FAMILY), i586)
- XARCH_VALUE/64=amd64
- XARCH_VALUE/32=
-endif
-
-# Arch value based on current data model being built
-XARCH_VALUE=$(XARCH_VALUE/$(ARCH_DATA_MODEL))
-ifneq ($(XARCH_VALUE), )
- # The actual compiler -xarch options to use
- XARCH_OPTION/32 = -xarch=$(XARCH_VALUE/32)
- XARCH_OPTION/64 = -xarch=$(XARCH_VALUE/64)
- XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL))
-endif
-
-# If we have a specific -xarch value to use, add it
-ifdef XARCH_OPTION
- CFLAGS_COMMON += $(XARCH_OPTION)
- CXXFLAGS_COMMON += $(XARCH_OPTION)
- ASFLAGS_COMMON += $(XARCH_OPTION)
- EXTRA_LIBS += $(XARCH_OPTION)
- LINTFLAGS_COMMON += -Xarch=$(XARCH_VALUE)
-endif
+# If we have a specific arch value to use, add it
+CFLAGS_COMMON += $(XARCH_OPTION)
+CXXFLAGS_COMMON += $(XARCH_OPTION)
+ASFLAGS_COMMON += $(AS_XARCH_OPTION)
+EXTRA_LIBS += $(XARCH_OPTION)
+LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
#
# uncomment the following to build with PERTURBALOT set
--- a/jdk/make/common/shared/Compiler-sun.gmk Tue May 27 17:18:01 2008 -0700
+++ b/jdk/make/common/shared/Compiler-sun.gmk Wed Jun 04 09:38:18 2008 -0700
@@ -31,6 +31,9 @@
# Sun Studio Compiler settings specific to Solaris
ifeq ($(PLATFORM), solaris)
+ # FIXUP: Change to SS12 when validated
+ #COMPILER_VERSION=SS12
+ #REQUIRED_CC_VER=5.9
COMPILER_VERSION=SS11
REQUIRED_CC_VER=5.8
CC = $(COMPILER_PATH)cc
@@ -51,8 +54,8 @@
# Sun Studio Compiler settings specific to Linux
ifeq ($(PLATFORM), linux)
# This has not been tested
- COMPILER_VERSION=SS11
- REQUIRED_CC_VER=5.8
+ COMPILER_VERSION=SS12
+ REQUIRED_CC_VER=5.9
CC = $(COMPILER_PATH)cc
CPP = $(COMPILER_PATH)cc -E
CXX = $(COMPILER_PATH)CC
@@ -74,3 +77,58 @@
_CC_VER :=$(shell $(CC) -V 2>&1 | $(HEAD) -n 1)
CC_VER :=$(call GetVersion,"$(_CC_VER)")
+# Arch specific settings (determines type of .o files and instruction set)
+# Starting in SS12 (5.9), the arch options changed.
+# The assembler /usr/ccs/bin/as wants older SS11 (5.8) style options.
+# Note: We need to have both 32 and 64 values at all times for awt Makefiles.
+#
+XARCH_OPTION_OLD/32 =
+XARCH_OPTION_OLD/64 =
+XARCH_OPTION_NEW/32 = -m32
+XARCH_OPTION_NEW/64 = -m64
+# Lint options are slightly different
+LINT_XARCH_OPTION_OLD/32 =
+LINT_XARCH_OPTION_OLD/64 =
+LINT_XARCH_OPTION_NEW/32 = -m32
+LINT_XARCH_OPTION_NEW/64 = -m64
+ifeq ($(ARCH_FAMILY), sparc)
+ ifdef VIS_NEEDED
+ XARCH_OPTION_OLD/32 += -xarch=v8plusa
+ XARCH_OPTION_OLD/64 += -xarch=v9a
+ XARCH_OPTION_NEW/32 += -xarch=sparcvis
+ XARCH_OPTION_NEW/64 += -xarch=sparcvis
+ else
+ # Someday this should change to improve optimization on UltraSPARC
+ # and abandon v8, even change to sparcvis or sparcvis2, this
+ # abandons machines like the SPARCstation 10.
+ # Indications with jdk6 is that alacrity runs do not show a
+ # big improvement using v8plus over v8, but other benchmarks might.
+ XARCH_OPTION_OLD/32 += -xarch=v8
+ XARCH_OPTION_OLD/64 += -xarch=v9
+ # Note that this new option (SS12+) effectively means v8plus
+ XARCH_OPTION_NEW/32 += -xarch=sparc
+ XARCH_OPTION_NEW/64 += -xarch=sparc
+ endif
+ LINT_XARCH_OPTION_OLD/64 += -Xarch=v9
+endif
+ifeq ($(ARCH_FAMILY), i586)
+ XARCH_OPTION_OLD/64 += -xarch=amd64
+ LINT_XARCH_OPTION_OLD/64 += -Xarch=amd64
+endif
+# Pick the options we want based on the compiler being used.
+ifeq ($(shell expr $(CC_VER) \>= 5.9), 1)
+ XARCH_OPTION/32 = $(XARCH_OPTION_NEW/32)
+ XARCH_OPTION/64 = $(XARCH_OPTION_NEW/64)
+ LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_NEW/32)
+ LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_NEW/64)
+else
+ XARCH_OPTION/32 = $(XARCH_OPTION_OLD/32)
+ XARCH_OPTION/64 = $(XARCH_OPTION_OLD/64)
+ LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_OLD/32)
+ LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_OLD/64)
+endif
+XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL))
+LINT_XARCH_OPTION = $(LINT_XARCH_OPTION/$(ARCH_DATA_MODEL))
+# The /usr/ccs/bin/as assembler always wants the older SS11 (5.8) options.
+AS_XARCH_OPTION = $(XARCH_OPTION_OLD/$(ARCH_DATA_MODEL))
+
--- a/jdk/make/jdk_generic_profile.sh Tue May 27 17:18:01 2008 -0700
+++ b/jdk/make/jdk_generic_profile.sh Wed Jun 04 09:38:18 2008 -0700
@@ -119,7 +119,7 @@
# System place where JDK installed images are stored?
jdk_instances=/usr/jdk/instances
- # Get the SS11 compilers (and latest patches for them too)
+ # Get the Sun Studio compilers (and latest patches for them too)
if [ "${ALT_COMPILER_PATH}" = "" ] ; then
ALT_COMPILER_PATH=/opt/SUNWspro/bin
export ALT_COMPILER_PATH
--- a/jdk/make/jprt.config Tue May 27 17:18:01 2008 -0700
+++ b/jdk/make/jprt.config Wed Jun 04 09:38:18 2008 -0700
@@ -133,9 +133,15 @@
solaris_arch=i386
fi
- # Get the SS11 compilers into path (make sure it matches ALT setting)
- compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/SS11/bin
- compiler_name=SS11
+ # Get the compilers into path (make sure it matches ALT setting)
+ if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
+ compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
+ else
+ # FIXUP: Change to SS12 when validated
+ #compiler_name=SS12
+ compiler_name=SS11
+ fi
+ compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
ALT_COMPILER_PATH="${compiler_path}"
export ALT_COMPILER_PATH
dirMustExist "${compiler_path}" ALT_COMPILER_PATH