changeset 429:4d20a3aaf1ab

6769748: Fix solaris makefiles for the case when "CC -V" produces several lines Summary: Fix solaris makefiles for 5.10 compilers Reviewed-by: jcoomes
author kvn
date Wed, 12 Nov 2008 11:01:31 -0800
parents 364141474b40
children a45484ea312d
files make/solaris/makefiles/debug.make make/solaris/makefiles/fastdebug.make make/solaris/makefiles/i486.make make/solaris/makefiles/jvmg.make make/solaris/makefiles/optimized.make make/solaris/makefiles/product.make make/solaris/makefiles/sparc.make make/solaris/makefiles/sparcWorks.make make/solaris/makefiles/sparcv9.make make/solaris/makefiles/vm.make
diffstat 10 files changed, 43 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/make/solaris/makefiles/debug.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/debug.make	Wed Nov 12 11:01:31 2008 -0800
@@ -30,7 +30,7 @@
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 
-ifeq ($(COMPILER_REV),5.8)
+ifeq ($(COMPILER_REV_NUMERIC),508)
   # 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
--- a/make/solaris/makefiles/fastdebug.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/fastdebug.make	Wed Nov 12 11:01:31 2008 -0800
@@ -37,7 +37,7 @@
 OPT_CFLAGS/SLOWER = -xO2
 
 # Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
-ifeq ($(COMPILER_REV), 5.9)
+ifeq ($(COMPILER_REV_NUMERIC), 509)
   # To avoid jvm98 crash
   OPT_CFLAGS/instanceKlass.o = $(OPT_CFLAGS/SLOWER)
   # Not clear this workaround could be skipped in some cases.
@@ -46,25 +46,25 @@
   OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER)
 endif
 
-ifeq ($(COMPILER_REV), 5.5)
+ifeq ($(COMPILER_REV_NUMERIC), 505)
 # CC 5.5 has bug 4908364 with -xO4  (Fixed in 5.6)
 OPT_CFLAGS/library_call.o = $(OPT_CFLAGS/SLOWER)
-endif # COMPILER_REV == 5.5
+endif # COMPILER_REV_NUMERIC == 505
 
-ifeq ($(shell expr $(COMPILER_REV) \<= 5.4), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \<= 504), 1)
 # Compilation of *_<arch>.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.4
+endif # COMPILER_REV_NUMERIC <= 504
 
-ifeq (${COMPILER_REV}, 5.0)
+ifeq (${COMPILER_REV_NUMERIC}, 500)
 # Avoid a compiler bug caused by using -xO<level> -g<level>
 # Since the bug also occurs with -xO0, use an innocuous value (must not be null)
 OPT_CFLAGS/c1_LIROptimizer_i486.o = -c
 endif
 
-ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 505), 1)
 # Same problem with Solaris/x86 compiler (both 5.0 and 5.2) on ad_i486.cpp.
 # CC build time is also too long for ad_i486_{gen,misc}.o
 OPT_CFLAGS/ad_i486.o = -c
--- a/make/solaris/makefiles/i486.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/i486.make	Wed Nov 12 11:01:31 2008 -0800
@@ -36,16 +36,12 @@
 
 # _lwp_create_interpose must have a frame
 OPT_CFLAGS/os_solaris_i486.o = -xO1
-# force C++ interpreter to be full optimization
-OPT_CFLAGS/interpret.o = -fast -O4
 else
 
 ifeq ("${Platform_compiler}", "gcc")
 # gcc
 # _lwp_create_interpose must have a frame
 OPT_CFLAGS/os_solaris_i486.o = -fno-omit-frame-pointer
-# force C++ interpreter to be full optimization
-OPT_CFLAGS/interpret.o = -O3
 #
 else
 # error
@@ -57,7 +53,7 @@
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 # ILD is gone as of SS11 (5.8), not supported in SS10 (5.7)
-ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1)
   #
   # Bug in ild causes it to fail randomly. Until we get a fix we can't
   # use ild.
--- a/make/solaris/makefiles/jvmg.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/jvmg.make	Wed Nov 12 11:01:31 2008 -0800
@@ -30,7 +30,7 @@
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 
-ifeq ($(COMPILER_REV),5.8)
+ifeq ($(COMPILER_REV_NUMERIC),508)
   # 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
--- a/make/solaris/makefiles/optimized.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/optimized.make	Wed Nov 12 11:01:31 2008 -0800
@@ -33,7 +33,7 @@
 ifeq ("${Platform_compiler}", "sparcWorks")
 
 # Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
-ifeq ($(COMPILER_REV),5.9)
+ifeq ($(COMPILER_REV_NUMERIC),509)
   # 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
@@ -41,9 +41,9 @@
 endif
 
 # Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12)
-ifeq ($(COMPILER_REV),5.8))
+ifeq ($(COMPILER_REV_NUMERIC),508))
 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2)
-endif # COMPILER_REV == 5.8
+endif # COMPILER_REV_NUMERIC == 508
 
 endif # Platform_compiler == sparcWorks
 
--- a/make/solaris/makefiles/product.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/product.make	Wed Nov 12 11:01:31 2008 -0800
@@ -41,7 +41,7 @@
 ifeq ("${Platform_compiler}", "sparcWorks")
 
 # Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
-ifeq ($(COMPILER_REV),5.9)
+ifeq ($(COMPILER_REV_NUMERIC),509)
   # 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
@@ -49,9 +49,9 @@
 endif
 
 # Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12)
-ifeq ($(COMPILER_REV),5.8)
+ifeq ($(COMPILER_REV_NUMERIC),508)
 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2)
-endif # COMPILER_REV == 5.8
+endif # COMPILER_REV_NUMERIC == 508
 
 endif # Platform_compiler == sparcWorks
 
--- a/make/solaris/makefiles/sparc.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/sparc.make	Wed Nov 12 11:01:31 2008 -0800
@@ -26,7 +26,7 @@
 ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMARIC) \< 505), 1)
 # For 5.2 ad_sparc file is compiled with -O2 %%%% remove when adlc is fixed
 OPT_CFLAGS/ad_sparc.o = $(OPT_CFLAGS/SLOWER)
 OPT_CFLAGS/dfa_sparc.o = $(OPT_CFLAGS/SLOWER)
--- a/make/solaris/makefiles/sparcWorks.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/sparcWorks.make	Wed Nov 12 11:01:31 2008 -0800
@@ -41,9 +41,9 @@
 
 # Get the last thing on the line that looks like x.x+ (x is a digit).
 COMPILER_REV := \
-$(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/')
+$(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
 C_COMPILER_REV := \
-$(shell $(CC) -V 2>&1 | grep -i "cc:" |  sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/')
+$(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
 
 # Pick which compiler is validated
 ifeq ($(JDK_MINOR_VERSION),6)
@@ -60,17 +60,19 @@
 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV}
 ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV})
 dummy_target_to_enforce_compiler_rev:=\
-$(info WARNING: You are using CC version ${COMPILER_REV} \
-and should be using version ${ENFORCE_COMPILER_REV})
+$(shell echo >&2 WARNING: You are using CC version ${COMPILER_REV} \
+and should be using version ${ENFORCE_COMPILER_REV}. Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this warning.)
 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:=\
-$(info WARNING: You are using cc version ${C_COMPILER_REV} \
-and should be using version ${ENFORCE_C_COMPILER_REV})
+$(shell echo >&2 WARNING: You are using cc version ${C_COMPILER_REV} \
+and should be using version ${ENFORCE_C_COMPILER_REV}. Set ENFORCE_C_COMPILER_REV=${C_COMPILER_REV} to avoid this warning.)
 endif
 
+COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }')
+
 # Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
 # and newer; objects with a dependency on this symbol will not run on older
 # Solaris 8.
@@ -120,7 +122,7 @@
 ARCHFLAG_NEW/amd64   = -m64
 
 # Select the ARCHFLAGs and other SS12 (5.9) options
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
   ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
   ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
   ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
@@ -150,7 +152,7 @@
 # Begin current (>=5.6) Forte compiler options #
 #################################################
 
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.6), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 506), 1)
 
 ifeq ("${Platform_arch}", "sparc")
 
@@ -167,7 +169,7 @@
 # Begin current (>=5.5) Forte compiler options #
 #################################################
 
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
 
 CFLAGS     += $(ARCHFLAG)
 AOUT_FLAGS += $(ARCHFLAG)
@@ -255,7 +257,7 @@
 
 LFLAGS += -mt
 
-endif	# COMPILER_REV >= 5.5
+endif	# COMPILER_REV_NUMERIC >= 505
 
 ######################################
 # End 5.5 Forte compiler options     #
@@ -265,7 +267,7 @@
 # Begin 5.2 Forte compiler options   #
 ######################################
 
-ifeq ($(COMPILER_REV), 5.2)
+ifeq ($(COMPILER_REV_NUMERIC), 502)
 
 CFLAGS     += $(ARCHFLAG)
 AOUT_FLAGS += $(ARCHFLAG)
@@ -324,7 +326,7 @@
 LFLAGS += -library=Crun
 LIBS   += -library=Crun -lCrun
 
-endif	# COMPILER_REV == 5.2
+endif	# COMPILER_REV_NUMERIC == 502
 
 ##################################
 # End 5.2 Forte compiler options #
@@ -333,7 +335,7 @@
 ##################################
 # Begin old 5.1 compiler options #
 ##################################
-ifeq ($(COMPILER_REV), 5.1)
+ifeq ($(COMPILER_REV_NUMERIC), 501)
 
 _JUNK_ := $(shell echo >&2 \
        "*** ERROR: sparkWorks.make incomplete for 5.1 compiler")
@@ -347,7 +349,7 @@
 # Begin old 5.0 compiler options #
 ##################################
 
-ifeq	(${COMPILER_REV}, 5.0)
+ifeq	(${COMPILER_REV_NUMERIC}, 500)
 
 # Had to hoist this higher apparently because of other changes. Must
 # come before -xarch specification.
@@ -379,7 +381,7 @@
 
 ifeq ("${Platform_arch_model}", "x86_32")
 OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)
-ifeq ("${COMPILER_REV}", "5.0")
+ifeq ("${COMPILER_REV_NUMERIC}", "500")
 # SC5.0 tools on x86 are flakey at -xO4
 OPT_CFLAGS+=-xO3
 else
@@ -405,13 +407,13 @@
 PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
 PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))
 
-endif	# COMPILER_REV = 5.0
+endif	# COMPILER_REV_NUMERIC = 500
 
 ################################
 # End old 5.0 compiler options #
 ################################
 
-ifeq ("${COMPILER_REV}", "4.2")
+ifeq ("${COMPILER_REV_NUMERIC}", "402")
 # 4.2 COMPILERS SHOULD NO LONGER BE USED
 _JUNK_ := $(shell echo >&2 \
        "*** ERROR: SC4.2 compilers are not supported by this code base!")
@@ -443,7 +445,7 @@
 LINK_MODE/optimized = -Bsymbolic -znodefs
 
 # Have thread local errnos
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
 CFLAGS += -mt
 else
 CFLAGS += -D_REENTRANT
@@ -460,7 +462,7 @@
 # The -g0 setting allows the C++ frontend to inline, which is a big win.
 
 # Special global options for SS12
-ifeq ($(COMPILER_REV),5.9)
+ifeq ($(COMPILER_REV_NUMERIC),509)
   # 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%.
@@ -479,8 +481,8 @@
 #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 
-ifeq	(${COMPILER_REV}, 5.2)
-COMPILER_DATE := $(shell $(CPP) -V 2>&1 | awk '{ print $$NF; }')
+ifeq	(${COMPILER_REV_NUMERIC}, 502)
+COMPILER_DATE := $(shell $(CPP) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }')
 ifeq	(${COMPILER_DATE}, 2001/01/31)
 # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy
 # use an innocuous value because it will get -g if it's empty
@@ -493,7 +495,7 @@
 CFLAGS		+= $(CFLAGS_BROWSE)
 
 # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7)
-ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1)
   # use ild when debugging (but when optimizing we want reproducible results)
   ILDFLAG = $(ILDFLAG/$(VERSION))
   ILDFLAG/debug     = -xildon
--- a/make/solaris/makefiles/sparcv9.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/sparcv9.make	Wed Nov 12 11:01:31 2008 -0800
@@ -26,7 +26,7 @@
 ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 505), 1)
 # When optimized fully, stubGenerator_sparc.cpp 
 # has bogus code for the routine 
 # StubGenerator::generate_flush_callers_register_windows() 
--- a/make/solaris/makefiles/vm.make	Wed Nov 12 05:42:59 2008 -0800
+++ b/make/solaris/makefiles/vm.make	Wed Nov 12 11:01:31 2008 -0800
@@ -101,7 +101,7 @@
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 # The whole megilla:
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
 # Old Comment: List the libraries in the order the compiler was designed for
 # Not sure what the 'designed for' comment is referring too above.
 #   The order may not be too significant anymore, but I have placed this