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