make/linux/makefiles/defs.make

Wed, 10 Jul 2013 09:14:25 -0700

author
simonis
date
Wed, 10 Jul 2013 09:14:25 -0700
changeset 6452
faf0c78e906b
parent 4942
f36e073d56a4
child 6538
56e7f5560e60
permissions
-rw-r--r--

8019922: PPC64 (part 8): Implement Linux/PPC64 support in HotSpot makefiles
Summary: HotSpot make changes to build the HotSpot on Linux/PPC64
Reviewed-by: dholmes, kvn

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

mercurial