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