make/linux/makefiles/defs.make

Wed, 02 Apr 2014 11:24:44 -0700

author
kvn
date
Wed, 02 Apr 2014 11:24:44 -0700
changeset 6538
56e7f5560e60
parent 6452
faf0c78e906b
child 6876
710a3c8b516e
child 7598
ddce0b7cee93
permissions
-rw-r--r--

8036767: PPC64: Support for little endian execution model
Reviewed-by: goetz, kvn, dholmes, simonis
Contributed-by: asmundak@google.com

duke@435 1 #
drchase@4942 2 # Copyright (c) 2006, 2013, 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
duke@435 72 ifeq ($(ARCH), sparc64)
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
dholmes@4095 86 # amd64/x86_64
dholmes@4095 87 ifneq (,$(findstring $(ARCH), amd64 x86_64))
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 HS_ARCH = x86
duke@435 94 else
duke@435 95 ARCH_DATA_MODEL = 32
duke@435 96 PLATFORM = linux-i586
duke@435 97 VM_PLATFORM = linux_i486
duke@435 98 HS_ARCH = x86
duke@435 99 # We have to reset ARCH to i686 since SRCARCH relies on it
drchase@4942 100 ARCH = i686
duke@435 101 endif
duke@435 102 endif
duke@435 103
dholmes@4095 104 # i686/i586 ie 32-bit x86
dholmes@4095 105 ifneq (,$(findstring $(ARCH), i686 i586))
duke@435 106 ARCH_DATA_MODEL = 32
duke@435 107 PLATFORM = linux-i586
duke@435 108 VM_PLATFORM = linux_i486
duke@435 109 HS_ARCH = x86
duke@435 110 endif
duke@435 111
bobv@2036 112 # ARM
bobv@2036 113 ifeq ($(ARCH), arm)
bobv@2036 114 ARCH_DATA_MODEL = 32
bobv@2036 115 PLATFORM = linux-arm
bobv@2036 116 VM_PLATFORM = linux_arm
bobv@2036 117 HS_ARCH = arm
bobv@2036 118 endif
bobv@2036 119
bobv@2036 120 # PPC
bobv@2036 121 ifeq ($(ARCH), ppc)
bobv@2036 122 ARCH_DATA_MODEL = 32
bobv@2036 123 PLATFORM = linux-ppc
bobv@2036 124 VM_PLATFORM = linux_ppc
bobv@2036 125 HS_ARCH = ppc
bobv@2036 126 endif
bobv@2036 127
simonis@6452 128 # PPC64
simonis@6452 129 ifeq ($(ARCH), ppc64)
simonis@6452 130 ARCH_DATA_MODEL = 64
simonis@6452 131 MAKE_ARGS += LP64=1
simonis@6452 132 PLATFORM = linux-ppc64
simonis@6452 133 VM_PLATFORM = linux_ppc64
simonis@6452 134 HS_ARCH = ppc
simonis@6452 135 endif
simonis@6452 136
erikj@3649 137 # On 32 bit linux we build server and client, on 64 bit just server.
erikj@3649 138 ifeq ($(JVM_VARIANTS),)
erikj@3649 139 ifeq ($(ARCH_DATA_MODEL), 32)
erikj@3649 140 JVM_VARIANTS:=client,server
erikj@3649 141 JVM_VARIANT_CLIENT:=true
erikj@3649 142 JVM_VARIANT_SERVER:=true
erikj@3649 143 else
erikj@3649 144 JVM_VARIANTS:=server
erikj@3649 145 JVM_VARIANT_SERVER:=true
erikj@3649 146 endif
erikj@3649 147 endif
erikj@3649 148
dcubed@3150 149 # determine if HotSpot is being built in JDK6 or earlier version
dcubed@3150 150 JDK6_OR_EARLIER=0
dcubed@3150 151 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
dcubed@3150 152 # if the longer variable names (newer build style) are set, then check those
dcubed@3150 153 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
dcubed@3150 154 JDK6_OR_EARLIER=1
dcubed@3150 155 endif
dcubed@3150 156 else
dcubed@3150 157 # the longer variables aren't set so check the shorter variable names
dcubed@3150 158 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
dcubed@3150 159 JDK6_OR_EARLIER=1
dcubed@3150 160 endif
dcubed@3150 161 endif
dcubed@3150 162
dcubed@3150 163 ifeq ($(JDK6_OR_EARLIER),0)
dcubed@3724 164 # Full Debug Symbols is supported on JDK7 or newer.
dcubed@3725 165 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
dcubed@3725 166 # builds is enabled with debug info files ZIP'ed to save space. For
dcubed@3725 167 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
dcubed@3725 168 # debug build without debug info isn't very useful.
dcubed@3725 169 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
dcubed@3725 170 #
dcubed@3725 171 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
dcubed@3725 172 # disabled for a BUILD_FLAVOR == product build.
dcubed@3725 173 #
dcubed@3725 174 # Note: Use of a different variable name for the FDS override option
dcubed@3725 175 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
dcubed@3725 176 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
dcubed@3725 177 # in options via environment variables, use of distinct variables
dcubed@3725 178 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
dcubed@3725 179 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
dcubed@3725 180 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
dcubed@3725 181 # the same variable name is used, then different values can be picked
dcubed@3725 182 # up by different parts of the build. Just to be clear, we only need
dcubed@3725 183 # two variable names because the incoming option value can be
dcubed@3725 184 # overridden in some situations, e.g., a BUILD_FLAVOR != product
dcubed@3725 185 # build.
dcubed@3150 186
dholmes@4243 187 # Due to the multiple sub-make processes that occur this logic gets
dholmes@4243 188 # executed multiple times. We reduce the noise by at least checking that
dholmes@4243 189 # BUILD_FLAVOR has been set.
dholmes@4243 190 ifneq ($(BUILD_FLAVOR),)
dholmes@4243 191 ifeq ($(BUILD_FLAVOR), product)
dholmes@4243 192 FULL_DEBUG_SYMBOLS ?= 1
dholmes@4243 193 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
dholmes@4243 194 else
dholmes@4243 195 # debug variants always get Full Debug Symbols (if available)
dholmes@4243 196 ENABLE_FULL_DEBUG_SYMBOLS = 1
dholmes@4243 197 endif
dholmes@4243 198 _JUNK_ := $(shell \
dholmes@4243 199 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dholmes@4243 200 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
dcubed@3724 201
dholmes@4243 202 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dholmes@4243 203 # Default OBJCOPY comes from GNU Binutils on Linux
dholmes@4243 204 ifeq ($(CROSS_COMPILE_ARCH),)
dholmes@4243 205 DEF_OBJCOPY=/usr/bin/objcopy
dholmes@4243 206 else
dholmes@4243 207 # Assume objcopy is part of the cross-compilation toolset
dholmes@4243 208 ifneq ($(ALT_COMPILER_PATH),)
dholmes@4243 209 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
dholmes@4243 210 endif
dholmes@4243 211 endif
dcubed@3724 212 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
dcubed@3724 213 ifneq ($(ALT_OBJCOPY),)
dcubed@3724 214 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
dcubed@3724 215 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
dcubed@3724 216 endif
dcubed@3724 217
dholmes@4243 218 ifeq ($(OBJCOPY),)
dholmes@4243 219 _JUNK_ := $(shell \
dholmes@4243 220 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
dholmes@4243 221 ENABLE_FULL_DEBUG_SYMBOLS=0
dholmes@4243 222 _JUNK_ := $(shell \
dholmes@4243 223 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dholmes@4243 224 else
dholmes@4243 225 _JUNK_ := $(shell \
dholmes@4243 226 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
dcubed@3724 227
dholmes@4243 228 # Library stripping policies for .debuginfo configs:
dholmes@4243 229 # all_strip - strips everything from the library
dholmes@4243 230 # min_strip - strips most stuff from the library; leaves minimum symbols
dholmes@4243 231 # no_strip - does not strip the library at all
dholmes@4243 232 #
dholmes@4243 233 # Oracle security policy requires "all_strip". A waiver was granted on
dholmes@4243 234 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
dholmes@4243 235 #
dholmes@4243 236 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
dholmes@4243 237 #
dholmes@4243 238 STRIP_POLICY ?= min_strip
dcubed@3724 239
dholmes@4243 240 _JUNK_ := $(shell \
dholmes@4243 241 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
dcubed@3724 242
dholmes@4243 243 ZIP_DEBUGINFO_FILES ?= 1
dcubed@3724 244
dholmes@4243 245 _JUNK_ := $(shell \
dholmes@4243 246 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
dholmes@4243 247 endif
dholmes@4243 248 endif # ENABLE_FULL_DEBUG_SYMBOLS=1
dholmes@4243 249 endif # BUILD_FLAVOR
dholmes@4243 250 endif # JDK_6_OR_EARLIER
dcubed@3150 251
duke@435 252 JDK_INCLUDE_SUBDIR=linux
duke@435 253
never@3156 254 # Library suffix
never@3156 255 LIBRARY_SUFFIX=so
never@3156 256
duke@435 257 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
kvn@1450 258
kvn@1450 259 # client and server subdirectories have symbolic links to ../libjsig.so
never@3156 260 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
dcubed@3724 261 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 262 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 263 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
dcubed@3724 264 else
dcubed@3724 265 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
dcubed@3724 266 endif
dcubed@3150 267 endif
bobv@2036 268 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
kvn@3044 269 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
jprovino@4165 270 EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
kvn@1450 271
simonis@6452 272 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)
erikj@3649 273 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
erikj@3649 274 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3724 275 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 276 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 277 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
dcubed@3724 278 else
dcubed@3724 279 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
dcubed@3724 280 endif
dcubed@3150 281 endif
bobv@2036 282 endif
bobv@2036 283
erikj@3649 284 ifeq ($(JVM_VARIANT_CLIENT),true)
erikj@3649 285 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
erikj@3649 286 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3726 287 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3726 288 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3726 289 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
dcubed@3726 290 else
dcubed@3726 291 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
dcubed@3150 292 endif
drchase@4942 293 endif
duke@435 294 endif
bobv@2036 295
jprovino@4165 296 ifeq ($(JVM_VARIANT_MINIMAL1),true)
jprovino@4165 297 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
jprovino@4165 298 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
jprovino@4165 299
jprovino@4165 300 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
jprovino@4165 301 ifeq ($(ZIP_DEBUGINFO_FILES),1)
jprovino@4165 302 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
jprovino@4165 303 else
jprovino@4165 304 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
jprovino@4165 305 endif
drchase@4942 306 endif
jprovino@4165 307 endif
jprovino@4165 308
bobv@2036 309 # Serviceability Binaries
bobv@2036 310 # No SA Support for PPC, IA64, ARM or zero
never@3156 311 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
drchase@4942 312 $(EXPORT_LIB_DIR)/sa-jdi.jar
never@3156 313 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
drchase@4942 314 $(EXPORT_LIB_DIR)/sa-jdi.jar
dcubed@3724 315 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 316 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 317 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
dcubed@3724 318 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
dcubed@3724 319 else
dcubed@3724 320 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
dcubed@3724 321 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
dcubed@3724 322 endif
dcubed@3150 323 endif
drchase@4942 324 ADD_SA_BINARIES/ppc =
drchase@4942 325 ADD_SA_BINARIES/ia64 =
drchase@4942 326 ADD_SA_BINARIES/arm =
drchase@4942 327 ADD_SA_BINARIES/zero =
bobv@2036 328
bpittore@4028 329 -include $(HS_ALT_MAKE)/linux/makefiles/defs.make
bpittore@4028 330
bobv@2036 331 EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
bobv@2036 332
bobv@2036 333

mercurial