Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/bsd/makefiles/defs.make
32285 views
#1# Copyright (c) 2006, 2013, 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 bsd 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 name3132ifndef ARCH33ARCH := $(shell uname -m)34endif3536PATH_SEP = :37ifeq ($(LP64), 1)38ARCH_DATA_MODEL ?= 6439else40ARCH_DATA_MODEL ?= 3241endif4243# zero44ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)45ifeq ($(ARCH_DATA_MODEL), 64)46MAKE_ARGS += LP64=147endif48PLATFORM = bsd-zero49VM_PLATFORM = bsd_$(subst i386,i486,$(ZERO_LIBARCH))50HS_ARCH = zero51ARCH = zero52endif5354# ia6455ifeq ($(ARCH), ia64)56ARCH_DATA_MODEL = 6457MAKE_ARGS += LP64=158PLATFORM = bsd-ia6459VM_PLATFORM = bsd_ia6460HS_ARCH = ia6461endif6263# sparc64ifeq ($(ARCH), sparc64)65ifeq ($(ARCH_DATA_MODEL), 64)66ARCH_DATA_MODEL = 6467MAKE_ARGS += LP64=168PLATFORM = bsd-sparcv969VM_PLATFORM = bsd_sparcv970else71ARCH_DATA_MODEL = 3272PLATFORM = bsd-sparc73VM_PLATFORM = bsd_sparc74endif75HS_ARCH = sparc76endif7778# amd6479ifneq (,$(findstring $(ARCH), amd64 x86_64))80ifeq ($(ARCH_DATA_MODEL), 64)81ARCH_DATA_MODEL = 6482MAKE_ARGS += LP64=183PLATFORM = bsd-amd6484VM_PLATFORM = bsd_amd6485HS_ARCH = x8686else87ARCH_DATA_MODEL = 3288PLATFORM = bsd-i58689VM_PLATFORM = bsd_i48690HS_ARCH = x8691# We have to reset ARCH to i386 since SRCARCH relies on it92ARCH = i38693endif94endif9596# i38697ifeq ($(ARCH), i386)98ifeq ($(ARCH_DATA_MODEL), 64)99ARCH_DATA_MODEL = 64100MAKE_ARGS += LP64=1101PLATFORM = bsd-amd64102VM_PLATFORM = bsd_amd64103HS_ARCH = x86104# We have to reset ARCH to amd64 since SRCARCH relies on it105ARCH = amd64106else107ARCH_DATA_MODEL = 32108PLATFORM = bsd-i586109VM_PLATFORM = bsd_i486110HS_ARCH = x86111endif112endif113114# ARM115ifeq ($(ARCH), arm)116ARCH_DATA_MODEL = 32117PLATFORM = bsd-arm118VM_PLATFORM = bsd_arm119HS_ARCH = arm120endif121122# AArch64123ifeq ($(ARCH), aarch64)124ARCH_DATA_MODEL = 64125MAKE_ARGS += LP64=1126PLATFORM = bsd-aarch64127VM_PLATFORM = bsd_aarch64128HS_ARCH = aarch64129endif130131# PPC132ifeq ($(ARCH), ppc)133ARCH_DATA_MODEL = 32134PLATFORM = bsd-ppc135VM_PLATFORM = bsd_ppc136HS_ARCH = ppc137endif138139# On 32 bit bsd we build server and client, on 64 bit just server.140ifeq ($(JVM_VARIANTS),)141ifeq ($(ARCH_DATA_MODEL), 32)142JVM_VARIANTS:=client,server143JVM_VARIANT_CLIENT:=true144JVM_VARIANT_SERVER:=true145else146JVM_VARIANTS:=server147JVM_VARIANT_SERVER:=true148endif149endif150151OS_VENDOR:=$(shell uname -s)152153# determine if HotSpot is being built in JDK6 or earlier version154JDK6_OR_EARLIER=0155ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"156# if the longer variable names (newer build style) are set, then check those157ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"158JDK6_OR_EARLIER=1159endif160else161# the longer variables aren't set so check the shorter variable names162ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"163JDK6_OR_EARLIER=1164endif165endif166167ifeq ($(JDK6_OR_EARLIER),0)168# Full Debug Symbols is supported on JDK7 or newer.169# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product170# builds is enabled with debug info files ZIP'ed to save space. For171# BUILD_FLAVOR != product builds, FDS is always enabled, after all a172# debug build without debug info isn't very useful.173# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.174#175# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be176# disabled for a BUILD_FLAVOR == product build.177#178# Note: Use of a different variable name for the FDS override option179# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS180# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass181# in options via environment variables, use of distinct variables182# prevents strange behaviours. For example, in a BUILD_FLAVOR !=183# product build, the FULL_DEBUG_SYMBOLS environment variable will be184# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If185# the same variable name is used, then different values can be picked186# up by different parts of the build. Just to be clear, we only need187# two variable names because the incoming option value can be188# overridden in some situations, e.g., a BUILD_FLAVOR != product189# build.190191# Due to the multiple sub-make processes that occur this logic gets192# executed multiple times. We reduce the noise by at least checking that193# BUILD_FLAVOR has been set.194ifneq ($(BUILD_FLAVOR),)195ifeq ($(BUILD_FLAVOR), product)196FULL_DEBUG_SYMBOLS ?= 1197ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)198else199# debug variants always get Full Debug Symbols (if available)200ENABLE_FULL_DEBUG_SYMBOLS = 1201endif202_JUNK_ := $(shell \203echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")204# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later205206ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)207ifeq ($(OS_VENDOR), Darwin)208# MacOS X doesn't use OBJCOPY or STRIP_POLICY209OBJCOPY=210STRIP_POLICY=211ZIP_DEBUGINFO_FILES ?= 1212else213# Default OBJCOPY comes from GNU Binutils on BSD214ifeq ($(CROSS_COMPILE_ARCH),)215DEF_OBJCOPY=/usr/bin/objcopy216else217# Assume objcopy is part of the cross-compilation toolset218ifneq ($(ALT_COMPILER_PATH),)219DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy220endif221endif222OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))223ifneq ($(ALT_OBJCOPY),)224_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")225OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))226endif227228ifeq ($(OBJCOPY),)229_JUNK_ := $(shell \230echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \231"files. You may need to set ALT_OBJCOPY.")232ENABLE_FULL_DEBUG_SYMBOLS=0233_JUNK_ := $(shell \234echo >&2 "INFO:" \235"ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")236else237_JUNK_ := $(shell \238echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo" \239"files.")240241# Library stripping policies for .debuginfo configs:242# all_strip - strips everything from the library243# min_strip - strips most stuff from the library; leaves244# minimum symbols245# no_strip - does not strip the library at all246#247# Oracle security policy requires "all_strip". A waiver was248# granted on 2011.09.01 that permits using "min_strip" in the249# Java JDK and Java JRE.250#251# Currently, STRIP_POLICY is only used when Full Debug Symbols252# is enabled.253#254STRIP_POLICY ?= min_strip255256_JUNK_ := $(shell \257echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")258259ZIP_DEBUGINFO_FILES ?= 1260endif261262_JUNK_ := $(shell \263echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")264endif265endif # ENABLE_FULL_DEBUG_SYMBOLS=1266endif # BUILD_FLAVOR267endif # JDK_6_OR_EARLIER268269JDK_INCLUDE_SUBDIR=bsd270271# Library suffix272ifeq ($(OS_VENDOR),Darwin)273LIBRARY_SUFFIX=dylib274else275LIBRARY_SUFFIX=so276endif277278EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html279280# client and server subdirectories have symbolic links to ../libjsig.so281EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)282283ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)284ifeq ($(ZIP_DEBUGINFO_FILES),1)285EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz286else287ifeq ($(OS_VENDOR), Darwin)288EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM289else290EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo291endif292endif293endif294295EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server296EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client297EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal298299ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)300EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt301EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)302303ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)304ifeq ($(ZIP_DEBUGINFO_FILES),1)305EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz306else307ifeq ($(OS_VENDOR), Darwin)308EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM309else310EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo311endif312endif313endif314endif315316ifeq ($(JVM_VARIANT_CLIENT),true)317EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt318EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)319320ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)321ifeq ($(ZIP_DEBUGINFO_FILES),1)322EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz323else324ifeq ($(OS_VENDOR), Darwin)325EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM326else327EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo328endif329endif330endif331endif332333ifeq ($(JVM_VARIANT_MINIMAL1),true)334EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt335EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)336endif337338# Serviceability Binaries339# No SA Support for PPC, IA64, ARM or zero340ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \341$(EXPORT_LIB_DIR)/sa-jdi.jar342343ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)344ifeq ($(ZIP_DEBUGINFO_FILES),1)345ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz346else347ifeq ($(OS_VENDOR), Darwin)348ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM349else350ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo351endif352endif353endif354355ADD_SA_BINARIES/aarch64 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \356$(EXPORT_LIB_DIR)/sa-jdi.jar357ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \358$(EXPORT_LIB_DIR)/sa-jdi.jar359ADD_SA_BINARIES/universal = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \360$(EXPORT_LIB_DIR)/sa-jdi.jar361362ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)363ifeq ($(ZIP_DEBUGINFO_FILES),1)364ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz365else366ifeq ($(OS_VENDOR), Darwin)367ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM368else369ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo370endif371endif372endif373374ADD_SA_BINARIES/ppc =375ADD_SA_BINARIES/ia64 =376ADD_SA_BINARIES/arm =377ADD_SA_BINARIES/zero =378379EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))380381# Universal build settings382ifeq ($(OS_VENDOR), Darwin)383# Build universal binaries by default on Mac OS X384MACOSX_UNIVERSAL = true385ifneq ($(ALT_MACOSX_UNIVERSAL),)386MACOSX_UNIVERSAL = $(ALT_MACOSX_UNIVERSAL)387endif388MAKE_ARGS += MACOSX_UNIVERSAL=$(MACOSX_UNIVERSAL)389390# Universal settings391ifeq ($(MACOSX_UNIVERSAL), true)392393# Set universal export path but avoid using ARCH or PLATFORM subdirs394EXPORT_PATH=$(OUTPUTDIR)/export-universal$(EXPORT_SUBDIR)395ifneq ($(ALT_EXPORT_PATH),)396EXPORT_PATH=$(ALT_EXPORT_PATH)397endif398399# Set universal image dir400JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-universal$(EXPORT_SUBDIR)401ifneq ($(ALT_JDK_IMAGE_DIR),)402JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR)403endif404405# Binaries to 'universalize' if built406UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX)407UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX)408UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX)409UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX)410411# Files to simply copy in place412UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt413UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt414ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)415ifeq ($(ZIP_DEBUGINFO_FILES),1)416UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz417UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz418UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.diz419UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.diz420else421UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM422UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM423UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM424UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM425endif426endif427428endif429endif430431432