Mercurial > hg > truffle
annotate make/solaris/makefiles/sparcWorks.make @ 204:d6c28083ace6
Merge
author | dcubed |
---|---|
date | Mon, 16 Jun 2008 13:38:17 -0700 |
parents | a49545cab84a |
children | d1605aabd0a1 |
rev | line source |
---|---|
0 | 1 # |
2 # Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. | |
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 := \ | |
44 $(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') | |
45 C_COMPILER_REV := \ | |
46 $(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') | |
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 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
49 ifeq ($(JDK_MINOR_VERSION),6) |
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 # FIXUP: Change to SS12 (5.9) once it has been validated. |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
55 # Validated compiler for JDK7 is SS12 (5.9) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
56 #VALIDATED_COMPILER_REV := 5.9 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
57 #VALIDATED_C_COMPILER_REV := 5.9 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
58 VALIDATED_COMPILER_REV := 5.8 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
59 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
|
60 endif |
0 | 61 |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
62 # Warning messages about not using the above validated version |
0 | 63 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} |
64 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
|
65 dummy_target_to_enforce_compiler_rev:=\ |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
66 $(info WARNING: You are using CC version ${COMPILER_REV} \ |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
67 and should be using version ${ENFORCE_COMPILER_REV}) |
0 | 68 endif |
69 | |
70 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} | |
71 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
|
72 dummy_target_to_enforce_c_compiler_rev:=\ |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
73 $(info WARNING: You are using cc version ${C_COMPILER_REV} \ |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
74 and should be using version ${ENFORCE_C_COMPILER_REV}) |
0 | 75 endif |
76 | |
77 # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 | |
78 # and newer; objects with a dependency on this symbol will not run on older | |
79 # Solaris 8. | |
80 JVM_FAIL_IF_UNDEFINED = __fabsf | |
81 | |
82 JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \ | |
83 $(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \ | |
84 'BEGIN { c=split(f,s); rc=0; } \ | |
85 /:$$/ { file = $$1; } \ | |
86 /[^:]$$/ { for(n=1;n<=c;++n) { \ | |
87 if($$1==s[n]) { \ | |
88 printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \ | |
89 file,$$1); \ | |
90 rc=1; \ | |
91 } \ | |
92 } \ | |
93 } \ | |
94 END { exit rc; }' | |
95 | |
96 LINK_LIB.CC/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1; | |
97 | |
98 # Some interfaces (_lwp_create) changed with LP64 and Solaris 7 | |
99 SOLARIS_7_OR_LATER := \ | |
100 $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }') | |
101 CFLAGS += ${SOLARIS_7_OR_LATER} | |
102 | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
103 # 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
|
104 # The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as. |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
105 # Note: SS12 default for 32bit sparc is now the same as v8plus, so the |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
106 # settings below have changed all SS12 32bit sparc builds to be v8plus. |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
107 # The older SS11 (5.8) settings have remained as they always have been. |
0 | 108 ifeq ($(TYPE),COMPILER2) |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
109 ARCHFLAG_OLD/sparc = -xarch=v8plus |
0 | 110 else |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
111 ifeq ($(TYPE),TIERED) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
112 ARCHFLAG_OLD/sparc = -xarch=v8plus |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
113 else |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
114 ARCHFLAG_OLD/sparc = -xarch=v8 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
115 endif |
0 | 116 endif |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
117 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
|
118 ARCHFLAG_OLD/sparcv9 = -xarch=v9 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
119 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
|
120 ARCHFLAG_OLD/i486 = |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
121 ARCHFLAG_NEW/i486 = -m32 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
122 ARCHFLAG_OLD/amd64 = -xarch=amd64 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
123 ARCHFLAG_NEW/amd64 = -m64 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
124 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
125 # Select the ARCHFLAGs and other SS12 (5.9) options |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
126 ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
127 ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
128 ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
129 ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
130 ARCHFLAG/amd64 = $(ARCHFLAG_NEW/amd64) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
131 else |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
132 ARCHFLAG/sparc = $(ARCHFLAG_OLD/sparc) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
133 ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
134 ARCHFLAG/i486 = $(ARCHFLAG_OLD/i486) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
135 ARCHFLAG/amd64 = $(ARCHFLAG_OLD/amd64) |
0 | 136 endif |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
137 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
138 # 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
|
139 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
140 AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH)) |
0 | 141 |
142 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. | |
143 ISA_DIR=$(ISA_DIR/$(BUILDARCH)) | |
144 ISA_DIR/sparcv9=/sparcv9 | |
145 ISA_DIR/amd64=/amd64 | |
146 | |
147 # Use these to work around compiler bugs: | |
148 OPT_CFLAGS/SLOWER=-xO3 | |
149 OPT_CFLAGS/O2=-xO2 | |
150 OPT_CFLAGS/NOOPT=-xO1 | |
151 | |
152 ################################################# | |
153 # Begin current (>=5.6) Forte compiler options # | |
154 ################################################# | |
155 | |
156 ifeq ($(shell expr $(COMPILER_REV) \>= 5.6), 1) | |
157 | |
158 ifeq ("${Platform_arch}", "sparc") | |
159 | |
160 # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s) | |
161 ifndef LP64 | |
162 CFLAGS += -xmemalign=4s | |
163 endif | |
164 | |
165 endif | |
166 | |
167 endif | |
168 | |
169 ################################################# | |
170 # Begin current (>=5.5) Forte compiler options # | |
171 ################################################# | |
172 | |
173 ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) | |
174 | |
175 CFLAGS += $(ARCHFLAG) | |
176 AOUT_FLAGS += $(ARCHFLAG) | |
177 LIB_FLAGS += $(ARCHFLAG) | |
178 LFLAGS += $(ARCHFLAG) | |
179 | |
180 ifeq ("${Platform_arch}", "sparc") | |
181 | |
182 # Flags for Optimization | |
183 | |
184 # [phh] Commented out pending verification that we do indeed want | |
185 # to potentially bias against u1 and u3 targets. | |
186 #CFLAGS += -xchip=ultra2 | |
187 | |
188 OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) | |
189 | |
190 endif # sparc | |
191 | |
192 ifeq ("${Platform_arch_model}", "x86_32") | |
193 | |
194 OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) | |
195 | |
196 # UBE (CC 5.5) has bug 4923569 with -xO4 | |
197 OPT_CFLAGS+=-xO3 | |
198 | |
199 endif # 32bit x86 | |
200 | |
201 ifeq ("${Platform_arch_model}", "x86_64") | |
202 | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
203 ASFLAGS += $(AS_ARCHFLAG) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
204 CFLAGS += $(ARCHFLAG/amd64) |
0 | 205 # this one seemed useless |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
206 LFLAGS_VM += $(ARCHFLAG/amd64) |
0 | 207 # this one worked |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
208 LFLAGS += $(ARCHFLAG/amd64) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
209 AOUT_FLAGS += $(ARCHFLAG/amd64) |
0 | 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 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
91
diff
changeset
|
222 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
91
diff
changeset
|
223 # 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
|
224 # 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
|
225 # 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
|
226 CFLAGS += -template=no%extdef |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
91
diff
changeset
|
227 |
0 | 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 | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
261 endif # COMPILER_REV >= 5.5 |
0 | 262 |
263 ###################################### | |
264 # End 5.5 Forte compiler options # | |
265 ###################################### | |
266 | |
267 ###################################### | |
268 # Begin 5.2 Forte compiler options # | |
269 ###################################### | |
270 | |
271 ifeq ($(COMPILER_REV), 5.2) | |
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 CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/solaris_sparc.il | |
295 | |
296 endif # sparc | |
297 | |
298 ifeq ("${Platform_arch_model}", "x86_32") | |
299 | |
300 OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) | |
301 | |
302 # SC5.0 tools on x86 are flakey at -xO4 | |
303 # [phh] Is this still true for 6.1? | |
304 OPT_CFLAGS+=-xO3 | |
305 | |
306 CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il | |
307 | |
308 endif # 32bit x86 | |
309 | |
310 # no more exceptions | |
311 CFLAGS/NOEX=-noex | |
312 | |
313 # Reduce code bloat by reverting back to 5.0 behavior for static initializers | |
314 CFLAGS += -Qoption ccfe -one_static_init | |
315 | |
316 # PIC is safer for SPARC, and is considerably slower | |
317 # a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC" | |
318 PICFLAG = -KPIC | |
319 PICFLAG/DEFAULT = $(PICFLAG) | |
320 # [RGV] Need to figure which files to remove to get link to work | |
321 #PICFLAG/BETTER = -pic | |
322 PICFLAG/BETTER = $(PICFLAG/DEFAULT) | |
323 PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) | |
324 | |
325 # Would be better if these weren't needed, since we link with CC, but | |
326 # at present removing them causes run-time errors | |
327 LFLAGS += -library=Crun | |
328 LIBS += -library=Crun -lCrun | |
329 | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
330 endif # COMPILER_REV == 5.2 |
0 | 331 |
332 ################################## | |
333 # End 5.2 Forte compiler options # | |
334 ################################## | |
335 | |
336 ################################## | |
337 # Begin old 5.1 compiler options # | |
338 ################################## | |
339 ifeq ($(COMPILER_REV), 5.1) | |
340 | |
341 _JUNK_ := $(shell echo >&2 \ | |
342 "*** ERROR: sparkWorks.make incomplete for 5.1 compiler") | |
343 @exit 1 | |
344 endif | |
345 ################################## | |
346 # End old 5.1 compiler options # | |
347 ################################## | |
348 | |
349 ################################## | |
350 # Begin old 5.0 compiler options # | |
351 ################################## | |
352 | |
353 ifeq (${COMPILER_REV}, 5.0) | |
354 | |
355 # Had to hoist this higher apparently because of other changes. Must | |
356 # come before -xarch specification. | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
357 # NOTE: native says optimize for the machine doing the compile, bad news. |
0 | 358 CFLAGS += -xtarget=native |
359 | |
360 CFLAGS += $(ARCHFLAG) | |
361 AOUT_FLAGS += $(ARCHFLAG) | |
362 LIB_FLAGS += $(ARCHFLAG) | |
363 LFLAGS += $(ARCHFLAG) | |
364 | |
365 CFLAGS += -library=iostream | |
366 LFLAGS += -library=iostream -library=Crun | |
367 LIBS += -library=iostream -library=Crun -lCrun | |
368 | |
369 # Flags for Optimization | |
370 ifdef LP64 | |
371 # SC5.0 tools on v9 are flakey at -xO4 | |
372 OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS) | |
373 else | |
374 OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) | |
375 endif | |
376 | |
377 ifeq ("${Platform_arch}", "sparc") | |
378 | |
379 CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.il | |
380 | |
381 endif # sparc | |
382 | |
383 ifeq ("${Platform_arch_model}", "x86_32") | |
384 OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) | |
385 ifeq ("${COMPILER_REV}", "5.0") | |
386 # SC5.0 tools on x86 are flakey at -xO4 | |
387 OPT_CFLAGS+=-xO3 | |
388 else | |
389 OPT_CFLAGS+=-xO4 | |
390 endif | |
391 | |
392 CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il | |
393 | |
394 endif # 32bit x86 | |
395 | |
396 # 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
|
397 #OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra |
0 | 398 |
399 # no more exceptions | |
400 CFLAGS/NOEX=-noex | |
401 | |
402 # PIC is safer for SPARC, and is considerably slower | |
403 # a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC" | |
404 PICFLAG = -PIC | |
405 PICFLAG/DEFAULT = $(PICFLAG) | |
406 # [RGV] Need to figure which files to remove to get link to work | |
407 #PICFLAG/BETTER = -pic | |
408 PICFLAG/BETTER = $(PICFLAG/DEFAULT) | |
409 PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) | |
410 | |
411 endif # COMPILER_REV = 5.0 | |
412 | |
413 ################################ | |
414 # End old 5.0 compiler options # | |
415 ################################ | |
416 | |
417 ifeq ("${COMPILER_REV}", "4.2") | |
418 # 4.2 COMPILERS SHOULD NO LONGER BE USED | |
419 _JUNK_ := $(shell echo >&2 \ | |
420 "*** ERROR: SC4.2 compilers are not supported by this code base!") | |
421 @exit 1 | |
422 endif | |
423 | |
424 # do not include shared lib path in a.outs | |
425 AOUT_FLAGS += -norunpath | |
426 LFLAGS_VM = -norunpath -z noversion | |
427 | |
428 # need position-indep-code for shared libraries | |
429 # (ild appears to get errors on PIC code, so we'll try non-PIC for debug) | |
430 ifeq ($(PICFLAGS),DEFAULT) | |
431 VM_PICFLAG/LIBJVM = $(PICFLAG/DEFAULT) | |
432 else | |
433 VM_PICFLAG/LIBJVM = $(PICFLAG/BYFILE) | |
434 endif | |
435 VM_PICFLAG/AOUT = | |
436 | |
437 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) | |
438 CFLAGS += $(VM_PICFLAG) | |
439 | |
440 # less dynamic linking (no PLTs, please) | |
441 #LIB_FLAGS += $(LINK_MODE) | |
442 # %%%%% despite -znodefs, -Bsymbolic gets link errors -- Rose | |
443 | |
444 LINK_MODE = $(LINK_MODE/$(VERSION)) | |
445 LINK_MODE/debug = | |
446 LINK_MODE/optimized = -Bsymbolic -znodefs | |
447 | |
448 # Have thread local errnos | |
449 ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) | |
450 CFLAGS += -mt | |
451 else | |
452 CFLAGS += -D_REENTRANT | |
453 endif | |
454 | |
455 ifdef CC_INTERP | |
456 # C++ Interpreter | |
457 CFLAGS += -DCC_INTERP | |
458 endif | |
459 | |
460 # Flags for Debugging | |
461 DEBUG_CFLAGS = -g | |
462 FASTDEBUG_CFLAGS = -g0 | |
463 # The -g0 setting allows the C++ frontend to inline, which is a big win. | |
464 | |
158
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
465 # Special global options for SS12 |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
466 ifeq ($(COMPILER_REV),5.9) |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
467 # 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
|
468 # 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
|
469 # 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
|
470 # 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
|
471 CFLAGS += -xdebugformat=stabs |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
472 endif |
a49545cab84a
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
113
diff
changeset
|
473 |
0 | 474 # Enable the following CFLAGS additions if you need to compare the |
475 # built ELF objects. | |
476 # | |
477 # The -g option makes static data global and the "-Qoption ccfe | |
478 # -xglobalstatic" option tells the compiler to not globalize static | |
479 # data using a unique globalization prefix. Instead force the use of | |
480 # a static globalization prefix based on the source filepath so the | |
481 # objects from two identical compilations are the same. | |
482 #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic | |
483 #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic | |
484 | |
485 ifeq (${COMPILER_REV}, 5.2) | |
486 COMPILER_DATE := $(shell $(CPP) -V 2>&1 | awk '{ print $$NF; }') | |
487 ifeq (${COMPILER_DATE}, 2001/01/31) | |
488 # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy | |
489 # use an innocuous value because it will get -g if it's empty | |
490 FASTDEBUG_CFLAGS = -c | |
491 endif | |
492 endif | |
493 | |
494 # Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information. | |
495 # CFLAGS_BROWSE = -sbfast | |
496 CFLAGS += $(CFLAGS_BROWSE) | |
497 | |
498 # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7) | |
499 ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1) | |
500 # use ild when debugging (but when optimizing we want reproducible results) | |
501 ILDFLAG = $(ILDFLAG/$(VERSION)) | |
502 ILDFLAG/debug = -xildon | |
503 ILDFLAG/optimized = | |
504 AOUT_FLAGS += $(ILDFLAG) | |
505 endif | |
506 | |
507 # Where to put the *.o files (a.out, or shared library)? | |
508 LINK_INTO = $(LINK_INTO/$(VERSION)) | |
509 LINK_INTO/debug = LIBJVM | |
510 LINK_INTO/optimized = LIBJVM | |
511 | |
512 # We link the debug version into the a.out because: | |
513 # 1. ild works on a.out but not shared libraries, and using ild | |
514 # can cut rebuild times by 25% for small changes. (ILD is gone in SS11) | |
515 # 2. dbx cannot gracefully set breakpoints in shared libraries | |
516 # | |
517 | |
518 # apply this setting to link into the shared library even in the debug version: | |
519 ifdef LP64 | |
520 LINK_INTO = LIBJVM | |
521 else | |
522 #LINK_INTO = LIBJVM | |
523 endif | |
524 | |
525 MCS = /usr/ccs/bin/mcs | |
526 STRIP = /usr/ccs/bin/strip | |
527 | |
528 # Solaris platforms collect lots of redundant file-ident lines, | |
529 # to the point of wasting a significant percentage of file space. | |
530 # (The text is stored in ELF .comment sections, contributed by | |
531 # all "#pragma ident" directives in header and source files.) | |
532 # This command "compresses" the .comment sections simply by | |
533 # removing repeated lines. The data can be extracted from | |
534 # binaries in the field by using "mcs -p libjvm.so" or the older | |
535 # command "what libjvm.so". | |
536 LINK_LIB.CC/POST_HOOK += $(MCS) -c $@ || exit 1; | |
537 # (The exit 1 is necessary to cause a build failure if the command fails and | |
538 # multiple commands are strung together, and the final semicolon is necessary | |
539 # since the hook must terminate itself as a valid command.) | |
540 | |
541 # Also, strip debug and line number information (worth about 1.7Mb). | |
542 STRIP_LIB.CC/POST_HOOK = $(STRIP) -x $@ || exit 1; | |
543 # STRIP_LIB.CC/POST_HOOK is incorporated into LINK_LIB.CC/POST_HOOK | |
544 # in certain configurations, such as product.make. Other configurations, | |
545 # such as debug.make, do not include the strip operation. |