41 COMPILER_REV := \ |
43 COMPILER_REV := \ |
42 $(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') |
44 $(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') |
43 C_COMPILER_REV := \ |
45 C_COMPILER_REV := \ |
44 $(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') |
46 $(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') |
45 |
47 |
46 VALIDATED_COMPILER_REV := 5.8 |
48 # Pick which compiler is validated |
47 VALIDATED_C_COMPILER_REV := 5.8 |
49 ifeq ($(JDK_MINOR_VERSION),6) |
48 |
50 # Validated compiler for JDK6 is SS11 (5.8) |
|
51 VALIDATED_COMPILER_REV := 5.8 |
|
52 VALIDATED_C_COMPILER_REV := 5.8 |
|
53 else |
|
54 # FIXUP: Change to SS12 (5.9) once it has been validated. |
|
55 # Validated compiler for JDK7 is SS12 (5.9) |
|
56 #VALIDATED_COMPILER_REV := 5.9 |
|
57 #VALIDATED_C_COMPILER_REV := 5.9 |
|
58 VALIDATED_COMPILER_REV := 5.8 |
|
59 VALIDATED_C_COMPILER_REV := 5.8 |
|
60 endif |
|
61 |
|
62 # Warning messages about not using the above validated version |
49 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} |
63 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} |
50 ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV}) |
64 ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV}) |
51 dummy_target_to_enforce_compiler_rev: |
65 dummy_target_to_enforce_compiler_rev:=\ |
52 @echo "Wrong ${CPP} version: ${COMPILER_REV}. " \ |
66 $(info WARNING: You are using CC version ${COMPILER_REV} \ |
53 "Use version ${ENFORCE_COMPILER_REV}, or set" \ |
67 and should be using version ${ENFORCE_COMPILER_REV}) |
54 "ENFORCE_COMPILER_REV=${COMPILER_REV}." |
|
55 @exit 1 |
|
56 endif |
68 endif |
57 |
69 |
58 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} |
70 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} |
59 ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV}) |
71 ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV}) |
60 dummy_target_to_enforce_c_compiler_rev: |
72 dummy_target_to_enforce_c_compiler_rev:=\ |
61 @echo "Wrong ${CC} version: ${C_COMPILER_REV}. " \ |
73 $(info WARNING: You are using cc version ${C_COMPILER_REV} \ |
62 "Use version ${ENFORCE_C_COMPILER_REV}, or set" \ |
74 and should be using version ${ENFORCE_C_COMPILER_REV}) |
63 "ENFORCE_C_COMPILER_REV=${C_COMPILER_REV}." |
|
64 @exit 1 |
|
65 endif |
75 endif |
66 |
76 |
67 # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 |
77 # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 |
68 # and newer; objects with a dependency on this symbol will not run on older |
78 # and newer; objects with a dependency on this symbol will not run on older |
69 # Solaris 8. |
79 # Solaris 8. |
88 # Some interfaces (_lwp_create) changed with LP64 and Solaris 7 |
98 # Some interfaces (_lwp_create) changed with LP64 and Solaris 7 |
89 SOLARIS_7_OR_LATER := \ |
99 SOLARIS_7_OR_LATER := \ |
90 $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }') |
100 $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }') |
91 CFLAGS += ${SOLARIS_7_OR_LATER} |
101 CFLAGS += ${SOLARIS_7_OR_LATER} |
92 |
102 |
93 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) |
103 # New architecture options started in SS12 (5.9), we need both styles to build. |
94 # set ARCHFLAG/BUILDARCH which will ultimately be ARCHFLAG |
104 # The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as. |
|
105 # Note: SS12 default for 32bit sparc is now the same as v8plus, so the |
|
106 # settings below have changed all SS12 32bit sparc builds to be v8plus. |
|
107 # The older SS11 (5.8) settings have remained as they always have been. |
95 ifeq ($(TYPE),COMPILER2) |
108 ifeq ($(TYPE),COMPILER2) |
96 ARCHFLAG/sparc = -xarch=v8plus |
109 ARCHFLAG_OLD/sparc = -xarch=v8plus |
97 else |
110 else |
98 ifeq ($(TYPE),TIERED) |
111 ifeq ($(TYPE),TIERED) |
99 ARCHFLAG/sparc = -xarch=v8plus |
112 ARCHFLAG_OLD/sparc = -xarch=v8plus |
100 else |
113 else |
101 ARCHFLAG/sparc = -xarch=v8 |
114 ARCHFLAG_OLD/sparc = -xarch=v8 |
102 endif |
115 endif |
103 endif |
116 endif |
104 ARCHFLAG/sparcv9 = -xarch=v9 |
117 ARCHFLAG_NEW/sparc = -m32 -xarch=sparc |
105 ARCHFLAG/i486 = |
118 ARCHFLAG_OLD/sparcv9 = -xarch=v9 |
106 ARCHFLAG/amd64 = -xarch=amd64 |
119 ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc |
|
120 ARCHFLAG_OLD/i486 = |
|
121 ARCHFLAG_NEW/i486 = -m32 |
|
122 ARCHFLAG_OLD/amd64 = -xarch=amd64 |
|
123 ARCHFLAG_NEW/amd64 = -m64 |
|
124 |
|
125 # Select the ARCHFLAGs and other SS12 (5.9) options |
|
126 ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1) |
|
127 ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) |
|
128 ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) |
|
129 ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) |
|
130 ARCHFLAG/amd64 = $(ARCHFLAG_NEW/amd64) |
|
131 else |
|
132 ARCHFLAG/sparc = $(ARCHFLAG_OLD/sparc) |
|
133 ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9) |
|
134 ARCHFLAG/i486 = $(ARCHFLAG_OLD/i486) |
|
135 ARCHFLAG/amd64 = $(ARCHFLAG_OLD/amd64) |
|
136 endif |
|
137 |
|
138 # ARCHFLAGS for the current build arch |
|
139 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) |
|
140 AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH)) |
107 |
141 |
108 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. |
142 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. |
109 ISA_DIR=$(ISA_DIR/$(BUILDARCH)) |
143 ISA_DIR=$(ISA_DIR/$(BUILDARCH)) |
110 ISA_DIR/sparcv9=/sparcv9 |
144 ISA_DIR/sparcv9=/sparcv9 |
111 ISA_DIR/amd64=/amd64 |
145 ISA_DIR/amd64=/amd64 |
164 |
198 |
165 endif # 32bit x86 |
199 endif # 32bit x86 |
166 |
200 |
167 ifeq ("${Platform_arch_model}", "x86_64") |
201 ifeq ("${Platform_arch_model}", "x86_64") |
168 |
202 |
169 ASFLAGS += -xarch=amd64 |
203 ASFLAGS += $(AS_ARCHFLAG) |
170 CFLAGS += -xarch=amd64 |
204 CFLAGS += $(ARCHFLAG/amd64) |
171 # this one seemed useless |
205 # this one seemed useless |
172 LFLAGS_VM += -xarch=amd64 |
206 LFLAGS_VM += $(ARCHFLAG/amd64) |
173 # this one worked |
207 # this one worked |
174 LFLAGS += -xarch=amd64 |
208 LFLAGS += $(ARCHFLAG/amd64) |
175 AOUT_FLAGS += -xarch=amd64 |
209 AOUT_FLAGS += $(ARCHFLAG/amd64) |
176 |
210 |
177 # -xO3 is faster than -xO4 on specjbb with SS10 compiler |
211 # -xO3 is faster than -xO4 on specjbb with SS10 compiler |
178 OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) |
212 OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) |
179 |
213 |
180 endif # 64bit x86 |
214 endif # 64bit x86 |
222 CFLAGS += -library=%none |
256 CFLAGS += -library=%none |
223 LFLAGS += -library=%none |
257 LFLAGS += -library=%none |
224 |
258 |
225 LFLAGS += -mt |
259 LFLAGS += -mt |
226 |
260 |
227 endif # COMPILER_REV >= VALIDATED_COMPILER_REV |
261 endif # COMPILER_REV >= 5.5 |
228 |
262 |
229 ###################################### |
263 ###################################### |
230 # End 5.5 Forte compiler options # |
264 # End 5.5 Forte compiler options # |
231 ###################################### |
265 ###################################### |
232 |
266 |
291 # Would be better if these weren't needed, since we link with CC, but |
325 # Would be better if these weren't needed, since we link with CC, but |
292 # at present removing them causes run-time errors |
326 # at present removing them causes run-time errors |
293 LFLAGS += -library=Crun |
327 LFLAGS += -library=Crun |
294 LIBS += -library=Crun -lCrun |
328 LIBS += -library=Crun -lCrun |
295 |
329 |
296 endif # COMPILER_REV >= VALIDATED_COMPILER_REV |
330 endif # COMPILER_REV == 5.2 |
297 |
331 |
298 ################################## |
332 ################################## |
299 # End 5.2 Forte compiler options # |
333 # End 5.2 Forte compiler options # |
300 ################################## |
334 ################################## |
301 |
335 |
318 |
352 |
319 ifeq (${COMPILER_REV}, 5.0) |
353 ifeq (${COMPILER_REV}, 5.0) |
320 |
354 |
321 # Had to hoist this higher apparently because of other changes. Must |
355 # Had to hoist this higher apparently because of other changes. Must |
322 # come before -xarch specification. |
356 # come before -xarch specification. |
|
357 # NOTE: native says optimize for the machine doing the compile, bad news. |
323 CFLAGS += -xtarget=native |
358 CFLAGS += -xtarget=native |
324 |
359 |
325 CFLAGS += $(ARCHFLAG) |
360 CFLAGS += $(ARCHFLAG) |
326 AOUT_FLAGS += $(ARCHFLAG) |
361 AOUT_FLAGS += $(ARCHFLAG) |
327 LIB_FLAGS += $(ARCHFLAG) |
362 LIB_FLAGS += $(ARCHFLAG) |
424 |
459 |
425 # Flags for Debugging |
460 # Flags for Debugging |
426 DEBUG_CFLAGS = -g |
461 DEBUG_CFLAGS = -g |
427 FASTDEBUG_CFLAGS = -g0 |
462 FASTDEBUG_CFLAGS = -g0 |
428 # The -g0 setting allows the C++ frontend to inline, which is a big win. |
463 # The -g0 setting allows the C++ frontend to inline, which is a big win. |
|
464 |
|
465 # Special global options for SS12 |
|
466 ifeq ($(COMPILER_REV),5.9) |
|
467 # There appears to be multiple issues with the new Dwarf2 debug format, so |
|
468 # we tell the compiler to use the older 'stabs' debug format all the time. |
|
469 # Note that this needs to be used in optimized compiles too to be 100%. |
|
470 # This is a workaround for SS12 (5.9) bug 6694600 |
|
471 CFLAGS += -xdebugformat=stabs |
|
472 endif |
429 |
473 |
430 # Enable the following CFLAGS additions if you need to compare the |
474 # Enable the following CFLAGS additions if you need to compare the |
431 # built ELF objects. |
475 # built ELF objects. |
432 # |
476 # |
433 # The -g option makes static data global and the "-Qoption ccfe |
477 # The -g option makes static data global and the "-Qoption ccfe |