duke@435: # dcubed@3150: # Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. duke@435: # duke@435: # duke@435: duke@435: # Compiler-specific flags for sparcworks. duke@435: duke@435: # tell make which C and C++ compilers to use duke@435: CC = cc duke@435: CPP = CC duke@435: ohair@593: # Note that this 'as' is an older version of the Sun Studio 'fbe', and will ohair@593: # use the older style options. The 'fbe' options will match 'cc' and 'CC'. duke@435: AS = /usr/ccs/bin/as duke@435: duke@435: NM = /usr/ccs/bin/nm duke@435: NAWK = /bin/nawk duke@435: duke@435: REORDER_FLAG = -xF duke@435: duke@435: # Check for the versions of C++ and C compilers ($CPP and $CC) used. duke@435: duke@435: # Get the last thing on the line that looks like x.x+ (x is a digit). duke@435: COMPILER_REV := \ kvn@865: $(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') duke@435: C_COMPILER_REV := \ kvn@865: $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') duke@435: ohair@593: # Pick which compiler is validated kvn@1159: ifeq ($(JRE_RELEASE_VER),1.6.0) ohair@593: # Validated compiler for JDK6 is SS11 (5.8) jcoomes@1902: VALIDATED_COMPILER_REVS := 5.8 jcoomes@1902: VALIDATED_C_COMPILER_REVS := 5.8 ohair@593: else jcoomes@2189: # Validated compiler for JDK7 is SS12 update 1 + patches (5.10) jcoomes@2189: VALIDATED_COMPILER_REVS := 5.10 jcoomes@2189: VALIDATED_C_COMPILER_REVS := 5.10 ohair@593: endif duke@435: jcoomes@1902: # Warning messages about not using the above validated versions jcoomes@1902: ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := $(strip ${VALIDATED_COMPILER_REVS}) jcoomes@1902: ifeq ($(filter ${ENFORCE_COMPILER_REV},${COMPILER_REV}),) jcoomes@1902: PRINTABLE_CC_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_COMPILER_REV}) jcoomes@1902: dummy_var_to_enforce_compiler_rev := $(shell \ jcoomes@1902: echo >&2 WARNING: You are using CC version ${COMPILER_REV} and \ jcoomes@1902: should be using version ${PRINTABLE_CC_REVS}.; \ jcoomes@1902: echo >&2 Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this \ jcoomes@1902: warning.) duke@435: endif duke@435: jcoomes@1902: ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := $(strip ${VALIDATED_C_COMPILER_REVS}) jcoomes@1902: ifeq ($(filter ${ENFORCE_C_COMPILER_REV},${C_COMPILER_REV}),) jcoomes@1902: PRINTABLE_C_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_C_COMPILER_REV}) jcoomes@1902: dummy_var_to_enforce_c_compiler_rev := $(shell \ jcoomes@1902: echo >&2 WARNING: You are using cc version ${C_COMPILER_REV} and \ jcoomes@1902: should be using version ${PRINTABLE_C_REVS}.; \ jcoomes@1902: echo >&2 Set ENFORCE_C_COMPILER_REV=${C_COMPILER_REV} to avoid this \ jcoomes@1902: warning.) duke@435: endif duke@435: kvn@865: COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }') kvn@865: duke@435: # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 duke@435: # and newer; objects with a dependency on this symbol will not run on older duke@435: # Solaris 8. duke@435: JVM_FAIL_IF_UNDEFINED = __fabsf duke@435: duke@435: JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \ duke@435: $(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \ duke@435: 'BEGIN { c=split(f,s); rc=0; } \ duke@435: /:$$/ { file = $$1; } \ duke@435: /[^:]$$/ { for(n=1;n<=c;++n) { \ duke@435: if($$1==s[n]) { \ duke@435: printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \ duke@435: file,$$1); \ duke@435: rc=1; \ duke@435: } \ duke@435: } \ duke@435: } \ duke@435: END { exit rc; }' duke@435: duke@435: LINK_LIB.CC/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1; duke@435: ohair@593: # New architecture options started in SS12 (5.9), we need both styles to build. ohair@593: # The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as. kvn@1159: # Note: default for 32bit sparc is now the same as v8plus, so the kvn@1159: # settings below have changed all 32bit sparc builds to be v8plus. kvn@1159: ARCHFLAG_OLD/sparc = -xarch=v8plus ohair@593: ARCHFLAG_NEW/sparc = -m32 -xarch=sparc ohair@593: ARCHFLAG_OLD/sparcv9 = -xarch=v9 ohair@593: ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc ohair@593: ARCHFLAG_OLD/i486 = ohair@593: ARCHFLAG_NEW/i486 = -m32 ohair@593: ARCHFLAG_OLD/amd64 = -xarch=amd64 ohair@593: ARCHFLAG_NEW/amd64 = -m64 ohair@593: ohair@593: # Select the ARCHFLAGs and other SS12 (5.9) options kvn@865: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) ohair@593: ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) ohair@593: ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) ohair@593: ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) ohair@593: ARCHFLAG/amd64 = $(ARCHFLAG_NEW/amd64) duke@435: else ohair@593: ARCHFLAG/sparc = $(ARCHFLAG_OLD/sparc) ohair@593: ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9) ohair@593: ARCHFLAG/i486 = $(ARCHFLAG_OLD/i486) ohair@593: ARCHFLAG/amd64 = $(ARCHFLAG_OLD/amd64) duke@435: endif ohair@593: ohair@593: # ARCHFLAGS for the current build arch ohair@593: ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ohair@593: AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH)) duke@435: duke@435: # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. duke@435: ISA_DIR=$(ISA_DIR/$(BUILDARCH)) duke@435: ISA_DIR/sparcv9=/sparcv9 duke@435: ISA_DIR/amd64=/amd64 duke@435: duke@435: # Use these to work around compiler bugs: duke@435: OPT_CFLAGS/SLOWER=-xO3 duke@435: OPT_CFLAGS/O2=-xO2 duke@435: OPT_CFLAGS/NOOPT=-xO1 duke@435: stefank@2314: # Flags for creating the dependency files. stefank@2314: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) stefank@2314: DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d) stefank@2314: endif stefank@2314: stefank@2325: # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. stefank@2325: CFLAGS += -DDONT_USE_PRECOMPILED_HEADER stefank@2325: kvn@3128: # Compiler warnings are treated as errors kvn@3128: CFLAGS_WARN = -xwe kvn@3128: stefank@2314: ################################################ kvn@2042: # Begin current (>=5.9) Forte compiler options # kvn@2042: ################################################# kvn@2042: jcoomes@1902: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) jcoomes@1902: ifeq ($(Platform_arch), x86) jcoomes@1902: OPT_CFLAGS/NO_TAIL_CALL_OPT = -Wu,-O~yz jcoomes@1902: OPT_CCFLAGS/NO_TAIL_CALL_OPT = -Qoption ube -O~yz kvn@2042: OPT_CFLAGS/stubGenerator_x86_32.o = $(OPT_CFLAGS) -xspace kvn@2042: OPT_CFLAGS/stubGenerator_x86_64.o = $(OPT_CFLAGS) -xspace jcoomes@1902: endif # Platform_arch == x86 kvn@2042: ifeq ("${Platform_arch}", "sparc") kvn@2042: OPT_CFLAGS/stubGenerator_sparc.o = $(OPT_CFLAGS) -xspace kvn@2042: endif jcoomes@1902: endif # COMPILER_REV_NUMERIC >= 509 jcoomes@1902: duke@435: ################################################# duke@435: # Begin current (>=5.6) Forte compiler options # duke@435: ################################################# duke@435: kvn@865: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 506), 1) duke@435: duke@435: ifeq ("${Platform_arch}", "sparc") duke@435: duke@435: # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s) duke@435: ifndef LP64 duke@435: CFLAGS += -xmemalign=4s duke@435: endif duke@435: duke@435: endif duke@435: duke@435: endif duke@435: duke@435: ################################################# duke@435: # Begin current (>=5.5) Forte compiler options # duke@435: ################################################# duke@435: kvn@865: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) duke@435: duke@435: CFLAGS += $(ARCHFLAG) duke@435: AOUT_FLAGS += $(ARCHFLAG) duke@435: LIB_FLAGS += $(ARCHFLAG) duke@435: LFLAGS += $(ARCHFLAG) duke@435: duke@435: ifeq ("${Platform_arch}", "sparc") duke@435: duke@435: # Flags for Optimization duke@435: duke@435: # [phh] Commented out pending verification that we do indeed want duke@435: # to potentially bias against u1 and u3 targets. duke@435: #CFLAGS += -xchip=ultra2 duke@435: duke@435: OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) duke@435: duke@435: endif # sparc duke@435: duke@435: ifeq ("${Platform_arch_model}", "x86_32") duke@435: jcoomes@1902: OPT_CFLAGS=-xtarget=pentium -xO4 $(EXTRA_OPT_CFLAGS) duke@435: duke@435: endif # 32bit x86 duke@435: duke@435: ifeq ("${Platform_arch_model}", "x86_64") duke@435: ohair@593: ASFLAGS += $(AS_ARCHFLAG) ohair@593: CFLAGS += $(ARCHFLAG/amd64) duke@435: # this one seemed useless ohair@593: LFLAGS_VM += $(ARCHFLAG/amd64) duke@435: # this one worked ohair@593: LFLAGS += $(ARCHFLAG/amd64) ohair@593: AOUT_FLAGS += $(ARCHFLAG/amd64) duke@435: duke@435: # -xO3 is faster than -xO4 on specjbb with SS10 compiler duke@435: OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) duke@435: duke@435: endif # 64bit x86 duke@435: duke@435: # Inline functions duke@435: CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il duke@435: duke@435: # no more exceptions duke@435: CFLAGS/NOEX=-features=no%except duke@435: coleenp@548: coleenp@548: # avoid compilation problems arising from fact that C++ compiler tries coleenp@548: # to search for external template definition by just compiling additional coleenp@548: # source files in th same context coleenp@548: CFLAGS += -template=no%extdef coleenp@548: duke@435: # Reduce code bloat by reverting back to 5.0 behavior for static initializers duke@435: CFLAGS += -features=no%split_init duke@435: duke@435: # Use -D_Crun_inline_placement so we don't get references to duke@435: # __1c2n6FIpv_0_ or void*operator new(unsigned,void*) duke@435: # This avoids the hard requirement of the newer Solaris C++ runtime patches. duke@435: # NOTE: This is an undocumented feature of the SS10 compiler. See 6306698. duke@435: CFLAGS += -D_Crun_inline_placement duke@435: duke@435: # PIC is safer for SPARC, and is considerably slower duke@435: # a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC" duke@435: PICFLAG = -KPIC duke@435: PICFLAG/DEFAULT = $(PICFLAG) duke@435: # [RGV] Need to figure which files to remove to get link to work duke@435: #PICFLAG/BETTER = -pic duke@435: PICFLAG/BETTER = $(PICFLAG/DEFAULT) duke@435: PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) duke@435: duke@435: # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. duke@435: MAPFLAG = -M FILENAME duke@435: duke@435: # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj duke@435: SONAMEFLAG = -h SONAME duke@435: duke@435: # Build shared library duke@435: SHARED_FLAG = -G duke@435: duke@435: # We don't need libCstd.so and librwtools7.so, only libCrun.so duke@435: CFLAGS += -library=%none duke@435: LFLAGS += -library=%none duke@435: duke@435: LFLAGS += -mt duke@435: kvn@865: endif # COMPILER_REV_NUMERIC >= 505 duke@435: duke@435: ###################################### duke@435: # End 5.5 Forte compiler options # duke@435: ###################################### duke@435: duke@435: ###################################### duke@435: # Begin 5.2 Forte compiler options # duke@435: ###################################### duke@435: kvn@865: ifeq ($(COMPILER_REV_NUMERIC), 502) duke@435: duke@435: CFLAGS += $(ARCHFLAG) duke@435: AOUT_FLAGS += $(ARCHFLAG) duke@435: LIB_FLAGS += $(ARCHFLAG) duke@435: LFLAGS += $(ARCHFLAG) duke@435: duke@435: ifeq ("${Platform_arch}", "sparc") duke@435: duke@435: # Flags for Optimization duke@435: duke@435: # [phh] Commented out pending verification that we do indeed want duke@435: # to potentially bias against u1 and u3 targets. duke@435: #CFLAGS += -xchip=ultra2 duke@435: duke@435: ifdef LP64 duke@435: # SC5.0 tools on v9 are flakey at -xO4 duke@435: # [phh] Is this still true for 6.1? duke@435: OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS) duke@435: else duke@435: OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) duke@435: endif duke@435: duke@435: endif # sparc duke@435: duke@435: ifeq ("${Platform_arch_model}", "x86_32") duke@435: duke@435: OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) duke@435: duke@435: # SC5.0 tools on x86 are flakey at -xO4 duke@435: # [phh] Is this still true for 6.1? duke@435: OPT_CFLAGS+=-xO3 duke@435: duke@435: endif # 32bit x86 duke@435: duke@435: # no more exceptions duke@435: CFLAGS/NOEX=-noex duke@435: phh@1558: # Inline functions phh@1558: CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il phh@1558: duke@435: # Reduce code bloat by reverting back to 5.0 behavior for static initializers duke@435: CFLAGS += -Qoption ccfe -one_static_init duke@435: duke@435: # PIC is safer for SPARC, and is considerably slower duke@435: # a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC" duke@435: PICFLAG = -KPIC duke@435: PICFLAG/DEFAULT = $(PICFLAG) duke@435: # [RGV] Need to figure which files to remove to get link to work duke@435: #PICFLAG/BETTER = -pic duke@435: PICFLAG/BETTER = $(PICFLAG/DEFAULT) duke@435: PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) duke@435: phh@1558: # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. phh@1558: MAPFLAG = -M FILENAME phh@1558: phh@1558: # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj phh@1558: SONAMEFLAG = -h SONAME phh@1558: phh@1558: # Build shared library phh@1558: SHARED_FLAG = -G phh@1558: duke@435: # Would be better if these weren't needed, since we link with CC, but duke@435: # at present removing them causes run-time errors duke@435: LFLAGS += -library=Crun duke@435: LIBS += -library=Crun -lCrun duke@435: kvn@865: endif # COMPILER_REV_NUMERIC == 502 duke@435: duke@435: ################################## duke@435: # End 5.2 Forte compiler options # duke@435: ################################## duke@435: duke@435: ################################## duke@435: # Begin old 5.1 compiler options # duke@435: ################################## kvn@865: ifeq ($(COMPILER_REV_NUMERIC), 501) duke@435: duke@435: _JUNK_ := $(shell echo >&2 \ duke@435: "*** ERROR: sparkWorks.make incomplete for 5.1 compiler") duke@435: @exit 1 duke@435: endif duke@435: ################################## duke@435: # End old 5.1 compiler options # duke@435: ################################## duke@435: duke@435: ################################## duke@435: # Begin old 5.0 compiler options # duke@435: ################################## duke@435: kvn@865: ifeq (${COMPILER_REV_NUMERIC}, 500) duke@435: duke@435: # Had to hoist this higher apparently because of other changes. Must duke@435: # come before -xarch specification. ohair@593: # NOTE: native says optimize for the machine doing the compile, bad news. duke@435: CFLAGS += -xtarget=native duke@435: duke@435: CFLAGS += $(ARCHFLAG) duke@435: AOUT_FLAGS += $(ARCHFLAG) duke@435: LIB_FLAGS += $(ARCHFLAG) duke@435: LFLAGS += $(ARCHFLAG) duke@435: duke@435: CFLAGS += -library=iostream duke@435: LFLAGS += -library=iostream -library=Crun duke@435: LIBS += -library=iostream -library=Crun -lCrun duke@435: duke@435: # Flags for Optimization duke@435: ifdef LP64 duke@435: # SC5.0 tools on v9 are flakey at -xO4 duke@435: OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS) duke@435: else duke@435: OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) duke@435: endif duke@435: duke@435: ifeq ("${Platform_arch}", "sparc") duke@435: duke@435: CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.il duke@435: duke@435: endif # sparc duke@435: duke@435: ifeq ("${Platform_arch_model}", "x86_32") duke@435: OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) kvn@865: ifeq ("${COMPILER_REV_NUMERIC}", "500") duke@435: # SC5.0 tools on x86 are flakey at -xO4 duke@435: OPT_CFLAGS+=-xO3 duke@435: else duke@435: OPT_CFLAGS+=-xO4 duke@435: endif duke@435: duke@435: CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il duke@435: duke@435: endif # 32bit x86 duke@435: duke@435: # The following options run into misaligned ldd problem (raj) ohair@593: #OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra duke@435: duke@435: # no more exceptions duke@435: CFLAGS/NOEX=-noex duke@435: duke@435: # PIC is safer for SPARC, and is considerably slower duke@435: # a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC" duke@435: PICFLAG = -PIC duke@435: PICFLAG/DEFAULT = $(PICFLAG) duke@435: # [RGV] Need to figure which files to remove to get link to work duke@435: #PICFLAG/BETTER = -pic duke@435: PICFLAG/BETTER = $(PICFLAG/DEFAULT) duke@435: PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) duke@435: kvn@865: endif # COMPILER_REV_NUMERIC = 500 duke@435: duke@435: ################################ duke@435: # End old 5.0 compiler options # duke@435: ################################ duke@435: kvn@865: ifeq ("${COMPILER_REV_NUMERIC}", "402") duke@435: # 4.2 COMPILERS SHOULD NO LONGER BE USED duke@435: _JUNK_ := $(shell echo >&2 \ duke@435: "*** ERROR: SC4.2 compilers are not supported by this code base!") duke@435: @exit 1 duke@435: endif duke@435: duke@435: # do not include shared lib path in a.outs duke@435: AOUT_FLAGS += -norunpath duke@435: LFLAGS_VM = -norunpath -z noversion duke@435: duke@435: # need position-indep-code for shared libraries duke@435: # (ild appears to get errors on PIC code, so we'll try non-PIC for debug) duke@435: ifeq ($(PICFLAGS),DEFAULT) duke@435: VM_PICFLAG/LIBJVM = $(PICFLAG/DEFAULT) duke@435: else duke@435: VM_PICFLAG/LIBJVM = $(PICFLAG/BYFILE) duke@435: endif duke@435: VM_PICFLAG/AOUT = duke@435: duke@435: VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) duke@435: CFLAGS += $(VM_PICFLAG) duke@435: duke@435: # less dynamic linking (no PLTs, please) duke@435: #LIB_FLAGS += $(LINK_MODE) duke@435: # %%%%% despite -znodefs, -Bsymbolic gets link errors -- Rose duke@435: duke@435: LINK_MODE = $(LINK_MODE/$(VERSION)) duke@435: LINK_MODE/debug = duke@435: LINK_MODE/optimized = -Bsymbolic -znodefs duke@435: duke@435: # Have thread local errnos kvn@865: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) duke@435: CFLAGS += -mt duke@435: else duke@435: CFLAGS += -D_REENTRANT duke@435: endif duke@435: duke@435: ifdef CC_INTERP duke@435: # C++ Interpreter duke@435: CFLAGS += -DCC_INTERP duke@435: endif duke@435: duke@435: # Flags for Debugging dcubed@3150: # The -g0 setting allows the C++ frontend to inline, which is a big win. dcubed@3150: # The -xs setting disables 'lazy debug info' which puts everything in dcubed@3150: # the .so instead of requiring the '.o' files. dcubed@3150: ifneq ($(OBJCOPY),) dcubed@3150: OPT_CFLAGS += -g0 -xs dcubed@3150: endif duke@435: DEBUG_CFLAGS = -g duke@435: FASTDEBUG_CFLAGS = -g0 dcubed@3150: ifneq ($(OBJCOPY),) dcubed@3150: DEBUG_CFLAGS += -xs dcubed@3150: FASTDEBUG_CFLAGS += -xs dcubed@3150: endif duke@435: ohair@593: # Special global options for SS12 jcoomes@1902: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) ohair@593: # There appears to be multiple issues with the new Dwarf2 debug format, so ohair@593: # we tell the compiler to use the older 'stabs' debug format all the time. ohair@593: # Note that this needs to be used in optimized compiles too to be 100%. ohair@593: # This is a workaround for SS12 (5.9) bug 6694600 ohair@593: CFLAGS += -xdebugformat=stabs ohair@593: endif ohair@593: duke@435: # Enable the following CFLAGS additions if you need to compare the duke@435: # built ELF objects. duke@435: # duke@435: # The -g option makes static data global and the "-Qoption ccfe duke@435: # -xglobalstatic" option tells the compiler to not globalize static duke@435: # data using a unique globalization prefix. Instead force the use of duke@435: # a static globalization prefix based on the source filepath so the duke@435: # objects from two identical compilations are the same. dcubed@3150: # EXTRA_CFLAGS only covers vm_version.cpp for some reason dcubed@3150: #EXTRA_CFLAGS += -Qoption ccfe -xglobalstatic dcubed@3150: #OPT_CFLAGS += -Qoption ccfe -xglobalstatic duke@435: #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic duke@435: #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic duke@435: kvn@865: ifeq (${COMPILER_REV_NUMERIC}, 502) kvn@865: COMPILER_DATE := $(shell $(CPP) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }') duke@435: ifeq (${COMPILER_DATE}, 2001/01/31) duke@435: # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy duke@435: # use an innocuous value because it will get -g if it's empty duke@435: FASTDEBUG_CFLAGS = -c duke@435: endif duke@435: endif duke@435: duke@435: # Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information. duke@435: # CFLAGS_BROWSE = -sbfast duke@435: CFLAGS += $(CFLAGS_BROWSE) duke@435: duke@435: # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7) kvn@865: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1) duke@435: # use ild when debugging (but when optimizing we want reproducible results) duke@435: ILDFLAG = $(ILDFLAG/$(VERSION)) duke@435: ILDFLAG/debug = -xildon duke@435: ILDFLAG/optimized = duke@435: AOUT_FLAGS += $(ILDFLAG) duke@435: endif duke@435: duke@435: # Where to put the *.o files (a.out, or shared library)? duke@435: LINK_INTO = $(LINK_INTO/$(VERSION)) duke@435: LINK_INTO/debug = LIBJVM duke@435: LINK_INTO/optimized = LIBJVM duke@435: duke@435: # We link the debug version into the a.out because: duke@435: # 1. ild works on a.out but not shared libraries, and using ild duke@435: # can cut rebuild times by 25% for small changes. (ILD is gone in SS11) duke@435: # 2. dbx cannot gracefully set breakpoints in shared libraries duke@435: # duke@435: duke@435: # apply this setting to link into the shared library even in the debug version: duke@435: ifdef LP64 duke@435: LINK_INTO = LIBJVM duke@435: else duke@435: #LINK_INTO = LIBJVM duke@435: endif duke@435: duke@435: MCS = /usr/ccs/bin/mcs duke@435: STRIP = /usr/ccs/bin/strip duke@435: duke@435: # Solaris platforms collect lots of redundant file-ident lines, duke@435: # to the point of wasting a significant percentage of file space. duke@435: # (The text is stored in ELF .comment sections, contributed by duke@435: # all "#pragma ident" directives in header and source files.) duke@435: # This command "compresses" the .comment sections simply by duke@435: # removing repeated lines. The data can be extracted from duke@435: # binaries in the field by using "mcs -p libjvm.so" or the older duke@435: # command "what libjvm.so". duke@435: LINK_LIB.CC/POST_HOOK += $(MCS) -c $@ || exit 1; duke@435: # (The exit 1 is necessary to cause a build failure if the command fails and duke@435: # multiple commands are strung together, and the final semicolon is necessary duke@435: # since the hook must terminate itself as a valid command.) duke@435: duke@435: # Also, strip debug and line number information (worth about 1.7Mb). dcubed@3150: # If we can create .debuginfo files, then the VM is stripped in vm.make dcubed@3150: # and this macro is not used. duke@435: STRIP_LIB.CC/POST_HOOK = $(STRIP) -x $@ || exit 1; duke@435: # STRIP_LIB.CC/POST_HOOK is incorporated into LINK_LIB.CC/POST_HOOK duke@435: # in certain configurations, such as product.make. Other configurations, duke@435: # such as debug.make, do not include the strip operation.