duke@1: # duke@1: # Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. duke@1: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: # duke@1: # This code is free software; you can redistribute it and/or modify it duke@1: # under the terms of the GNU General Public License version 2 only, as duke@1: # published by the Free Software Foundation. Sun designates this duke@1: # particular file as subject to the "Classpath" exception as provided duke@1: # by Sun in the LICENSE file that accompanied this code. duke@1: # duke@1: # This code is distributed in the hope that it will be useful, but WITHOUT duke@1: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: # version 2 for more details (a copy is included in the LICENSE file that duke@1: # accompanied this code). duke@1: # duke@1: # You should have received a copy of the GNU General Public License version duke@1: # 2 along with this work; if not, write to the Free Software Foundation, duke@1: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: # duke@1: # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@1: # CA 95054 USA or visit www.sun.com if you need additional information or duke@1: # have any questions. duke@1: # duke@1: duke@1: # duke@1: # Makefile to specify compiler flags for programs and libraries duke@1: # targeted to Solaris. Should not contain any rules. duke@1: # duke@1: duke@1: # Warning: the following variables are overridden by Defs.gmk. Set duke@1: # values will be silently ignored: duke@1: # CFLAGS (set $(OTHER_CFLAGS) instead) duke@1: # CPPFLAGS (set $(OTHER_CPPFLAGS) instead) duke@1: # CXXFLAGS (set $(OTHER_CXXFLAGS) instead) duke@1: # LDFLAGS (set $(OTHER_LDFAGS) instead) duke@1: # LDLIBS (set $(EXTRA_LIBS) instead) duke@1: # LDLIBS_COMMON (set $(EXTRA_LIBS) instead) duke@1: # LINTFLAGS (set $(OTHER_LINTFLAGS) instead) duke@1: duke@1: # Get shared JDK settings duke@1: include $(BUILDDIR)/common/shared/Defs.gmk duke@1: duke@1: ifndef PLATFORM_SRC duke@1: PLATFORM_SRC = $(TOPDIR)/src/solaris duke@1: endif # PLATFORM_SRC duke@1: duke@1: # platform specific include files duke@1: PLATFORM_INCLUDE_NAME = $(PLATFORM) duke@1: PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) duke@1: duke@1: # suffix used for make dependencies files duke@1: DEPEND_SUFFIX = d duke@1: # suffix used for lint files duke@1: LINT_SUFFIX = ln duke@1: # The suffix applied to the library name for FDLIBM duke@1: FDDLIBM_SUFFIX = a duke@1: # The suffix applied to scripts (.bat for windows, nothing for unix) duke@1: SCRIPT_SUFFIX = duke@1: # CC compiler object code output directive flag value duke@1: CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! duke@1: CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! duke@1: duke@1: # duke@1: # Default HPI libraries. Build will build only native unless duke@1: # overriden at the make command line. This makes it convenient for duke@1: # people doing, say, a pthreads port -- they can create a posix duke@1: # directory here, and say "gnumake HPIS=posix" at the top duke@1: # level. duke@1: # duke@1: HPIS = native duke@1: duke@1: # duke@1: # Java default optimization (-x04/-O2) etc. Applies to the VM. duke@1: # duke@1: ifeq ($(PRODUCT), java) duke@1: _OPT = $(CC_HIGHER_OPT) duke@1: else duke@1: _OPT = $(CC_LOWER_OPT) duke@1: CPPFLAGS_DBG += -DLOGGING -DDBINFO duke@1: endif duke@1: duke@1: # duke@1: # If -Xa is in CFLAGS_COMMON it will end up ahead of $(POPT) for the duke@1: # optimized build, and that ordering of the flags completely freaks duke@1: # out cc. Hence, -Xa is instead in each CFLAGS variant. duke@1: # duke@1: # The more unusual options to the Sun C compiler: duke@1: # -v Stricter type checking, more error checking duke@1: # (To turn ALL warnings into fatals, use -errwarn=%all) duke@1: # -xstrconst Place string literals and constants in read-only area duke@1: # (means you can't write on your string literals) duke@1: # -xs Force debug information (stabs) into the .so or a.out duke@1: # (makes the library/executable debuggable without the duke@1: # .o files needing to be around, but at a space cost) duke@1: # -g & -O If you add the -g option to the optimized compiles duke@1: # you will get better stack retraces, the code is duke@1: # still optimized. This includes a space cost too. duke@1: # -xc99=%none Do NOT allow for c99 extensions to be used. duke@1: # e.g. declarations must precede statements duke@1: # -xCC Allow the C++ style of comments in C: // duke@1: # Required with many of the source files. duke@1: # -mt Assume multi-threaded (important) duke@1: # duke@1: duke@1: # duke@1: # Debug flag for C and C++ compiler duke@1: # duke@1: CFLAGS_DEBUG_OPTION=-g duke@1: CXXFLAGS_DEBUG_OPTION=-g duke@1: duke@1: # Turn off -g if we are doing tcov build duke@1: ifdef TCOV_BUILD duke@1: CFLAGS_DEBUG_OPTION= duke@1: CXXFLAGS_DEBUG_OPTION= duke@1: endif duke@1: duke@1: # FASTDEBUG: Optimize the -g builds, gives us a faster debug java duke@1: # If true adds -O to the debug compiles. This allows for any assert duke@1: # tests to remain and debug checking. The resulting code is faster duke@1: # but less debuggable. Stack traces are still valid, although only duke@1: # approximate line numbers are given. Printing of local variables duke@1: # during a debugging session is not possible, but stepping and duke@1: # printing of global or static variables should be possible. duke@1: # Performance/size of files should be about the same, maybe smaller. duke@1: # duke@1: ifeq ($(FASTDEBUG), true) duke@1: CC_FASTDEBUG_OPT = $(CC_LOWER_OPT) duke@1: CFLAGS_DEBUG_OPTION = -g $(CC_FASTDEBUG_OPT) duke@1: CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT) duke@1: endif duke@1: duke@1: CFLAGS_COMMON = -v -mt -L$(OBJDIR) -xc99=%none duke@1: CFLAGS_COMMON += -xCC duke@1: CFLAGS_COMMON += -errshort=tags duke@1: CFLAGS_OPT = $(POPT) duke@1: CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) duke@1: CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) duke@1: duke@1: # Assume MT behavior all the time (important) duke@1: CXXFLAGS_COMMON = -mt duke@1: duke@1: # Assume no C++ exceptions are used duke@1: CXXFLAGS_COMMON += -features=no%except -DCC_NOEX duke@1: duke@1: # For C++, these options tell it to assume nothing about locating libraries duke@1: # either at compile time, or at runtime. Use of these options will likely duke@1: # require the use of -L and -R options to indicate where libraries will duke@1: # be found at compile time (-L) and at runtime (-R). duke@1: # The /usr/lib location comes for free, so no need to specify that one. duke@1: # Note: C is much simplier and there is no need for these options. This duke@1: # is mostly needed to avoid dependencies on libraries in the duke@1: # Compiler install area, also see LIBCXX and LIBM. duke@1: CXXFLAGS_COMMON += -norunpath -xnolib duke@1: duke@1: # duke@1: # Treat compiler warnings as errors, if requested duke@1: # duke@1: ifeq ($(COMPILER_WARNINGS_FATAL),true) duke@1: CFLAGS_COMMON += -errwarn=%all duke@1: CXXFLAGS_COMMON += -errwarn=%all duke@1: endif duke@1: duke@1: CXXFLAGS_OPT = $(POPT) duke@1: CXXFLAGS_DBG = $(CXXFLAGS_DEBUG_OPTION) duke@1: CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) duke@1: duke@1: # Add -xstrconst to the library compiles. This forces all string duke@1: # literals into the read-only data section, which prevents them from duke@1: # being written to and increases the runtime pages shared on the system. duke@1: # duke@1: ifdef LIBRARY duke@1: CFLAGS_COMMON +=-xstrconst duke@1: endif duke@1: duke@1: # Source browser database duke@1: # duke@1: # COMPILE_WITH_SB duke@1: # If defined adds -xsb to compiles and creates a duke@1: # source browsing database during compilation. duke@1: # duke@1: ifdef COMPILE_WITH_SB duke@1: ifeq ($(LIBRARY), java) duke@1: CFLAGS_DBG += -xsb duke@1: endif duke@1: endif duke@1: duke@1: # Lint Flags: duke@1: # -Xa ANSI C plus K&R, favor ANSI rules duke@1: # -Xarch=XXX Same as 'cc -xarch=XXX' duke@1: # -fd report on old style func defs duke@1: # -errchk=structarg report on 64bit struct args by value duke@1: # -errchk=longptr64 report on 64bit to 32bit issues (ignores casts) duke@1: # -errchk=parentheses report on suggested use of extra parens duke@1: # -v suppress unused args duke@1: # -x suppress unused externs duke@1: # -u suppress extern func/vars used/defined duke@1: # -errfmt=simple use one line errors with position info duke@1: duke@1: LINTFLAGS_COMMON = -Xa duke@1: LINTFLAGS_COMMON += -fd duke@1: LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses duke@1: LINTFLAGS_COMMON += -v duke@1: LINTFLAGS_COMMON += -x duke@1: LINTFLAGS_COMMON += -u duke@1: LINTFLAGS_COMMON += -errfmt=simple duke@1: LINTFLAGS_OPT = duke@1: LINTFLAGS_DBG = duke@1: duke@1: # The -W0,-noglobal tells the compiler to NOT generate mangled global duke@1: # ELF data symbols for file local static data. duke@1: # This can break fix&continue, but we'd rather do the same compilations duke@1: # for deliverable bits as we do for non-deliverable bits duke@1: # Tell the compilers to never generate globalized names, all the time. duke@1: CFLAGS_COMMON += -W0,-noglobal duke@1: duke@1: # Arch specific settings (determines type of .o files and instruction set) duke@1: ifeq ($(ARCH_FAMILY), sparc) duke@1: ifdef VIS_NEEDED duke@1: XARCH_VALUE/32=v8plusa duke@1: XARCH_VALUE/64=v9a duke@1: else duke@1: # Someday this should change to improve optimization on UltraSPARC duke@1: # and abandon the old v8-only machines like the SPARCstation 10. duke@1: # Indications with Mustang is that alacrity runs do not show a duke@1: # big improvement using v8plus over v8, but other benchmarks might. duke@1: XARCH_VALUE/32=v8 duke@1: XARCH_VALUE/64=v9 duke@1: endif duke@1: endif duke@1: ifeq ($(ARCH_FAMILY), i586) duke@1: XARCH_VALUE/64=amd64 duke@1: XARCH_VALUE/32= duke@1: endif duke@1: duke@1: # Arch value based on current data model being built duke@1: XARCH_VALUE=$(XARCH_VALUE/$(ARCH_DATA_MODEL)) duke@1: ifneq ($(XARCH_VALUE), ) duke@1: # The actual compiler -xarch options to use duke@1: XARCH_OPTION/32 = -xarch=$(XARCH_VALUE/32) duke@1: XARCH_OPTION/64 = -xarch=$(XARCH_VALUE/64) duke@1: XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL)) duke@1: endif duke@1: duke@1: # If we have a specific -xarch value to use, add it duke@1: ifdef XARCH_OPTION duke@1: CFLAGS_COMMON += $(XARCH_OPTION) duke@1: CXXFLAGS_COMMON += $(XARCH_OPTION) duke@1: ASFLAGS_COMMON += $(XARCH_OPTION) duke@1: EXTRA_LIBS += $(XARCH_OPTION) duke@1: LINTFLAGS_COMMON += -Xarch=$(XARCH_VALUE) duke@1: endif duke@1: duke@1: # duke@1: # uncomment the following to build with PERTURBALOT set duke@1: # duke@1: # OTHER_CFLAGS += -DPERTURBALOT duke@1: # duke@1: duke@1: CPPFLAGS_COMMON = -D$(ARCH_FAMILY) -D__solaris__ -D_REENTRANT duke@1: CPPFLAGS_OPT = duke@1: CPPFLAGS_DBG = -DDEBUG duke@1: duke@1: ifeq ($(ARCH_FAMILY), i586) duke@1: # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the duke@1: # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN duke@1: # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). duke@1: # Note: -Dmacro is the same as #define macro 1 duke@1: # -Dmacro= is the same as #define macro duke@1: # duke@1: CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH) duke@1: # Turn off a superfluous compiler error message on Intel duke@1: CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE duke@1: endif duke@1: duke@1: # Java memory management is based on memory mapping by default, but a duke@1: # system only assuming malloc/free can be built by adding -DUSE_MALLOC duke@1: duke@1: CPPFLAGS_COMMON += -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS duke@1: CPPFLAGS_OPT += -DTRIMMED duke@1: duke@1: LDFLAGS_DEFS_OPTION = -z defs duke@1: LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) duke@1: duke@1: # duke@1: # -L paths for finding and -ljava duke@1: # duke@1: LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) duke@1: LDFLAGS_OPT = duke@1: LDFLAGS_DBG = duke@1: duke@1: # duke@1: # We never really want the incremental linker, ever duke@1: # The -xildoff option tells Sun's compilers to NOT use incremental linker duke@1: # duke@1: LDFLAGS_COMMON += -xildoff duke@1: duke@1: ifdef LIBRARY duke@1: # Libraries need to locate other libraries at runtime, and you can tell duke@1: # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) duke@1: # buried inside the .so. The $ORIGIN says to look relative to where duke@1: # the library itself is and it can be followed with relative paths from duke@1: # that. By default we always look in $ORIGIN, optionally we add relative duke@1: # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. duke@1: # The environment variable LD_LIBRARY_PATH will over-ride these runpaths. duke@1: # Try: 'dump -Lv lib*.so' to see these settings in a library. duke@1: # duke@1: LDFLAGS_COMMON += -R\$$ORIGIN duke@1: LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%) duke@1: endif duke@1: duke@1: EXTRA_LIBS += -lc duke@1: duke@1: # Postprocessing is done on the images directories only duke@1: # duke@1: ifeq ($(VARIANT), OPT) duke@1: ifeq ($(PARTIAL_GPROF), true) duke@1: NO_STRIP = true duke@1: endif duke@1: ifeq ($(GPROF), true) duke@1: NO_STRIP = true duke@1: endif duke@1: ifneq ($(NO_STRIP), true) duke@1: # Debug 'strip -x' leaves local function Elf symbols (better stack traces) duke@1: POST_STRIP_PROCESS = $(STRIP) -x duke@1: endif duke@1: endif duke@1: POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)" duke@1: duke@1: # duke@1: # Sun C compiler will take -M and pass it on to ld. duke@1: # Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o duke@1: # duke@1: ifeq ($(CC_VERSION),gcc) duke@1: LD_MAPFILE_FLAG = -Xlinker -M -Xlinker duke@1: else duke@1: LD_MAPFILE_FLAG = -M duke@1: endif duke@1: duke@1: # duke@1: # Variables globally settable from the make command line (default duke@1: # values in brackets): duke@1: # GPROF (false) duke@1: # Eg: % gnumake GPROF=true duke@1: GPROF = false duke@1: ifeq ($(GPROF), true) duke@1: CFLAGS_COMMON += -DGPROF -xpg duke@1: EXTRA_LIBS += -xpg duke@1: endif duke@1: duke@1: # PARTIAL_GPROF is to be used ONLY during compilation - it should not duke@1: # appear during linking of libraries or programs. It also should duke@1: # prevent linking with -z defs to allow a symbol to remain undefined. duke@1: # duke@1: PARTIAL_GPROF = false duke@1: ifeq ($(PARTIAL_GPROF), true) duke@1: CFLAGS_GPROF += -xpg duke@1: LDFLAGS_DEFS_OPTION = -z nodefs duke@1: endif duke@1: duke@1: # duke@1: # For a TCOV build we add in the TCOV_OPTION duke@1: # duke@1: ifdef TCOV_BUILD duke@1: TCOV_OPTION = -xprofile=tcov duke@1: LDFLAGS_COMMON += $(TCOV_OPTION) -Kpic duke@1: CFLAGS_COMMON += $(TCOV_OPTION) duke@1: CXXFLAGS_COMMON += $(TCOV_OPTION) duke@1: EXTRA_LIBS += $(TCOV_OPTION) duke@1: LDNOMAP=true duke@1: endif duke@1: duke@1: # duke@1: # Solaris only uses native threads. duke@1: # duke@1: THREADS_FLAG= native duke@1: THREADS_DIR= threads duke@1: duke@1: # duke@1: # Support for Quantify. duke@1: # duke@1: ifdef QUANTIFY duke@1: QUANTIFY_CMD = quantify duke@1: QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes duke@1: LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) duke@1: ifdef LIBRARY duke@1: CFLAGS_COMMON += -K PIC duke@1: endif duke@1: endif duke@1: duke@1: # duke@1: # Support for Purify. duke@1: # duke@1: ifdef PURIFY duke@1: PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify duke@1: PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes duke@1: LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS) duke@1: ifdef LIBRARY duke@1: CFLAGS_COMMON += -K PIC duke@1: endif duke@1: endif duke@1: duke@1: # duke@1: # Different "levels" of optimization. duke@1: # duke@1: ifeq ($(CC_VERSION),gcc) duke@1: CC_HIGHEST_OPT = -O3 duke@1: CC_HIGHER_OPT = -O3 duke@1: CC_LOWER_OPT = -O2 duke@1: CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer duke@1: CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer duke@1: # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) duke@1: # (See Rules.gmk) May need to wait for gcc 5? duke@1: AUTOMATIC_PCH_OPTION = duke@1: else duke@1: # Highest could be -xO5, but indications are that -xO5 should be reserved duke@1: # for a per-file use, on sources with known performance impacts. duke@1: CC_HIGHEST_OPT = -xO4 duke@1: CC_HIGHER_OPT = -xO4 duke@1: CC_LOWER_OPT = -xO2 duke@1: # duke@1: # WARNING: Use of _OPT=$(CC_HIGHEST_OPT) in your Makefile needs to be duke@1: # done with care, there are some assumptions below that need to duke@1: # be understood about the use of pointers, and IEEE behavior. duke@1: # duke@1: # Use non-standard floating point mode (not IEEE 754) duke@1: CC_HIGHEST_OPT += -fns duke@1: # Do some simplification of floating point arithmetic (not IEEE 754) duke@1: CC_HIGHEST_OPT += -fsimple duke@1: # Use single precision floating point with 'float' duke@1: CC_HIGHEST_OPT += -fsingle duke@1: # Assume memory references via basic pointer types do not alias duke@1: # (Source with excessing pointer casting and data access with mixed duke@1: # pointer types are not recommended) duke@1: CC_HIGHEST_OPT += -xalias_level=basic duke@1: # Use intrinsic or inline versions for math/std functions duke@1: # (If you expect perfect errno behavior, do not use this) duke@1: CC_HIGHEST_OPT += -xbuiltin=%all duke@1: # Loop data dependency optimizations (need -xO3 or higher) duke@1: CC_HIGHEST_OPT += -xdepend duke@1: # Pointer parameters to functions do not overlap duke@1: # (Similar to -xalias_level=basic usage, but less obvious sometimes. duke@1: # If you pass in multiple pointers to the same data, do not use this) duke@1: CC_HIGHEST_OPT += -xrestrict duke@1: # Inline some library routines duke@1: # (If you expect perfect errno behavior, do not use this) duke@1: CC_HIGHEST_OPT += -xlibmil duke@1: # Use optimized math routines duke@1: # (If you expect perfect errno behavior, do not use this) duke@1: # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now duke@1: # CC_HIGHEST_OPT += -xlibmopt duke@1: ifeq ($(ARCH_FAMILY), sparc) duke@1: # Assume at most 8byte alignment, raise SIGBUS on error duke@1: ### Presents an ABI issue with customer JNI libs? duke@1: ####CC_HIGHEST_OPT += -xmemalign=8s duke@1: # Automatic prefetch instructions, explicit prefetch macros duke@1: CC_HIGHEST_OPT += -xprefetch=auto,explicit duke@1: # Pick ultra as the chip to optimize to duke@1: CC_HIGHEST_OPT += -xchip=ultra duke@1: endif duke@1: ifeq ($(ARCH), i586) duke@1: # Pick pentium as the chip to optimize to duke@1: CC_HIGHEST_OPT += -xchip=pentium duke@1: endif duke@1: ifdef LIBRARY duke@1: # The Solaris CBE (Common Build Environment) requires that the use duke@1: # of appl registers be disabled when compiling a public library (or duke@1: # a library that's loaded by a public library) on sparc. duke@1: CFLAGS_REQUIRED_sparc += -xregs=no%appl duke@1: CFLAGS_REQUIRED_sparcv9 += -xregs=no%appl duke@1: endif duke@1: ifeq ($(shell $(EXPR) $(CC_VER) \> 5.6), 1) duke@1: # Do NOT use the frame pointer register as a general purpose opt register duke@1: CFLAGS_REQUIRED_i586 += -xregs=no%frameptr duke@1: CFLAGS_REQUIRED_amd64 += -xregs=no%frameptr duke@1: # We MUST allow data alignment of 4 for sparc V8 (32bit) duke@1: # Presents an ABI issue with customer JNI libs? We must be able to duke@1: # to handle 4byte aligned objects? (rare occurance, but possible?) duke@1: CFLAGS_REQUIRED_sparc += -xmemalign=4s duke@1: endif duke@1: # Just incase someone trys to use the SOS9 compilers duke@1: ifeq ($(CC_VER), 5.6) duke@1: # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s) duke@1: CFLAGS_REQUIRED_sparc += -xmemalign=4s duke@1: endif duke@1: # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) duke@1: # (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken. duke@1: AUTOMATIC_PCH_OPTION = duke@1: endif duke@1: CC_NO_OPT = duke@1: duke@1: # If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off duke@1: ifdef NO_OPTIMIZATIONS duke@1: CC_HIGHEST_OPT = $(CC_NO_OPT) duke@1: CC_HIGHER_OPT = $(CC_NO_OPT) duke@1: CC_LOWER_OPT = $(CC_NO_OPT) duke@1: endif duke@1: duke@1: # Flags required all the time duke@1: CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) duke@1: duke@1: # Add processor specific options for optimizations duke@1: CC_HIGHEST_OPT += $(_OPT_$(ARCH)) duke@1: CC_HIGHER_OPT += $(_OPT_$(ARCH)) duke@1: CC_LOWER_OPT += $(_OPT_$(ARCH)) duke@1: duke@1: # Secret compiler optimization options that should be in the above macros duke@1: # but since they differ in format from C to C++, are added into the C or duke@1: # C++ specific macros for compiler flags. duke@1: # duke@1: # On i586 we need to tell the code generator to ALWAYS use a duke@1: # frame pointer. duke@1: ifeq ($(ARCH_FAMILY), i586) duke@1: # Note that in 5.7, this is done with -xregs=no%frameptr duke@1: ifeq ($(CC_VER), 5.5) duke@1: # It's not exactly clear when this optimization kicks in, the duke@1: # current assumption is -xO4 or greater and for C++ with duke@1: # the -features=no%except option and -xO4 and greater. duke@1: # Bottom line is, we ALWAYS want a frame pointer! duke@1: CXXFLAGS_OPT += -Qoption ube -Z~B duke@1: CFLAGS_OPT += -Wu,-Z~B duke@1: ifeq ($(FASTDEBUG), true) duke@1: CXXFLAGS_DBG += -Qoption ube -Z~B duke@1: CFLAGS_DBG += -Wu,-Z~B duke@1: endif duke@1: endif duke@1: endif duke@1: # duke@1: # Optimizer for sparc needs to be told not to do certain things duke@1: # related to frames or save instructions. duke@1: ifeq ($(ARCH_FAMILY), sparc) duke@1: # NOTE: Someday the compilers will provide a high-level option for this. duke@1: # Use save instructions instead of add instructions duke@1: # This was an optimization starting in SC5.0 that made it hard for us to duke@1: # find the "save" instruction (which got turned into an "add") duke@1: CXXFLAGS_OPT += -Qoption cg -Qrm-s duke@1: CFLAGS_OPT += -Wc,-Qrm-s duke@1: ifeq ($(FASTDEBUG), true) duke@1: CXXFLAGS_DBG += -Qoption cg -Qrm-s duke@1: CFLAGS_DBG += -Wc,-Qrm-s duke@1: endif duke@1: # duke@1: # NOTE: Someday the compilers will provide a high-level option for this. duke@1: # Don't allow tail call code optimization. Started in SC5.0. duke@1: # We don't like code of this form: duke@1: # save duke@1: # duke@1: # call foo duke@1: # restore duke@1: # because we can't tell if the method will have a stack frame duke@1: # and register windows or not. duke@1: CXXFLAGS_OPT += -Qoption cg -Qiselect-T0 duke@1: CFLAGS_OPT += -Wc,-Qiselect-T0 duke@1: ifeq ($(FASTDEBUG), true) duke@1: CXXFLAGS_DBG += -Qoption cg -Qiselect-T0 duke@1: CFLAGS_DBG += -Wc,-Qiselect-T0 duke@1: endif duke@1: endif duke@1: duke@1: # duke@1: # Path and option to link against the VM, if you have to. Note that duke@1: # there are libraries that link against only -ljava, but they do get duke@1: # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas duke@1: # the library itself should not. duke@1: # duke@1: VM_NAME = server duke@1: JVMLIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH)/server -ljvm duke@1: JAVALIB = duke@1: duke@1: # Part of INCREMENTAL_BUILD mechanism. duke@1: # Compiler emits things like: path/file.o: file.h duke@1: # We want something like: relative_path/file.o relative_path/file.d: file.h duke@1: # In addition on Solaris, any include file starting with / is deleted, duke@1: # this gets rid of things like /usr/include files, which never change. duke@1: CC_DEPEND = -xM1 duke@1: CC_DEPEND_FILTER = $(SED) -e '/:[ ]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u duke@1: duke@1: # Location of openwin libraries (do we really need this anymore?) duke@1: OPENWIN_HOME = /usr/openwin duke@1: OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR) duke@1: duke@1: # Runtime graphics library search paths... duke@1: OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR) duke@1: AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB) duke@1: duke@1: # C++ Runtime library (libCrun.so), use instead of -lCrun. duke@1: # Originally used instead of -lCrun to guarantee use of the system duke@1: # .so version and not the .a or .so that came with the compilers. duke@1: # With the newer compilers this could probably change back to -lCrun but duke@1: # in general this is ok to continue to do. duke@1: LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1 duke@1: duke@1: # Math Library (libm.so), do not use -lm. duke@1: # There might be two versions of libm.so on the build system: duke@1: # libm.so.1 and libm.so.2, and we want libm.so.1. duke@1: # Depending on the Solaris release being used to build with, duke@1: # /usr/lib/libm.so could point at a libm.so.2, so we are duke@1: # explicit here so that the libjvm.so you have built will work on an duke@1: # older Solaris release that might not have libm.so.2. duke@1: # This is a critical factor in allowing builds on Solaris 10 or newer duke@1: # to run on Solaris 8 or 9. duke@1: # duke@1: # Note: Historically there was also a problem picking up a static version duke@1: # of libm.a from the compiler area, but that problem has gone away duke@1: # with the newer compilers. Use of libm.a would cause .so bloat. duke@1: # duke@1: LIBM = /usr/lib$(ISA_DIR)/libm.so.1 duke@1: duke@1: # Socket library duke@1: LIBSOCKET = -lsocket duke@1: duke@1: # GLOBAL_KPIC: If set means all libraries are PIC, position independent code duke@1: # EXCEPT for select compiles duke@1: # If a .o file is compiled non-PIC then it should be forced duke@1: # into the RW data segment with a mapfile option. This is done duke@1: # with object files which generated from .s files. duke@1: # The -ztext enforces that no relocations remain in the text segment duke@1: # so that it remains purely read-only for optimum system performance. duke@1: # Some libraries may use a smaller size (13bit -Kpic) on sparc instead of duke@1: # (32 bit -KPIC) and will override GLOBAL_KPIC appropriately. duke@1: # duke@1: PIC_CODE_LARGE = -KPIC duke@1: PIC_CODE_SMALL = -Kpic duke@1: ifndef TCOV_BUILD duke@1: GLOBAL_KPIC = $(PIC_CODE_LARGE) duke@1: CXXFLAGS_COMMON += $(GLOBAL_KPIC) duke@1: CFLAGS_COMMON += $(GLOBAL_KPIC) duke@1: LDFLAGS_COMMON += -ztext duke@1: endif # TCOV_BUILD duke@1: duke@1: # If your platform has DPS, it will have Type1 fonts too, in which case duke@1: # it is best to enable DPS support until such time as 2D's rasteriser duke@1: # can fully handle Type1 fonts in all cases. Default is "yes". duke@1: # HAVE_DPS should only be "no" if the platform has no DPS headers or libs duke@1: # DPS (Displayable PostScript) is available on Solaris machines duke@1: duke@1: HAVE_DPS = yes duke@1: duke@1: # duke@1: # Japanese manpages duke@1: # duke@1: JA_SOURCE_ENCODING = eucJP duke@1: JA_TARGET_ENCODINGS = eucJP UTF-8 PCK duke@1: