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