make/linux/makefiles/defs.make

Tue, 03 Mar 2020 12:57:23 +0000

author
andrew
date
Tue, 03 Mar 2020 12:57:23 +0000
changeset 9896
1b8c45b8216a
parent 9357
0ef29304c2b4
child 9448
73d689add964
permissions
-rw-r--r--

Merge

duke@435 1 #
dlong@7598 2 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
drchase@4942 22 #
duke@435 23 #
duke@435 24
duke@435 25 # The common definitions for hotspot linux builds.
duke@435 26 # Include the top level defs.make under make directory instead of this one.
duke@435 27 # This file is included into make/defs.make.
duke@435 28
duke@435 29 SLASH_JAVA ?= /java
duke@435 30
duke@435 31 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
dholmes@4095 32
dholmes@4095 33 # ARCH can be set explicitly in spec.gmk
dholmes@4095 34 ifndef ARCH
dholmes@4095 35 ARCH := $(shell uname -m)
kvn@6538 36 # Fold little endian PowerPC64 into big-endian (if ARCH is set in
kvn@6538 37 # hotspot-spec.gmk, this will be done by the configure script).
kvn@6538 38 ifeq ($(ARCH),ppc64le)
kvn@6538 39 ARCH := ppc64
kvn@6538 40 endif
dholmes@4095 41 endif
dholmes@4095 42
dholmes@4095 43 PATH_SEP ?= :
dholmes@4095 44
duke@435 45 ifeq ($(LP64), 1)
duke@435 46 ARCH_DATA_MODEL ?= 64
duke@435 47 else
duke@435 48 ARCH_DATA_MODEL ?= 32
duke@435 49 endif
duke@435 50
never@1445 51 # zero
erikj@3649 52 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
never@1445 53 ifeq ($(ARCH_DATA_MODEL), 64)
never@1445 54 MAKE_ARGS += LP64=1
never@1445 55 endif
never@1445 56 PLATFORM = linux-zero
never@1445 57 VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH))
never@1445 58 HS_ARCH = zero
never@1445 59 ARCH = zero
never@1445 60 endif
never@1445 61
duke@435 62 # ia64
duke@435 63 ifeq ($(ARCH), ia64)
duke@435 64 ARCH_DATA_MODEL = 64
duke@435 65 MAKE_ARGS += LP64=1
duke@435 66 PLATFORM = linux-ia64
duke@435 67 VM_PLATFORM = linux_ia64
duke@435 68 HS_ARCH = ia64
duke@435 69 endif
duke@435 70
duke@435 71 # sparc
gthornbr@8198 72 ifneq (,$(findstring $(ARCH), sparc))
duke@435 73 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 74 ARCH_DATA_MODEL = 64
duke@435 75 MAKE_ARGS += LP64=1
duke@435 76 PLATFORM = linux-sparcv9
duke@435 77 VM_PLATFORM = linux_sparcv9
duke@435 78 else
duke@435 79 ARCH_DATA_MODEL = 32
duke@435 80 PLATFORM = linux-sparc
duke@435 81 VM_PLATFORM = linux_sparc
duke@435 82 endif
duke@435 83 HS_ARCH = sparc
duke@435 84 endif
duke@435 85
gthornbr@8198 86 # i686/i586 and amd64/x86_64
gthornbr@8198 87 ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586))
duke@435 88 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 89 ARCH_DATA_MODEL = 64
duke@435 90 MAKE_ARGS += LP64=1
duke@435 91 PLATFORM = linux-amd64
duke@435 92 VM_PLATFORM = linux_amd64
duke@435 93 else
duke@435 94 ARCH_DATA_MODEL = 32
duke@435 95 PLATFORM = linux-i586
duke@435 96 VM_PLATFORM = linux_i486
duke@435 97 endif
gthornbr@8198 98 HS_ARCH = x86
duke@435 99 endif
duke@435 100
gthornbr@8198 101 # PPC
gthornbr@8200 102 # Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
gthornbr@8200 103 # 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
gthornbr@8200 104 ifneq (,$(findstring $(ARCH), ppc ppc64))
gthornbr@8198 105 ifeq ($(ARCH_DATA_MODEL), 64)
gthornbr@8198 106 MAKE_ARGS += LP64=1
gthornbr@8198 107 PLATFORM = linux-ppc64
gthornbr@8198 108 VM_PLATFORM = linux_ppc64
gthornbr@8198 109 else
gthornbr@8198 110 ARCH_DATA_MODEL = 32
gthornbr@8198 111 PLATFORM = linux-ppc
gthornbr@8198 112 VM_PLATFORM = linux_ppc
gthornbr@8198 113 endif
gthornbr@8198 114 HS_ARCH = ppc
simonis@6452 115 endif
simonis@6452 116
erikj@3649 117 # On 32 bit linux we build server and client, on 64 bit just server.
erikj@3649 118 ifeq ($(JVM_VARIANTS),)
erikj@3649 119 ifeq ($(ARCH_DATA_MODEL), 32)
erikj@3649 120 JVM_VARIANTS:=client,server
erikj@3649 121 JVM_VARIANT_CLIENT:=true
erikj@3649 122 JVM_VARIANT_SERVER:=true
erikj@3649 123 else
erikj@3649 124 JVM_VARIANTS:=server
erikj@3649 125 JVM_VARIANT_SERVER:=true
erikj@3649 126 endif
erikj@3649 127 endif
erikj@3649 128
dcubed@3150 129 # determine if HotSpot is being built in JDK6 or earlier version
dcubed@3150 130 JDK6_OR_EARLIER=0
dcubed@3150 131 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
dcubed@3150 132 # if the longer variable names (newer build style) are set, then check those
dcubed@3150 133 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
dcubed@3150 134 JDK6_OR_EARLIER=1
dcubed@3150 135 endif
dcubed@3150 136 else
dcubed@3150 137 # the longer variables aren't set so check the shorter variable names
dcubed@3150 138 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
dcubed@3150 139 JDK6_OR_EARLIER=1
dcubed@3150 140 endif
dcubed@3150 141 endif
dcubed@3150 142
dcubed@3150 143 ifeq ($(JDK6_OR_EARLIER),0)
dcubed@3724 144 # Full Debug Symbols is supported on JDK7 or newer.
dcubed@3725 145 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
dcubed@3725 146 # builds is enabled with debug info files ZIP'ed to save space. For
dcubed@3725 147 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
dcubed@3725 148 # debug build without debug info isn't very useful.
dcubed@3725 149 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
dcubed@3725 150 #
dcubed@3725 151 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
dcubed@3725 152 # disabled for a BUILD_FLAVOR == product build.
dcubed@3725 153 #
dcubed@3725 154 # Note: Use of a different variable name for the FDS override option
dcubed@3725 155 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
dcubed@3725 156 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
dcubed@3725 157 # in options via environment variables, use of distinct variables
dcubed@3725 158 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
dcubed@3725 159 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
dcubed@3725 160 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
dcubed@3725 161 # the same variable name is used, then different values can be picked
dcubed@3725 162 # up by different parts of the build. Just to be clear, we only need
dcubed@3725 163 # two variable names because the incoming option value can be
dcubed@3725 164 # overridden in some situations, e.g., a BUILD_FLAVOR != product
dcubed@3725 165 # build.
dcubed@3150 166
dholmes@4243 167 # Due to the multiple sub-make processes that occur this logic gets
dholmes@4243 168 # executed multiple times. We reduce the noise by at least checking that
dholmes@4243 169 # BUILD_FLAVOR has been set.
dholmes@4243 170 ifneq ($(BUILD_FLAVOR),)
dholmes@4243 171 ifeq ($(BUILD_FLAVOR), product)
dholmes@4243 172 FULL_DEBUG_SYMBOLS ?= 1
dholmes@4243 173 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
dholmes@4243 174 else
dholmes@4243 175 # debug variants always get Full Debug Symbols (if available)
dholmes@4243 176 ENABLE_FULL_DEBUG_SYMBOLS = 1
dholmes@4243 177 endif
dholmes@4243 178 _JUNK_ := $(shell \
dholmes@4243 179 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dholmes@4243 180 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
dcubed@3724 181
dholmes@4243 182 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dholmes@4243 183 # Default OBJCOPY comes from GNU Binutils on Linux
dholmes@4243 184 ifeq ($(CROSS_COMPILE_ARCH),)
dholmes@4243 185 DEF_OBJCOPY=/usr/bin/objcopy
dholmes@4243 186 else
dholmes@4243 187 # Assume objcopy is part of the cross-compilation toolset
dholmes@4243 188 ifneq ($(ALT_COMPILER_PATH),)
dholmes@4243 189 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
dholmes@4243 190 endif
dholmes@4243 191 endif
dcubed@3724 192 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
dcubed@3724 193 ifneq ($(ALT_OBJCOPY),)
dcubed@3724 194 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
dcubed@3724 195 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
dcubed@3724 196 endif
dcubed@3724 197
dholmes@4243 198 ifeq ($(OBJCOPY),)
dholmes@4243 199 _JUNK_ := $(shell \
dholmes@4243 200 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
dholmes@4243 201 ENABLE_FULL_DEBUG_SYMBOLS=0
dholmes@4243 202 _JUNK_ := $(shell \
dholmes@4243 203 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dholmes@4243 204 else
dholmes@4243 205 _JUNK_ := $(shell \
dholmes@4243 206 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
dcubed@3724 207
dholmes@4243 208 # Library stripping policies for .debuginfo configs:
dholmes@4243 209 # all_strip - strips everything from the library
dholmes@4243 210 # min_strip - strips most stuff from the library; leaves minimum symbols
dholmes@4243 211 # no_strip - does not strip the library at all
dholmes@4243 212 #
dholmes@4243 213 # Oracle security policy requires "all_strip". A waiver was granted on
dholmes@4243 214 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
dholmes@4243 215 #
dholmes@4243 216 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
dholmes@4243 217 #
dholmes@4243 218 STRIP_POLICY ?= min_strip
dcubed@3724 219
dholmes@4243 220 _JUNK_ := $(shell \
dholmes@4243 221 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
dcubed@3724 222
dholmes@4243 223 ZIP_DEBUGINFO_FILES ?= 1
dcubed@3724 224
dholmes@4243 225 _JUNK_ := $(shell \
dholmes@4243 226 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
dholmes@4243 227 endif
dholmes@4243 228 endif # ENABLE_FULL_DEBUG_SYMBOLS=1
dholmes@4243 229 endif # BUILD_FLAVOR
dholmes@4243 230 endif # JDK_6_OR_EARLIER
dcubed@3150 231
duke@435 232 JDK_INCLUDE_SUBDIR=linux
duke@435 233
never@3156 234 # Library suffix
never@3156 235 LIBRARY_SUFFIX=so
never@3156 236
duke@435 237 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
kvn@1450 238
kvn@1450 239 # client and server subdirectories have symbolic links to ../libjsig.so
never@3156 240 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
dcubed@3724 241 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 242 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 243 ifeq ($(ZIP_DEBUGINFO_FILES),1)
sgehwolf@9357 244 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
sgehwolf@9357 245 else
sgehwolf@9357 246 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
sgehwolf@9357 247 endif
dcubed@3724 248 endif
dcubed@3150 249 endif
bobv@2036 250 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
kvn@3044 251 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
jprovino@4165 252 EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
kvn@1450 253
simonis@6452 254 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)
erikj@3649 255 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
erikj@3649 256 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3724 257 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 258 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 259 ifeq ($(ZIP_DEBUGINFO_FILES),1)
sgehwolf@9357 260 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
sgehwolf@9357 261 else
sgehwolf@9357 262 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
sgehwolf@9357 263 endif
dcubed@3724 264 endif
dcubed@3150 265 endif
bobv@2036 266 endif
bobv@2036 267
erikj@3649 268 ifeq ($(JVM_VARIANT_CLIENT),true)
erikj@3649 269 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
erikj@3649 270 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3726 271 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 272 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 273 ifeq ($(ZIP_DEBUGINFO_FILES),1)
sgehwolf@9357 274 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
sgehwolf@9357 275 else
sgehwolf@9357 276 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
sgehwolf@9357 277 endif
dcubed@3150 278 endif
drchase@4942 279 endif
duke@435 280 endif
bobv@2036 281
jprovino@4165 282 ifeq ($(JVM_VARIANT_MINIMAL1),true)
jprovino@4165 283 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
jprovino@4165 284 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
jprovino@4165 285
jprovino@4165 286 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 287 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 288 ifeq ($(ZIP_DEBUGINFO_FILES),1)
sgehwolf@9357 289 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
sgehwolf@9357 290 else
sgehwolf@9357 291 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
sgehwolf@9357 292 endif
jprovino@4165 293 endif
drchase@4942 294 endif
jprovino@4165 295 endif
jprovino@4165 296
bobv@2036 297 # Serviceability Binaries
bobv@2036 298 # No SA Support for PPC, IA64, ARM or zero
never@3156 299 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
drchase@4942 300 $(EXPORT_LIB_DIR)/sa-jdi.jar
never@3156 301 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
drchase@4942 302 $(EXPORT_LIB_DIR)/sa-jdi.jar
dcubed@3724 303 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 304 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 305 ifeq ($(ZIP_DEBUGINFO_FILES),1)
sgehwolf@9357 306 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
sgehwolf@9357 307 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
sgehwolf@9357 308 else
sgehwolf@9357 309 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
sgehwolf@9357 310 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
sgehwolf@9357 311 endif
dcubed@3724 312 endif
dcubed@3150 313 endif
drchase@4942 314 ADD_SA_BINARIES/ppc =
drchase@4942 315 ADD_SA_BINARIES/ia64 =
drchase@4942 316 ADD_SA_BINARIES/arm =
drchase@4942 317 ADD_SA_BINARIES/zero =
bobv@2036 318
bpittore@4028 319 -include $(HS_ALT_MAKE)/linux/makefiles/defs.make
bpittore@4028 320
bobv@2036 321 EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
bobv@2036 322
bobv@2036 323

mercurial