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