hotspot/make/solaris/makefiles/sparcWorks.make
author ohair
Thu, 14 Aug 2008 11:18:53 -0700
changeset 986 04a2ec0a9ef5
parent 670 ddf3e9583f2f
child 1549 710f8deef989
permissions -rw-r--r--
6724668: Hotspot: Official change to Sun Studio 12 compilers on Solaris Summary: Moving to SS12. Builds with SS11 still work, the compiler comes from your PATH when building hotspot. Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
670
ddf3e9583f2f 6719955: Update copyright year
xdono
parents: 584
diff changeset
     2
# Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Compiler-specific flags for sparcworks.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
# tell make which C and C++ compilers to use
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
CC	= cc
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
CPP	= CC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    31
# Note that this 'as' is an older version of the Sun Studio 'fbe', and will
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    32
#   use the older style options. The 'fbe' options will match 'cc' and 'CC'.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
AS	= /usr/ccs/bin/as
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
NM	= /usr/ccs/bin/nm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
NAWK    = /bin/nawk
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
REORDER_FLAG = -xF
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
# Check for the versions of C++ and C compilers ($CPP and $CC) used. 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
# Get the last thing on the line that looks like x.x+ (x is a digit).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
COMPILER_REV := \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
$(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/')
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
C_COMPILER_REV := \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
$(shell $(CC) -V 2>&1 | grep -i "cc:" |  sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/')
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    48
# Pick which compiler is validated
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    49
ifeq ($(JDK_MINOR_VERSION),6)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    50
  # Validated compiler for JDK6 is SS11 (5.8)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    51
  VALIDATED_COMPILER_REV   := 5.8
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    52
  VALIDATED_C_COMPILER_REV := 5.8
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    53
else
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    54
  # Validated compiler for JDK7 is SS12 (5.9)
986
04a2ec0a9ef5 6724668: Hotspot: Official change to Sun Studio 12 compilers on Solaris
ohair
parents: 670
diff changeset
    55
  VALIDATED_COMPILER_REV   := 5.9
04a2ec0a9ef5 6724668: Hotspot: Official change to Sun Studio 12 compilers on Solaris
ohair
parents: 670
diff changeset
    56
  VALIDATED_C_COMPILER_REV := 5.9
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    57
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    59
# Warning messages about not using the above validated version
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV})
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    62
dummy_target_to_enforce_compiler_rev:=\
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    63
$(info WARNING: You are using CC version ${COMPILER_REV} \
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    64
and should be using version ${ENFORCE_COMPILER_REV})
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV})
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    69
dummy_target_to_enforce_c_compiler_rev:=\
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    70
$(info WARNING: You are using cc version ${C_COMPILER_REV} \
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
    71
and should be using version ${ENFORCE_C_COMPILER_REV})
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
# Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
# and newer; objects with a dependency on this symbol will not run on older
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
# Solaris 8.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
JVM_FAIL_IF_UNDEFINED = __fabsf
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
	$(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
	     'BEGIN    { c=split(f,s); rc=0; } \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
	      /:$$/     { file = $$1; } \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
	      /[^:]$$/  { for(n=1;n<=c;++n) { \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
			   if($$1==s[n]) { \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
			     printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
				    file,$$1); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
			     rc=1; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
			   } \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
		         } \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
                       } \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
	      END      { exit rc; }'
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
LINK_LIB.CC/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
# Some interfaces (_lwp_create) changed with LP64 and Solaris 7
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
SOLARIS_7_OR_LATER := \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
$(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }')
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
CFLAGS += ${SOLARIS_7_OR_LATER}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   100
# New architecture options started in SS12 (5.9), we need both styles to build.
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   101
#   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   102
#   Note: SS12 default for 32bit sparc is now the same as v8plus, so the
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   103
#         settings below have changed all SS12 32bit sparc builds to be v8plus.
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   104
#         The older SS11 (5.8) settings have remained as they always have been.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
ifeq ($(TYPE),COMPILER2)
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   106
  ARCHFLAG_OLD/sparc   = -xarch=v8plus
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
else
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   108
  ifeq ($(TYPE),TIERED)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   109
    ARCHFLAG_OLD/sparc = -xarch=v8plus
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   110
  else
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   111
    ARCHFLAG_OLD/sparc = -xarch=v8
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   112
  endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
endif
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   114
ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   115
ARCHFLAG_OLD/sparcv9 = -xarch=v9
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   116
ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   117
ARCHFLAG_OLD/i486    =
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   118
ARCHFLAG_NEW/i486    = -m32
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   119
ARCHFLAG_OLD/amd64   = -xarch=amd64
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   120
ARCHFLAG_NEW/amd64   = -m64
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   121
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   122
# Select the ARCHFLAGs and other SS12 (5.9) options
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   123
ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   124
  ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   125
  ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   126
  ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   127
  ARCHFLAG/amd64   = $(ARCHFLAG_NEW/amd64)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   128
else
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   129
  ARCHFLAG/sparc   = $(ARCHFLAG_OLD/sparc)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   130
  ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   131
  ARCHFLAG/i486    = $(ARCHFLAG_OLD/i486)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   132
  ARCHFLAG/amd64   = $(ARCHFLAG_OLD/amd64)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
endif
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   134
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   135
# ARCHFLAGS for the current build arch
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   136
ARCHFLAG    = $(ARCHFLAG/$(BUILDARCH))
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   137
AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH))
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
# Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
ISA_DIR=$(ISA_DIR/$(BUILDARCH))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
ISA_DIR/sparcv9=/sparcv9
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
ISA_DIR/amd64=/amd64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
# Use these to work around compiler bugs:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
OPT_CFLAGS/SLOWER=-xO3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
OPT_CFLAGS/O2=-xO2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
OPT_CFLAGS/NOOPT=-xO1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
#################################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
# Begin current (>=5.6) Forte compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
#################################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
ifeq ($(shell expr $(COMPILER_REV) \>= 5.6), 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
ifeq ("${Platform_arch}", "sparc")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
# We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
ifndef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
CFLAGS += -xmemalign=4s
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
#################################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
# Begin current (>=5.5) Forte compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
#################################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
CFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
AOUT_FLAGS += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
LIB_FLAGS  += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
LFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
ifeq ("${Platform_arch}", "sparc")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
# Flags for Optimization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
# [phh] Commented out pending verification that we do indeed want
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
#       to potentially bias against u1 and u3 targets.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
#CFLAGS += -xchip=ultra2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
endif # sparc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
ifeq ("${Platform_arch_model}", "x86_32")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
# UBE (CC 5.5) has bug 4923569 with -xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
OPT_CFLAGS+=-xO3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
endif # 32bit x86
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
ifeq ("${Platform_arch_model}", "x86_64")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   200
ASFLAGS += $(AS_ARCHFLAG)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   201
CFLAGS  += $(ARCHFLAG/amd64)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
# this one seemed useless
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   203
LFLAGS_VM  += $(ARCHFLAG/amd64)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
# this one worked
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   205
LFLAGS  += $(ARCHFLAG/amd64)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   206
AOUT_FLAGS += $(ARCHFLAG/amd64)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
# -xO3 is faster than -xO4 on specjbb with SS10 compiler
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
endif # 64bit x86
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
# Inline functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
# no more exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
CFLAGS/NOEX=-features=no%except
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   219
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   220
# avoid compilation problems arising from fact that C++ compiler tries 
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   221
# to search for external template definition by just compiling additional
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   222
# source files in th same context
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   223
CFLAGS +=  -template=no%extdef
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 338
diff changeset
   224
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
# Reduce code bloat by reverting back to 5.0 behavior for static initializers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
CFLAGS += -features=no%split_init
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
# Use -D_Crun_inline_placement so we don't get references to 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
#    __1c2n6FIpv_0_ or   void*operator new(unsigned,void*)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
#  This avoids the hard requirement of the newer Solaris C++ runtime patches.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
#  NOTE: This is an undocumented feature of the SS10 compiler. See 6306698.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
CFLAGS += -D_Crun_inline_placement
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
# PIC is safer for SPARC, and is considerably slower
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
PICFLAG         = -KPIC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
PICFLAG/DEFAULT = $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
# [RGV] Need to figure which files to remove to get link to work
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
#PICFLAG/BETTER  = -pic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
MAPFLAG = -M FILENAME
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
SONAMEFLAG = -h SONAME
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
# Build shared library
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
SHARED_FLAG = -G
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
# We don't need libCstd.so and librwtools7.so, only libCrun.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
CFLAGS += -library=%none
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
LFLAGS += -library=%none
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
LFLAGS += -mt
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   258
endif	# COMPILER_REV >= 5.5
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
######################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
# End 5.5 Forte compiler options     #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
######################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
######################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
# Begin 5.2 Forte compiler options   #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
######################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
ifeq ($(COMPILER_REV), 5.2)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
CFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
AOUT_FLAGS += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
LIB_FLAGS  += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
LFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
ifeq ("${Platform_arch}", "sparc")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
# Flags for Optimization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
# [phh] Commented out pending verification that we do indeed want
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
#       to potentially bias against u1 and u3 targets.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
#CFLAGS += -xchip=ultra2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
# SC5.0 tools on v9 are flakey at -xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
# [phh] Is this still true for 6.1?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/solaris_sparc.il
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
endif # sparc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
ifeq ("${Platform_arch_model}", "x86_32")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
# SC5.0 tools on x86 are flakey at -xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
# [phh] Is this still true for 6.1?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
OPT_CFLAGS+=-xO3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
endif # 32bit x86
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
# no more exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
CFLAGS/NOEX=-noex
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
# Reduce code bloat by reverting back to 5.0 behavior for static initializers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
CFLAGS += -Qoption ccfe -one_static_init
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
# PIC is safer for SPARC, and is considerably slower
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
PICFLAG         = -KPIC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
PICFLAG/DEFAULT = $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
# [RGV] Need to figure which files to remove to get link to work
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
#PICFLAG/BETTER  = -pic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
# Would be better if these weren't needed, since we link with CC, but
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
# at present removing them causes run-time errors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
LFLAGS += -library=Crun
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
LIBS   += -library=Crun -lCrun
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   327
endif	# COMPILER_REV == 5.2
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
# End 5.2 Forte compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
# Begin old 5.1 compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
ifeq ($(COMPILER_REV), 5.1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
_JUNK_ := $(shell echo >&2 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
       "*** ERROR: sparkWorks.make incomplete for 5.1 compiler")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
	@exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
# End old 5.1 compiler options   #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
# Begin old 5.0 compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
##################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
ifeq	(${COMPILER_REV}, 5.0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
# Had to hoist this higher apparently because of other changes. Must
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
# come before -xarch specification.
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   354
#  NOTE: native says optimize for the machine doing the compile, bad news.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
CFLAGS += -xtarget=native
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
CFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
AOUT_FLAGS += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
LIB_FLAGS  += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
LFLAGS     += $(ARCHFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
CFLAGS += -library=iostream
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
LFLAGS += -library=iostream  -library=Crun
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
LIBS += -library=iostream -library=Crun -lCrun
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
# Flags for Optimization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
# SC5.0 tools on v9 are flakey at -xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
ifeq ("${Platform_arch}", "sparc")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.il
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
endif # sparc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
ifeq ("${Platform_arch_model}", "x86_32")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
ifeq ("${COMPILER_REV}", "5.0")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
# SC5.0 tools on x86 are flakey at -xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
OPT_CFLAGS+=-xO3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
OPT_CFLAGS+=-xO4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
endif  # 32bit x86
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
# The following options run into misaligned ldd problem (raj)
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   394
#OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
# no more exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
CFLAGS/NOEX=-noex
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
# PIC is safer for SPARC, and is considerably slower
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
PICFLAG         = -PIC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
PICFLAG/DEFAULT = $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
# [RGV] Need to figure which files to remove to get link to work
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
#PICFLAG/BETTER  = -pic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
endif	# COMPILER_REV = 5.0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
# End old 5.0 compiler options #
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
################################
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
ifeq ("${COMPILER_REV}", "4.2")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
# 4.2 COMPILERS SHOULD NO LONGER BE USED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
_JUNK_ := $(shell echo >&2 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
       "*** ERROR: SC4.2 compilers are not supported by this code base!")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
	@exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
# do not include shared lib path in a.outs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
AOUT_FLAGS += -norunpath
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
LFLAGS_VM = -norunpath -z noversion
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
# need position-indep-code for shared libraries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
# (ild appears to get errors on PIC code, so we'll try non-PIC for debug)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
ifeq ($(PICFLAGS),DEFAULT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
VM_PICFLAG/LIBJVM  = $(PICFLAG/DEFAULT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
VM_PICFLAG/LIBJVM  = $(PICFLAG/BYFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
VM_PICFLAG/AOUT    =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
CFLAGS += $(VM_PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
# less dynamic linking (no PLTs, please)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
#LIB_FLAGS += $(LINK_MODE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
# %%%%% despite -znodefs, -Bsymbolic gets link errors -- Rose
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
LINK_MODE = $(LINK_MODE/$(VERSION))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
LINK_MODE/debug     =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
LINK_MODE/optimized = -Bsymbolic -znodefs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
# Have thread local errnos
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
CFLAGS += -mt
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
CFLAGS += -D_REENTRANT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
ifdef CC_INTERP
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
# C++ Interpreter
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
CFLAGS += -DCC_INTERP
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
# Flags for Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
DEBUG_CFLAGS = -g
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
FASTDEBUG_CFLAGS = -g0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
# The -g0 setting allows the C++ frontend to inline, which is a big win.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
584
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   462
# Special global options for SS12
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   463
ifeq ($(COMPILER_REV),5.9)
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   464
  # There appears to be multiple issues with the new Dwarf2 debug format, so
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   465
  #   we tell the compiler to use the older 'stabs' debug format all the time.
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   466
  #   Note that this needs to be used in optimized compiles too to be 100%.
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   467
  #   This is a workaround for SS12 (5.9) bug 6694600
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   468
  CFLAGS += -xdebugformat=stabs
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   469
endif
02175b2b64e6 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 360
diff changeset
   470
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
# Enable the following CFLAGS additions if you need to compare the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
# built ELF objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
# The -g option makes static data global and the "-Qoption ccfe
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
# -xglobalstatic" option tells the compiler to not globalize static
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
# data using a unique globalization prefix. Instead force the use of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
# a static globalization prefix based on the source filepath so the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
# objects from two identical compilations are the same.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
#DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
#FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
ifeq	(${COMPILER_REV}, 5.2)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
COMPILER_DATE := $(shell $(CPP) -V 2>&1 | awk '{ print $$NF; }')
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
ifeq	(${COMPILER_DATE}, 2001/01/31)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
# disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
# use an innocuous value because it will get -g if it's empty
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
FASTDEBUG_CFLAGS = -c
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
# Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
# CFLAGS_BROWSE	= -sbfast
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
CFLAGS		+= $(CFLAGS_BROWSE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
# ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  # use ild when debugging (but when optimizing we want reproducible results)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  ILDFLAG = $(ILDFLAG/$(VERSION))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  ILDFLAG/debug     = -xildon
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
  ILDFLAG/optimized =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
  AOUT_FLAGS += $(ILDFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
# Where to put the *.o files (a.out, or shared library)?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
LINK_INTO = $(LINK_INTO/$(VERSION))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
LINK_INTO/debug = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
LINK_INTO/optimized = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
# We link the debug version into the a.out because:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
#  1. ild works on a.out but not shared libraries, and using ild
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
#     can cut rebuild times by 25% for small changes. (ILD is gone in SS11)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
#  2. dbx cannot gracefully set breakpoints in shared libraries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
# apply this setting to link into the shared library even in the debug version:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
LINK_INTO = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
#LINK_INTO = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
MCS	= /usr/ccs/bin/mcs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
STRIP	= /usr/ccs/bin/strip
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
# Solaris platforms collect lots of redundant file-ident lines,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
# to the point of wasting a significant percentage of file space.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
# (The text is stored in ELF .comment sections, contributed by
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
# all "#pragma ident" directives in header and source files.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
# This command "compresses" the .comment sections simply by
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
# removing repeated lines.  The data can be extracted from
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
# binaries in the field by using "mcs -p libjvm.so" or the older
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
# command "what libjvm.so".
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
LINK_LIB.CC/POST_HOOK += $(MCS) -c $@ || exit 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
# (The exit 1 is necessary to cause a build failure if the command fails and
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
# multiple commands are strung together, and the final semicolon is necessary
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
# since the hook must terminate itself as a valid command.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
# Also, strip debug and line number information (worth about 1.7Mb).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
STRIP_LIB.CC/POST_HOOK = $(STRIP) -x $@ || exit 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
# STRIP_LIB.CC/POST_HOOK is incorporated into LINK_LIB.CC/POST_HOOK
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
# in certain configurations, such as product.make.  Other configurations,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
# such as debug.make, do not include the strip operation.