Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/linux/makefiles/defs.make
32284 views
#1# Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# The common definitions for hotspot linux builds.25# Include the top level defs.make under make directory instead of this one.26# This file is included into make/defs.make.2728SLASH_JAVA ?= /java2930# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name3132# ARCH can be set explicitly in spec.gmk33ifndef ARCH34ARCH := $(shell uname -m)35# Fold little endian PowerPC64 into big-endian (if ARCH is set in36# hotspot-spec.gmk, this will be done by the configure script).37ifeq ($(ARCH),ppc64le)38ARCH := ppc6439endif40endif4142PATH_SEP ?= :4344ifeq ($(LP64), 1)45ARCH_DATA_MODEL ?= 6446else47ARCH_DATA_MODEL ?= 3248endif4950# zero51ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)52ifeq ($(ARCH_DATA_MODEL), 64)53MAKE_ARGS += LP64=154endif55PLATFORM = linux-zero56VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH))57HS_ARCH = zero58ARCH = zero59endif6061# ia6462ifeq ($(ARCH), ia64)63ARCH_DATA_MODEL = 6464MAKE_ARGS += LP64=165PLATFORM = linux-ia6466VM_PLATFORM = linux_ia6467HS_ARCH = ia6468endif6970# sparc71ifneq (,$(findstring $(ARCH), sparc))72ifeq ($(ARCH_DATA_MODEL), 64)73ARCH_DATA_MODEL = 6474MAKE_ARGS += LP64=175PLATFORM = linux-sparcv976VM_PLATFORM = linux_sparcv977else78ARCH_DATA_MODEL = 3279PLATFORM = linux-sparc80VM_PLATFORM = linux_sparc81endif82HS_ARCH = sparc83endif8485# i686/i586 and amd64/x86_6486ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586))87ifeq ($(ARCH_DATA_MODEL), 64)88ARCH_DATA_MODEL = 6489MAKE_ARGS += LP64=190PLATFORM = linux-amd6491VM_PLATFORM = linux_amd6492else93ARCH_DATA_MODEL = 3294PLATFORM = linux-i58695VM_PLATFORM = linux_i48696endif97HS_ARCH = x8698endif99100# PPC101# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but102# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!103ifneq (,$(findstring $(ARCH), ppc ppc64))104ifeq ($(ARCH_DATA_MODEL), 64)105MAKE_ARGS += LP64=1106PLATFORM = linux-ppc64107VM_PLATFORM = linux_ppc64108else109ARCH_DATA_MODEL = 32110PLATFORM = linux-ppc111VM_PLATFORM = linux_ppc112endif113HS_ARCH = ppc114endif115116# AArch32117ifeq ($(ARCH), aarch32)118ARCH_DATA_MODEL = 32119PLATFORM = linux-aarch32120VM_PLATFORM = linux_aarch32121HS_ARCH = aarch32122endif123124# AARCH64125ifeq ($(ARCH), aarch64)126ARCH_DATA_MODEL = 64127MAKE_ARGS += LP64=1128PLATFORM = linux-aarch64129VM_PLATFORM = linux_aarch64130HS_ARCH = aarch64131endif132133# On 32 bit linux we build server and client, on 64 bit just server.134ifeq ($(JVM_VARIANTS),)135ifeq ($(ARCH_DATA_MODEL), 32)136JVM_VARIANTS:=client,server137JVM_VARIANT_CLIENT:=true138JVM_VARIANT_SERVER:=true139else140JVM_VARIANTS:=server141JVM_VARIANT_SERVER:=true142endif143endif144145# determine if HotSpot is being built in JDK6 or earlier version146JDK6_OR_EARLIER=0147ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"148# if the longer variable names (newer build style) are set, then check those149ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"150JDK6_OR_EARLIER=1151endif152else153# the longer variables aren't set so check the shorter variable names154ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"155JDK6_OR_EARLIER=1156endif157endif158159ifeq ($(JDK6_OR_EARLIER),0)160# Full Debug Symbols is supported on JDK7 or newer.161# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product162# builds is enabled with debug info files ZIP'ed to save space. For163# BUILD_FLAVOR != product builds, FDS is always enabled, after all a164# debug build without debug info isn't very useful.165# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.166#167# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be168# disabled for a BUILD_FLAVOR == product build.169#170# Note: Use of a different variable name for the FDS override option171# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS172# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass173# in options via environment variables, use of distinct variables174# prevents strange behaviours. For example, in a BUILD_FLAVOR !=175# product build, the FULL_DEBUG_SYMBOLS environment variable will be176# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If177# the same variable name is used, then different values can be picked178# up by different parts of the build. Just to be clear, we only need179# two variable names because the incoming option value can be180# overridden in some situations, e.g., a BUILD_FLAVOR != product181# build.182183# Due to the multiple sub-make processes that occur this logic gets184# executed multiple times. We reduce the noise by at least checking that185# BUILD_FLAVOR has been set.186ifneq ($(BUILD_FLAVOR),)187ifeq ($(BUILD_FLAVOR), product)188FULL_DEBUG_SYMBOLS ?= 1189ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)190else191# debug variants always get Full Debug Symbols (if available)192ENABLE_FULL_DEBUG_SYMBOLS = 1193endif194_JUNK_ := $(shell \195echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")196# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later197198ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)199# Default OBJCOPY comes from GNU Binutils on Linux200ifeq ($(CROSS_COMPILE_ARCH),)201DEF_OBJCOPY=/usr/bin/objcopy202else203# Assume objcopy is part of the cross-compilation toolset204ifneq ($(ALT_COMPILER_PATH),)205DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy206endif207endif208OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))209ifneq ($(ALT_OBJCOPY),)210_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")211OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))212endif213214ifeq ($(OBJCOPY),)215_JUNK_ := $(shell \216echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")217ENABLE_FULL_DEBUG_SYMBOLS=0218_JUNK_ := $(shell \219echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")220else221_JUNK_ := $(shell \222echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")223224# Library stripping policies for .debuginfo configs:225# all_strip - strips everything from the library226# min_strip - strips most stuff from the library; leaves minimum symbols227# no_strip - does not strip the library at all228#229# Oracle security policy requires "all_strip". A waiver was granted on230# 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.231#232# Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.233#234STRIP_POLICY ?= min_strip235236_JUNK_ := $(shell \237echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")238239ZIP_DEBUGINFO_FILES ?= 1240241_JUNK_ := $(shell \242echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")243endif244endif # ENABLE_FULL_DEBUG_SYMBOLS=1245endif # BUILD_FLAVOR246endif # JDK_6_OR_EARLIER247248JDK_INCLUDE_SUBDIR=linux249250# Library suffix251LIBRARY_SUFFIX=so252253EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html254255# client and server subdirectories have symbolic links to ../libjsig.so256EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)257ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)258ifneq ($(STRIP_POLICY),no_strip)259ifeq ($(ZIP_DEBUGINFO_FILES),1)260EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz261else262EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo263endif264endif265endif266EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server267EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client268EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal269270ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)271EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt272EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)273ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)274ifneq ($(STRIP_POLICY),no_strip)275ifeq ($(ZIP_DEBUGINFO_FILES),1)276EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz277else278EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo279endif280endif281endif282endif283284ifeq ($(JVM_VARIANT_CLIENT),true)285EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt286EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)287ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)288ifneq ($(STRIP_POLICY),no_strip)289ifeq ($(ZIP_DEBUGINFO_FILES),1)290EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz291else292EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo293endif294endif295endif296endif297298ifeq ($(JVM_VARIANT_MINIMAL1),true)299EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt300EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)301302ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)303ifneq ($(STRIP_POLICY),no_strip)304ifeq ($(ZIP_DEBUGINFO_FILES),1)305EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz306else307EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo308endif309endif310endif311endif312313# Serviceability Binaries314# No SA Support for PPC, IA64, ARM or zero315ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \316$(EXPORT_LIB_DIR)/sa-jdi.jar317ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \318$(EXPORT_LIB_DIR)/sa-jdi.jar319ADD_SA_BINARIES/aarch64 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \320$(EXPORT_LIB_DIR)/sa-jdi.jar321ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)322ifneq ($(STRIP_POLICY),no_strip)323ifeq ($(ZIP_DEBUGINFO_FILES),1)324ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz325ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz326ADD_SA_BINARIES/aarch64 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz327else328ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo329ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo330ADD_SA_BINARIES/aarch64 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo331endif332endif333endif334ADD_SA_BINARIES/ppc =335ADD_SA_BINARIES/ia64 =336ADD_SA_BINARIES/arm =337ADD_SA_BINARIES/zero =338339-include $(HS_ALT_MAKE)/linux/makefiles/defs.make340341EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))342343344345346