#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile to specify compiler flags for programs and libraries
# targeted to Linux. Should not contain any rules.
#
# WARNING: This file is shared with other workspaces.
# So when it includes other files, it must use JDK_TOPDIR.
#
# Warning: the following variables are overriden by Defs.gmk. Set
# values will be silently ignored:
# CFLAGS (set $(OTHER_CFLAGS) instead)
# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
# LDFLAGS (set $(OTHER_LDFAGS) instead)
# LDLIBS (set $(EXTRA_LIBS) instead)
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
# Get shared JDK settings
# Part of INCREMENTAL_BUILD mechanism.
# We want something like: relative_path/file.o relative_path/file.d: file.h
endif # PLATFORM_SRC
# Location of the various .properties files specific to Linux platform
endif # PLATFORM_SRC
# Platform specific closed sources
# platform specific include files
# suffix used for make dependencies files.
DEPEND_SUFFIX = d
# The suffix applied to the library name for FDLIBM
FDDLIBM_SUFFIX = a
# The suffix applied to scripts (.bat for windows, nothing for unix)
# CC compiler object code output directive flag value
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
# The Full Debug Symbols (FDS) default for VARIANT == OPT builds is
# enabled with debug info files ZIP'ed to save space. For VARIANT !=
# OPT builds, FDS is always enabled, after all a debug build without
# debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has
# meaning when FDS is enabled.
#
# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
# disabled for a VARIANT == OPT build.
#
# Note: Use of a different variable name for the FDS override option
# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
# in options via environment variables, use of distinct variables
# prevents strange behaviours. For example, in a VARIANT != OPT build,
# the FULL_DEBUG_SYMBOLS environment variable will be 0, but the
# ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same
# variable name is used, then different values can be picked up by
# different parts of the build. Just to be clear, we only need two
# variable names because the incoming option value can be overridden
# in some situations, e.g., a VARIANT != OPT build.
FULL_DEBUG_SYMBOLS ?= 1
else
# debug variants always get Full Debug Symbols (if available)
# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
# Default OBJCOPY comes from GNU Binutils on Linux:
else
# Assume objcopy is part of the cross-compilation toolkit
# disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
# Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
# JDK build to import .debuginfo or .diz files from the HotSpot build.
# However, adding FDS support to the JDK build will occur in phases
# so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
# and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a
# particular library or program supports FDS.
echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
else
# Library stripping policies for .debuginfo configs:
# all_strip - strips everything from the library
# min_strip - strips most stuff from the library; leaves minimum symbols
# no_strip - does not strip the library at all
#
# Oracle security policy requires "all_strip". A waiver was granted on
# 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
#
# Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
ZIP_DEBUGINFO_FILES ?= 1
#
# Default optimization
#
else
# For all platforms, do not omit the frame pointer register usage.
# We need this frame pointer to make it easy to walk the stacks.
# This should be the default on X86, but ia64 and amd64 may not have this
# as the default.
LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
else
# If this is a --hash-style=gnu system, use --hash-style=both
# The gnu .hash section won't work on some Linux systems like SuSE 10.
#
# Selection of warning messages
#
#
# Treat compiler warnings as errors, if warnings not allowed
#
GCC_WARNINGS += -Werror
#
# Misc compiler options
#
CFLAGS_COMMON += -pipe
# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
DEBUG_FLAG = -g
DEBUG_FLAG = -g1
# DEBUG_BINARIES overrides everything, use full -g debug information
DEBUG_FLAG = -g
CFLAGS_REQUIRED += $(DEBUG_FLAG)
# If Full Debug Symbols is enabled, then we want the same debug and
# optimization flags as used by FASTDEBUG.
#
CFLAGS_OPT = $(CC_OPT)
CFLAGS_DBG = $(DEBUG_FLAG)
CFLAGS_COMMON += $(CFLAGS_REQUIRED)
CXXFLAGS_OPT = $(CC_OPT)
CXXFLAGS_DBG = $(DEBUG_FLAG)
# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
CPP_ARCH_FLAGS += -D$(ARCH)
else
CPPFLAGS_DBG += -DLOGGING
# Libraries need to locate other libraries at runtime, and you can tell
# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
# buried inside the .so. The $ORIGIN says to look relative to where
# the library itself is and it can be followed with relative paths from
# that. By default we always look in $ORIGIN, optionally we add relative
# paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
# On Linux we add a flag -z origin, not sure if this is necessary, but
# doesn't seem to hurt.
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
# Try: 'readelf -d lib*.so' to see these settings in a library.
#
EXTRA_LIBS += -lc
#
# -L paths for finding and -ljava
#
#
# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
# statically link libgcc but will print a warning with the flag. We don't
# want the warning, so check gcc version first.
#
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
# (See Rules.gmk) The gcc 5 compiler might have an option for this?
#
# Post Processing of libraries/executables
#
# Debug 'strip -g' leaves local function Elf symbols (better stack
# traces)
POST_STRIP_PROCESS = $(STRIP) -g
#
# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
#
#
# Support for Quantify.
#
#
# 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.
#
#
# We want to privatize JVM symbols on Solaris. This is so the user can
# write a function called FindClass and this should not override the
# FindClass that is inside the JVM. At this point in time we are not
# concerned with other JNI libraries because we hope that there will
# not be as many clashes there.
#
PRIVATIZE_JVM_SYMBOLS = false
USE_PTHREADS = true
override HAVE_ALTZONE = false
override HAVE_FILIOH = false
override HAVE_GETHRTIME = false
override HAVE_GETHRVTIME = false
override HAVE_SIGIGNORE = true
else
override MOOT_PRIORITIES = true
override NO_INTERRUPTIBLE_IO = true
else
override USE_GNU_M4 = true
override USING_GNU_TAR = true
override WRITE_LIBVERSION = false
# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
# resulting resolved absolute name of the executable in the environment
# variable EXECNAME. That executable name is then used that to locate the
# installation area.
override USE_EXECNAME = true
# 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
#
# Japanese manpages
#
# Settings for the JDI - Serviceability Agent binding.
# The JDI - Serviceability Agent binding is not currently supported
# on Linux-ia64.
INCLUDE_SA = false
else
INCLUDE_SA = true