make/linux/makefiles/defs.make

Thu, 24 May 2018 20:42:10 +0800

author
aoqi
date
Thu, 24 May 2018 20:42:10 +0800
changeset 8869
9e933050faaf
parent 8856
ac27a9c85bea
child 9139
da33de9f115e
permissions
-rw-r--r--

#7104 ARCH should not be mips64 on other platform

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

mercurial