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