duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 2 | # Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | # |
| 5 | # This code is free software; you can redistribute it and/or modify it |
| 6 | # under the terms of the GNU General Public License version 2 only, as |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 10 | # |
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | # version 2 for more details (a copy is included in the LICENSE file that |
| 15 | # accompanied this code). |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License version |
| 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | # |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | # or visit www.oracle.com if you need additional information or have any |
| 23 | # questions. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 24 | # |
| 25 | |
| 26 | # |
| 27 | # Makefile to specify compiler flags for programs and libraries |
| 28 | # targeted to Linux. Should not contain any rules. |
| 29 | # |
| 30 | # WARNING: This file is shared with other workspaces. |
| 31 | # So when it includes other files, it must use JDK_TOPDIR. |
| 32 | # |
| 33 | |
| 34 | # Warning: the following variables are overriden by Defs.gmk. Set |
| 35 | # values will be silently ignored: |
| 36 | # CFLAGS (set $(OTHER_CFLAGS) instead) |
| 37 | # CPPFLAGS (set $(OTHER_CPPFLAGS) instead) |
| 38 | # CXXFLAGS (set $(OTHER_CXXFLAGS) instead) |
| 39 | # LDFLAGS (set $(OTHER_LDFAGS) instead) |
| 40 | # LDLIBS (set $(EXTRA_LIBS) instead) |
| 41 | # LDLIBS_COMMON (set $(EXTRA_LIBS) instead) |
| 42 | |
| 43 | # Get shared JDK settings |
| 44 | include $(JDK_MAKE_SHARED_DIR)/Defs.gmk |
| 45 | |
| 46 | # Part of INCREMENTAL_BUILD mechanism. |
| 47 | # Compiler emits things like: path/file.o: file.h |
| 48 | # We want something like: relative_path/file.o relative_path/file.d: file.h |
| 49 | CC_DEPEND = -MM |
| 50 | CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' |
| 51 | |
| 52 | ifndef PLATFORM_SRC |
ohair | 26e0af6 | 2008-03-04 09:52:54 -0800 | [diff] [blame] | 53 | PLATFORM_SRC = $(BUILDDIR)/../src/solaris |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 54 | endif # PLATFORM_SRC |
| 55 | |
| 56 | # Platform specific closed sources |
| 57 | ifndef OPENJDK |
| 58 | ifndef CLOSED_PLATFORM_SRC |
ohair | 26e0af6 | 2008-03-04 09:52:54 -0800 | [diff] [blame] | 59 | CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 60 | endif |
| 61 | endif |
| 62 | |
| 63 | # platform specific include files |
| 64 | PLATFORM_INCLUDE_NAME = $(PLATFORM) |
| 65 | PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) |
| 66 | |
| 67 | # suffix used for make dependencies files. |
| 68 | DEPEND_SUFFIX = d |
| 69 | # The suffix applied to the library name for FDLIBM |
| 70 | FDDLIBM_SUFFIX = a |
| 71 | # The suffix applied to scripts (.bat for windows, nothing for unix) |
| 72 | SCRIPT_SUFFIX = |
| 73 | # CC compiler object code output directive flag value |
| 74 | CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 75 | |
dcubed | b896fcf | 2012-04-03 12:57:47 -0700 | [diff] [blame^] | 76 | # The Full Debug Symbols (FDS) default for VARIANT == OPT builds is |
| 77 | # enabled with debug info files ZIP'ed to save space. For VARIANT != |
| 78 | # OPT builds, FDS is always enabled, after all a debug build without |
| 79 | # debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has |
| 80 | # meaning when FDS is enabled. |
| 81 | # |
| 82 | # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be |
| 83 | # disabled for a VARIANT == OPT build. |
| 84 | # |
| 85 | # Note: Use of a different variable name for the FDS override option |
| 86 | # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS |
| 87 | # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass |
| 88 | # in options via environment variables, use of distinct variables |
| 89 | # prevents strange behaviours. For example, in a VARIANT != OPT build, |
| 90 | # the FULL_DEBUG_SYMBOLS environment variable will be 0, but the |
| 91 | # ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same |
| 92 | # variable name is used, then different values can be picked up by |
| 93 | # different parts of the build. Just to be clear, we only need two |
| 94 | # variable names because the incoming option value can be overridden |
| 95 | # in some situations, e.g., a VARIANT != OPT build. |
| 96 | |
| 97 | ifeq ($(VARIANT), OPT) |
| 98 | FULL_DEBUG_SYMBOLS ?= 1 |
| 99 | ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) |
| 100 | else |
| 101 | # debug variants always get Full Debug Symbols (if available) |
| 102 | ENABLE_FULL_DEBUG_SYMBOLS = 1 |
| 103 | endif |
| 104 | _JUNK_ := $(shell \ |
| 105 | echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 106 | # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
dcubed | 46b9922 | 2011-09-20 19:16:21 -0700 | [diff] [blame] | 107 | |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 108 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
| 109 | # Default OBJCOPY comes from GNU Binutils on Linux: |
| 110 | DEF_OBJCOPY=/usr/bin/objcopy |
| 111 | ifdef CROSS_COMPILE_ARCH |
| 112 | # don't try to generate .debuginfo files when cross compiling |
| 113 | _JUNK_ := $(shell \ |
| 114 | echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \ |
| 115 | "skipping .debuginfo generation.") |
| 116 | OBJCOPY= |
dcubed | 46b9922 | 2011-09-20 19:16:21 -0700 | [diff] [blame] | 117 | else |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 118 | OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
| 119 | ifneq ($(ALT_OBJCOPY),) |
| 120 | _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") |
| 121 | # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path |
| 122 | OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
| 123 | endif |
dcubed | 46b9922 | 2011-09-20 19:16:21 -0700 | [diff] [blame] | 124 | endif |
| 125 | |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 126 | # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the |
| 127 | # JDK build to import .debuginfo or .diz files from the HotSpot build. |
| 128 | # However, adding FDS support to the JDK build will occur in phases |
| 129 | # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS) |
| 130 | # is used to indicate that a particular library supports FDS. |
| 131 | |
| 132 | ifeq ($(OBJCOPY),) |
| 133 | _JUNK_ := $(shell \ |
| 134 | echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") |
| 135 | ENABLE_FULL_DEBUG_SYMBOLS=0 |
| 136 | else |
| 137 | _JUNK_ := $(shell \ |
| 138 | echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") |
| 139 | |
| 140 | # Library stripping policies for .debuginfo configs: |
| 141 | # all_strip - strips everything from the library |
| 142 | # min_strip - strips most stuff from the library; leaves minimum symbols |
| 143 | # no_strip - does not strip the library at all |
| 144 | # |
| 145 | # Oracle security policy requires "all_strip". A waiver was granted on |
| 146 | # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. |
| 147 | # |
| 148 | # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. |
| 149 | STRIP_POLICY ?= min_strip |
| 150 | |
| 151 | _JUNK_ := $(shell \ |
| 152 | echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") |
| 153 | |
dcubed | b896fcf | 2012-04-03 12:57:47 -0700 | [diff] [blame^] | 154 | # HACK: disable ZIP_DEBUGINFO_FILES by default until install repo |
| 155 | # changes are promoted |
| 156 | ZIP_DEBUGINFO_FILES ?= 0 |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 157 | |
| 158 | _JUNK_ := $(shell \ |
| 159 | echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") |
| 160 | endif |
dcubed | 46b9922 | 2011-09-20 19:16:21 -0700 | [diff] [blame] | 161 | endif |
| 162 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 163 | # |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 164 | # Default optimization |
| 165 | # |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 166 | |
ohair | 850fb25 | 2008-07-30 19:40:57 -0700 | [diff] [blame] | 167 | ifndef OPTIMIZATION_LEVEL |
| 168 | ifeq ($(PRODUCT), java) |
| 169 | OPTIMIZATION_LEVEL = HIGHER |
| 170 | else |
| 171 | OPTIMIZATION_LEVEL = LOWER |
| 172 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 173 | endif |
ohair | b99e3e3 | 2009-03-31 16:10:31 -0700 | [diff] [blame] | 174 | ifndef FASTDEBUG_OPTIMIZATION_LEVEL |
| 175 | FASTDEBUG_OPTIMIZATION_LEVEL = LOWER |
| 176 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 177 | |
ohair | 850fb25 | 2008-07-30 19:40:57 -0700 | [diff] [blame] | 178 | CC_OPT/NONE = |
| 179 | CC_OPT/LOWER = -O2 |
| 180 | CC_OPT/HIGHER = -O3 |
| 181 | CC_OPT/HIGHEST = -O3 |
| 182 | |
| 183 | CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) |
| 184 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 185 | # For all platforms, do not omit the frame pointer register usage. |
| 186 | # We need this frame pointer to make it easy to walk the stacks. |
| 187 | # This should be the default on X86, but ia64 and amd64 may not have this |
| 188 | # as the default. |
| 189 | CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN |
| 190 | CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN |
| 191 | CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN |
| 192 | CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9 |
| 193 | LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 |
| 194 | CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 |
| 195 | LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 |
dholmes | 70a4d1a | 2011-03-16 18:54:50 -0400 | [diff] [blame] | 196 | CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN |
| 197 | CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN |
gbenson | 24e3a5d | 2009-10-15 13:27:59 +0100 | [diff] [blame] | 198 | ifeq ($(ZERO_BUILD), true) |
| 199 | CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) |
| 200 | ifeq ($(ZERO_ENDIANNESS), little) |
| 201 | CFLAGS_REQUIRED += -D_LITTLE_ENDIAN |
| 202 | endif |
| 203 | LDFLAGS_COMMON += $(ZERO_ARCHFLAG) |
| 204 | else |
| 205 | CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) |
| 206 | LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) |
| 207 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 208 | |
ohair | 8df3929 | 2009-01-31 17:31:21 -0800 | [diff] [blame] | 209 | # If this is a --hash-style=gnu system, use --hash-style=both |
| 210 | # The gnu .hash section won't work on some Linux systems like SuSE 10. |
| 211 | _HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu') |
| 212 | ifneq ($(_HAS_HASH_STYLE_GNU),) |
| 213 | LDFLAGS_HASH_STYLE = -Wl,--hash-style=both |
| 214 | endif |
| 215 | LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE) |
| 216 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 217 | # |
| 218 | # Selection of warning messages |
| 219 | # |
| 220 | GCC_INHIBIT = -Wno-unused -Wno-parentheses |
| 221 | GCC_STYLE = |
| 222 | GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT) |
| 223 | |
| 224 | # |
| 225 | # Treat compiler warnings as errors, if warnings not allowed |
| 226 | # |
| 227 | ifeq ($(COMPILER_WARNINGS_FATAL),true) |
| 228 | GCC_WARNINGS += -Werror |
| 229 | endif |
| 230 | |
| 231 | # |
| 232 | # Misc compiler options |
| 233 | # |
dholmes | 70a4d1a | 2011-03-16 18:54:50 -0400 | [diff] [blame] | 234 | ifneq ($(ARCH),ppc) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 235 | CFLAGS_COMMON = -fno-strict-aliasing |
dholmes | 70a4d1a | 2011-03-16 18:54:50 -0400 | [diff] [blame] | 236 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 237 | PIC_CODE_LARGE = -fPIC |
| 238 | PIC_CODE_SMALL = -fpic |
| 239 | GLOBAL_KPIC = $(PIC_CODE_LARGE) |
ohair | ab4f121 | 2008-07-27 18:42:57 -0700 | [diff] [blame] | 240 | CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 241 | ifeq ($(ARCH), amd64) |
ohair | ab4f121 | 2008-07-27 18:42:57 -0700 | [diff] [blame] | 242 | CFLAGS_COMMON += -pipe |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 243 | endif |
| 244 | |
| 245 | # Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 |
| 246 | DEBUG_FLAG = -g |
| 247 | ifeq ($(FASTDEBUG), true) |
| 248 | ifeq ($(ARCH_DATA_MODEL), 64) |
| 249 | DEBUG_FLAG = -g1 |
| 250 | endif |
| 251 | endif |
| 252 | |
aph | d46bd76 | 2009-04-17 15:56:20 +0100 | [diff] [blame] | 253 | # DEBUG_BINARIES overrides everything, use full -g debug information |
| 254 | ifeq ($(DEBUG_BINARIES), true) |
| 255 | DEBUG_FLAG = -g |
| 256 | CFLAGS_REQUIRED += $(DEBUG_FLAG) |
| 257 | endif |
| 258 | |
ohair | 850fb25 | 2008-07-30 19:40:57 -0700 | [diff] [blame] | 259 | CFLAGS_OPT = $(CC_OPT) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 260 | CFLAGS_DBG = $(DEBUG_FLAG) |
| 261 | CFLAGS_COMMON += $(CFLAGS_REQUIRED) |
| 262 | |
| 263 | CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) |
ohair | 850fb25 | 2008-07-30 19:40:57 -0700 | [diff] [blame] | 264 | CXXFLAGS_OPT = $(CC_OPT) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 265 | CXXFLAGS_DBG = $(DEBUG_FLAG) |
| 266 | CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) |
| 267 | |
| 268 | # FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java |
| 269 | ifeq ($(FASTDEBUG), true) |
ohair | b99e3e3 | 2009-03-31 16:10:31 -0700 | [diff] [blame] | 270 | CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) |
| 271 | CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 272 | endif |
| 273 | |
andrew | 2ed7e05 | 2010-06-03 18:49:35 +0100 | [diff] [blame] | 274 | CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"' |
| 275 | |
| 276 | # Alpha arch does not like "alpha" defined (potential general arch cleanup issue here) |
| 277 | ifneq ($(ARCH),alpha) |
| 278 | CPP_ARCH_FLAGS += -D$(ARCH) |
| 279 | else |
| 280 | CPP_ARCH_FLAGS += -D_$(ARCH)_ |
| 281 | endif |
| 282 | |
| 283 | CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \ |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 284 | -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT |
| 285 | |
| 286 | ifeq ($(ARCH_DATA_MODEL), 64) |
| 287 | CPPFLAGS_COMMON += -D_LP64=1 |
| 288 | endif |
| 289 | |
ohair | 5a91666 | 2009-07-08 09:11:24 -0700 | [diff] [blame] | 290 | CPPFLAGS_OPT = -DNDEBUG |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 291 | CPPFLAGS_DBG = -DDEBUG |
ohair | 850fb25 | 2008-07-30 19:40:57 -0700 | [diff] [blame] | 292 | ifneq ($(PRODUCT), java) |
| 293 | CPPFLAGS_DBG += -DLOGGING |
| 294 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 295 | |
| 296 | ifdef LIBRARY |
| 297 | # Libraries need to locate other libraries at runtime, and you can tell |
| 298 | # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) |
| 299 | # buried inside the .so. The $ORIGIN says to look relative to where |
| 300 | # the library itself is and it can be followed with relative paths from |
| 301 | # that. By default we always look in $ORIGIN, optionally we add relative |
| 302 | # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. |
| 303 | # On Linux we add a flag -z origin, not sure if this is necessary, but |
| 304 | # doesn't seem to hurt. |
| 305 | # The environment variable LD_LIBRARY_PATH will over-ride these runpaths. |
| 306 | # Try: 'readelf -d lib*.so' to see these settings in a library. |
| 307 | # |
dholmes | 70a4d1a | 2011-03-16 18:54:50 -0400 | [diff] [blame] | 308 | Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin |
| 309 | Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin |
| 310 | Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin |
| 311 | Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin |
| 312 | Z_ORIGIN_FLAG/arm = |
| 313 | Z_ORIGIN_FLAG/ppc = |
| 314 | Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin |
| 315 | |
| 316 | LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY)) |
| 317 | |
| 318 | LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN |
| 319 | LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%) |
| 320 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 321 | endif |
| 322 | |
| 323 | EXTRA_LIBS += -lc |
| 324 | |
gbenson | 24e3a5d | 2009-10-15 13:27:59 +0100 | [diff] [blame] | 325 | LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 326 | LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) |
| 327 | |
| 328 | # |
| 329 | # -L paths for finding and -ljava |
| 330 | # |
| 331 | LDFLAGS_OPT = -Xlinker -O1 |
| 332 | LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) |
| 333 | LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX) |
| 334 | |
| 335 | # |
| 336 | # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always |
| 337 | # statically link libgcc but will print a warning with the flag. We don't |
| 338 | # want the warning, so check gcc version first. |
| 339 | # |
ohair | e74b859 | 2011-04-21 18:26:04 -0700 | [diff] [blame] | 340 | ifeq ($(CC_MAJORVER),3) |
| 341 | OTHER_LDFLAGS += -static-libgcc |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 342 | endif |
| 343 | |
| 344 | # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) |
| 345 | # (See Rules.gmk) The gcc 5 compiler might have an option for this? |
| 346 | AUTOMATIC_PCH_OPTION = |
| 347 | |
| 348 | # |
| 349 | # Post Processing of libraries/executables |
| 350 | # |
| 351 | ifeq ($(VARIANT), OPT) |
| 352 | ifneq ($(NO_STRIP), true) |
aph | d46bd76 | 2009-04-17 15:56:20 +0100 | [diff] [blame] | 353 | ifneq ($(DEBUG_BINARIES), true) |
| 354 | # Debug 'strip -g' leaves local function Elf symbols (better stack |
| 355 | # traces) |
| 356 | POST_STRIP_PROCESS = $(STRIP) -g |
| 357 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 358 | endif |
| 359 | endif |
| 360 | |
| 361 | # |
| 362 | # Use: ld $(LD_MAPFILE_FLAG) mapfile *.o |
| 363 | # |
| 364 | LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker |
| 365 | |
| 366 | # |
| 367 | # Support for Quantify. |
| 368 | # |
| 369 | ifdef QUANTIFY |
| 370 | QUANTIFY_CMD = quantify |
| 371 | QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes |
| 372 | LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) |
| 373 | endif |
| 374 | |
| 375 | # |
| 376 | # Path and option to link against the VM, if you have to. Note that |
| 377 | # there are libraries that link against only -ljava, but they do get |
| 378 | # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas |
| 379 | # the library itself should not. |
| 380 | # |
| 381 | VM_NAME = server |
| 382 | JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm |
| 383 | JAVALIB = -ljava $(JVMLIB) |
| 384 | |
| 385 | # |
| 386 | # We want to privatize JVM symbols on Solaris. This is so the user can |
| 387 | # write a function called FindClass and this should not override the |
| 388 | # FindClass that is inside the JVM. At this point in time we are not |
| 389 | # concerned with other JNI libraries because we hope that there will |
| 390 | # not be as many clashes there. |
| 391 | # |
| 392 | PRIVATIZE_JVM_SYMBOLS = false |
| 393 | |
| 394 | USE_PTHREADS = true |
| 395 | override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME |
| 396 | override AWT_RUNPATH = |
| 397 | override HAVE_ALTZONE = false |
| 398 | override HAVE_FILIOH = false |
| 399 | override HAVE_GETHRTIME = false |
| 400 | override HAVE_GETHRVTIME = false |
| 401 | override HAVE_SIGIGNORE = true |
| 402 | override LEX_LIBRARY = -lfl |
| 403 | ifeq ($(STATIC_CXX),true) |
| 404 | override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic |
| 405 | else |
| 406 | override LIBCXX = -lstdc++ |
| 407 | endif |
| 408 | override LIBPOSIX4 = |
| 409 | override LIBSOCKET = |
martin | d5089e0 | 2010-06-10 15:54:25 -0700 | [diff] [blame] | 410 | override LIBNSL = |
okutsu | 953b5b2 | 2011-10-05 15:13:40 +0900 | [diff] [blame] | 411 | override LIBSCF = |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 412 | override LIBTHREAD = |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 413 | override LIBDL = -ldl |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 414 | override MOOT_PRIORITIES = true |
| 415 | override NO_INTERRUPTIBLE_IO = true |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 416 | ifeq ($(ARCH), amd64) |
| 417 | override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 |
| 418 | else |
| 419 | override OPENWIN_LIB = $(OPENWIN_HOME)/lib |
| 420 | endif |
| 421 | override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER |
| 422 | override SUN_CMM_SUBDIR = |
| 423 | override THREADS_FLAG = native |
| 424 | override USE_GNU_M4 = true |
| 425 | override USING_GNU_TAR = true |
| 426 | override WRITE_LIBVERSION = false |
| 427 | |
| 428 | # USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the |
| 429 | # resulting resolved absolute name of the executable in the environment |
| 430 | # variable EXECNAME. That executable name is then used that to locate the |
| 431 | # installation area. |
| 432 | override USE_EXECNAME = true |
| 433 | |
| 434 | # If your platform has DPS, it will have Type1 fonts too, in which case |
| 435 | # it is best to enable DPS support until such time as 2D's rasteriser |
| 436 | # can fully handle Type1 fonts in all cases. Default is "yes". |
| 437 | # HAVE_DPS should only be "no" if the platform has no DPS headers or libs |
| 438 | # DPS (Displayable PostScript) is available on Solaris machines |
| 439 | HAVE_DPS = no |
| 440 | |
| 441 | # |
| 442 | # Japanese manpages |
| 443 | # |
| 444 | JA_SOURCE_ENCODING = eucJP |
ogino | 55ad416 | 2011-04-26 21:46:20 -0700 | [diff] [blame] | 445 | JA_TARGET_ENCODINGS = UTF-8 |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 446 | |
| 447 | # Settings for the JDI - Serviceability Agent binding. |
| 448 | HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) |
| 449 | SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) |
dcubed | 46b9922 | 2011-09-20 19:16:21 -0700 | [diff] [blame] | 450 | SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo |
dcubed | 768ddaa | 2012-03-23 09:27:44 -0700 | [diff] [blame] | 451 | SA_DIZ_NAME = $(LIB_PREFIX)saproc.diz |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 452 | |
| 453 | # The JDI - Serviceability Agent binding is not currently supported |
| 454 | # on Linux-ia64. |
| 455 | ifeq ($(ARCH), ia64) |
| 456 | INCLUDE_SA = false |
| 457 | else |
| 458 | INCLUDE_SA = true |
| 459 | endif |
| 460 | |
dholmes | 70a4d1a | 2011-03-16 18:54:50 -0400 | [diff] [blame] | 461 | ifdef CROSS_COMPILE_ARCH |
| 462 | # X11 headers are not under /usr/include |
| 463 | OTHER_CFLAGS += -I$(OPENWIN_HOME)/include |
| 464 | OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include |
| 465 | OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include |
| 466 | endif |