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