diff --git a/make/jprt.config b/make/jprt.config index 2c1f0dce2f4e393c2d6dc2d0f93df38b2d8176d6..4964914e0628dfcf2da2a4c85d3f423eadb067d7 100644 --- a/make/jprt.config +++ b/make/jprt.config @@ -68,8 +68,23 @@ if [ "${osname}" = SunOS ] ; then solaris_arch=i386 fi - # Get the SS11 compilers into path (make sure it matches ALT setting) - compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/SS11/bin + if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then + compiler_name=${JPRT_SOLARIS_COMPILER_NAME} + else + if [ "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6" -o \ + "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6u10" -o \ + "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6perf" ] ; then + # All jdk6 builds use SS11 + compiler_name=SS11 + else + # FIXUP: Change to SS12 once it has been validated. + #compiler_name=SS12 + compiler_name=SS11 + fi + fi + + # Get into path (make sure it matches ALT setting) + compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/${compiler_name}/bin dirMustExist "${compiler_path}" COMPILER_PATH path4sdk=${compiler_path} diff --git a/make/solaris/makefiles/debug.make b/make/solaris/makefiles/debug.make index d759910be9e83335bc6840f5ca8fed7986345735..4474ec9d8e02bcaae4c8c2f979d854d318fcd77d 100644 --- a/make/solaris/makefiles/debug.make +++ b/make/solaris/makefiles/debug.make @@ -29,7 +29,8 @@ DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +ifeq ($(COMPILER_REV),5.8) # SS11 SEGV when compiling with -g and -xarch=v8, using different backend DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0 diff --git a/make/solaris/makefiles/dtrace.make b/make/solaris/makefiles/dtrace.make index f4f7edf934d1da135345238fa68b0d5533a9bfdb..0d3dce0fcceb0b31deea5e6e3b60c5c745e867e9 100644 --- a/make/solaris/makefiles/dtrace.make +++ b/make/solaris/makefiles/dtrace.make @@ -92,12 +92,12 @@ XARCH = $(subst sparcv9,v9,$(shell echo $(ISA))) $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ - $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \ + $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ - $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \ + $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor endif # ifneq ("${ISA}","${BUILDARCH}") diff --git a/make/solaris/makefiles/fastdebug.make b/make/solaris/makefiles/fastdebug.make index 0329b4c36783168994fa21419e780aebc4f47fff..4c5a4eee84781361572c80252a1b78da47d1980b 100644 --- a/make/solaris/makefiles/fastdebug.make +++ b/make/solaris/makefiles/fastdebug.make @@ -25,7 +25,7 @@ # Sets make macros for making debug version of VM # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make -# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_FLAGS. +# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_CFLAGS. FASTDEBUG_CFLAGS$(FASTDEBUG_CFLAGS) = $(DEBUG_CFLAGS) @@ -35,15 +35,26 @@ OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") OPT_CFLAGS/SLOWER = -xO2 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) -# CC 5.5 has bug 4908364 with -xO4 + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV), 5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) +endif + +ifeq ($(COMPILER_REV), 5.5) +# CC 5.5 has bug 4908364 with -xO4 (Fixed in 5.6) OPT_CFLAGS/library_call.o = $(OPT_CFLAGS/SLOWER) -else # COMPILER_REV >= 5.5 +endif # COMPILER_REV == 5.5 + +ifeq ($(shell expr $(COMPILER_REV) \<= 5.4), 1) # Compilation of *_.cpp can take an hour or more at O3. Use O2 # See comments at top of sparc.make. OPT_CFLAGS/ad_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) OPT_CFLAGS/dfa_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) -endif # COMPILER_REV >= 5.5 +endif # COMPILER_REV <= 5.4 ifeq (${COMPILER_REV}, 5.0) # Avoid a compiler bug caused by using -xO -g diff --git a/make/solaris/makefiles/jvmg.make b/make/solaris/makefiles/jvmg.make index 24a3510d4a50810c905d196b4f50685c75726dfa..3233025b031d84f05014c94add06108638272e25 100644 --- a/make/solaris/makefiles/jvmg.make +++ b/make/solaris/makefiles/jvmg.make @@ -29,7 +29,8 @@ DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +ifeq ($(COMPILER_REV),5.8)) # SS11 SEGV when compiling with -g and -xarch=v8, using different backend DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0 diff --git a/make/solaris/makefiles/optimized.make b/make/solaris/makefiles/optimized.make index 4e8f6484790395f51ee37e677f60530a4d16647a..ed3d8e02c7e09b16fe99999bf19ddd47731b58bb 100644 --- a/make/solaris/makefiles/optimized.make +++ b/make/solaris/makefiles/optimized.make @@ -30,12 +30,21 @@ OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS) OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@)) # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) - -# Workaround SS11 bug 6345274 (all platforms) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV),5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g +endif + +# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) +ifeq ($(COMPILER_REV),5.8)) OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) -endif # COMPILER_REV >= 5.8 +endif # COMPILER_REV == 5.8 + endif # Platform_compiler == sparcWorks # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings diff --git a/make/solaris/makefiles/product.make b/make/solaris/makefiles/product.make index d2e78c6646a5a7ebf4d1db9dc79380ce1144a085..da8bab3da293a3b1faeffa62bb9013dac01abac7 100644 --- a/make/solaris/makefiles/product.make +++ b/make/solaris/makefiles/product.make @@ -38,12 +38,21 @@ OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS) -xinline=no%__1cFciEnvbFpost_compiled_method_ endif # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) - -# Workaround SS11 bug 6345274 (all platforms) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV),5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g +endif + +# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) +ifeq ($(COMPILER_REV),5.8) OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) -endif # COMPILER_REV >= 5.8 +endif # COMPILER_REV == 5.8 + endif # Platform_compiler == sparcWorks # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings diff --git a/make/solaris/makefiles/sparc.make b/make/solaris/makefiles/sparc.make index b3a0e2682bbded2ddced6cf89616960afd619064..46ce5ce79b92c9b146cde2633de08be9dfab1169 100644 --- a/make/solaris/makefiles/sparc.make +++ b/make/solaris/makefiles/sparc.make @@ -23,7 +23,7 @@ # Obj_Files += solaris_sparc.o -ASFLAGS += $(ARCHFLAG) +ASFLAGS += $(AS_ARCHFLAG) ifeq ("${Platform_compiler}", "sparcWorks") ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) diff --git a/make/solaris/makefiles/sparcWorks.make b/make/solaris/makefiles/sparcWorks.make index a20546e6528510f70759e44cba5ad22d68c3b254..942aeb4a4ae4aff6efbed1830abde41c19e72828 100644 --- a/make/solaris/makefiles/sparcWorks.make +++ b/make/solaris/makefiles/sparcWorks.make @@ -28,6 +28,8 @@ CC = cc CPP = CC +# Note that this 'as' is an older version of the Sun Studio 'fbe', and will +# use the older style options. The 'fbe' options will match 'cc' and 'CC'. AS = /usr/ccs/bin/as NM = /usr/ccs/bin/nm @@ -43,25 +45,33 @@ $(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') C_COMPILER_REV := \ $(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') -VALIDATED_COMPILER_REV := 5.8 -VALIDATED_C_COMPILER_REV := 5.8 +# Pick which compiler is validated +ifeq ($(JDK_MINOR_VERSION),6) + # Validated compiler for JDK6 is SS11 (5.8) + VALIDATED_COMPILER_REV := 5.8 + VALIDATED_C_COMPILER_REV := 5.8 +else + # FIXUP: Change to SS12 (5.9) once it has been validated. + # Validated compiler for JDK7 is SS12 (5.9) + #VALIDATED_COMPILER_REV := 5.9 + #VALIDATED_C_COMPILER_REV := 5.9 + VALIDATED_COMPILER_REV := 5.8 + VALIDATED_C_COMPILER_REV := 5.8 +endif +# Warning messages about not using the above validated version ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV}) -dummy_target_to_enforce_compiler_rev: - @echo "Wrong ${CPP} version: ${COMPILER_REV}. " \ - "Use version ${ENFORCE_COMPILER_REV}, or set" \ - "ENFORCE_COMPILER_REV=${COMPILER_REV}." - @exit 1 +dummy_target_to_enforce_compiler_rev:=\ +$(info WARNING: You are using CC version ${COMPILER_REV} \ +and should be using version ${ENFORCE_COMPILER_REV}) endif ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV}) -dummy_target_to_enforce_c_compiler_rev: - @echo "Wrong ${CC} version: ${C_COMPILER_REV}. " \ - "Use version ${ENFORCE_C_COMPILER_REV}, or set" \ - "ENFORCE_C_COMPILER_REV=${C_COMPILER_REV}." - @exit 1 +dummy_target_to_enforce_c_compiler_rev:=\ +$(info WARNING: You are using cc version ${C_COMPILER_REV} \ +and should be using version ${ENFORCE_C_COMPILER_REV}) endif # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 @@ -90,20 +100,44 @@ SOLARIS_7_OR_LATER := \ $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }') CFLAGS += ${SOLARIS_7_OR_LATER} -ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) -# set ARCHFLAG/BUILDARCH which will ultimately be ARCHFLAG +# New architecture options started in SS12 (5.9), we need both styles to build. +# The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as. +# Note: SS12 default for 32bit sparc is now the same as v8plus, so the +# settings below have changed all SS12 32bit sparc builds to be v8plus. +# The older SS11 (5.8) settings have remained as they always have been. ifeq ($(TYPE),COMPILER2) -ARCHFLAG/sparc = -xarch=v8plus -else -ifeq ($(TYPE),TIERED) -ARCHFLAG/sparc = -xarch=v8plus + ARCHFLAG_OLD/sparc = -xarch=v8plus else -ARCHFLAG/sparc = -xarch=v8 + ifeq ($(TYPE),TIERED) + ARCHFLAG_OLD/sparc = -xarch=v8plus + else + ARCHFLAG_OLD/sparc = -xarch=v8 + endif endif +ARCHFLAG_NEW/sparc = -m32 -xarch=sparc +ARCHFLAG_OLD/sparcv9 = -xarch=v9 +ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc +ARCHFLAG_OLD/i486 = +ARCHFLAG_NEW/i486 = -m32 +ARCHFLAG_OLD/amd64 = -xarch=amd64 +ARCHFLAG_NEW/amd64 = -m64 + +# Select the ARCHFLAGs and other SS12 (5.9) options +ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1) + ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) + ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) + ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) + ARCHFLAG/amd64 = $(ARCHFLAG_NEW/amd64) +else + ARCHFLAG/sparc = $(ARCHFLAG_OLD/sparc) + ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9) + ARCHFLAG/i486 = $(ARCHFLAG_OLD/i486) + ARCHFLAG/amd64 = $(ARCHFLAG_OLD/amd64) endif -ARCHFLAG/sparcv9 = -xarch=v9 -ARCHFLAG/i486 = -ARCHFLAG/amd64 = -xarch=amd64 + +# ARCHFLAGS for the current build arch +ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) +AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH)) # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. ISA_DIR=$(ISA_DIR/$(BUILDARCH)) @@ -166,13 +200,13 @@ endif # 32bit x86 ifeq ("${Platform_arch_model}", "x86_64") -ASFLAGS += -xarch=amd64 -CFLAGS += -xarch=amd64 +ASFLAGS += $(AS_ARCHFLAG) +CFLAGS += $(ARCHFLAG/amd64) # this one seemed useless -LFLAGS_VM += -xarch=amd64 +LFLAGS_VM += $(ARCHFLAG/amd64) # this one worked -LFLAGS += -xarch=amd64 -AOUT_FLAGS += -xarch=amd64 +LFLAGS += $(ARCHFLAG/amd64) +AOUT_FLAGS += $(ARCHFLAG/amd64) # -xO3 is faster than -xO4 on specjbb with SS10 compiler OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) @@ -224,7 +258,7 @@ LFLAGS += -library=%none LFLAGS += -mt -endif # COMPILER_REV >= VALIDATED_COMPILER_REV +endif # COMPILER_REV >= 5.5 ###################################### # End 5.5 Forte compiler options # @@ -293,7 +327,7 @@ PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) LFLAGS += -library=Crun LIBS += -library=Crun -lCrun -endif # COMPILER_REV >= VALIDATED_COMPILER_REV +endif # COMPILER_REV == 5.2 ################################## # End 5.2 Forte compiler options # @@ -320,6 +354,7 @@ ifeq (${COMPILER_REV}, 5.0) # Had to hoist this higher apparently because of other changes. Must # come before -xarch specification. +# NOTE: native says optimize for the machine doing the compile, bad news. CFLAGS += -xtarget=native CFLAGS += $(ARCHFLAG) @@ -359,7 +394,7 @@ CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il endif # 32bit x86 # The following options run into misaligned ldd problem (raj) -#OPT_CFLAGS = -fast -O4 -xarch=v8 -xchip=ultra +#OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra # no more exceptions CFLAGS/NOEX=-noex @@ -427,6 +462,15 @@ DEBUG_CFLAGS = -g FASTDEBUG_CFLAGS = -g0 # The -g0 setting allows the C++ frontend to inline, which is a big win. +# Special global options for SS12 +ifeq ($(COMPILER_REV),5.9) + # There appears to be multiple issues with the new Dwarf2 debug format, so + # we tell the compiler to use the older 'stabs' debug format all the time. + # Note that this needs to be used in optimized compiles too to be 100%. + # This is a workaround for SS12 (5.9) bug 6694600 + CFLAGS += -xdebugformat=stabs +endif + # Enable the following CFLAGS additions if you need to compare the # built ELF objects. # diff --git a/make/solaris/makefiles/sparcv9.make b/make/solaris/makefiles/sparcv9.make index 985b7b47135927fa22d4e7b31d651b61b0d80cd4..62711f07d34d97fb8d59b70c897ed16e95ce10df 100644 --- a/make/solaris/makefiles/sparcv9.make +++ b/make/solaris/makefiles/sparcv9.make @@ -23,7 +23,7 @@ # Obj_Files += solaris_sparc.o -ASFLAGS += $(ARCHFLAG) +ASFLAGS += $(AS_ARCHFLAG) ifeq ("${Platform_compiler}", "sparcWorks") ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)