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