duke@435: # drchase@4942: # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. drchase@4942: # duke@435: # duke@435: duke@435: # The common definitions for hotspot linux builds. duke@435: # Include the top level defs.make under make directory instead of this one. duke@435: # This file is included into make/defs.make. duke@435: duke@435: SLASH_JAVA ?= /java duke@435: duke@435: # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name dholmes@4095: dholmes@4095: # ARCH can be set explicitly in spec.gmk dholmes@4095: ifndef ARCH dholmes@4095: ARCH := $(shell uname -m) dholmes@4095: endif dholmes@4095: dholmes@4095: PATH_SEP ?= : dholmes@4095: duke@435: ifeq ($(LP64), 1) duke@435: ARCH_DATA_MODEL ?= 64 duke@435: else duke@435: ARCH_DATA_MODEL ?= 32 duke@435: endif duke@435: never@1445: # zero erikj@3649: ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) never@1445: ifeq ($(ARCH_DATA_MODEL), 64) never@1445: MAKE_ARGS += LP64=1 never@1445: endif never@1445: PLATFORM = linux-zero never@1445: VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH)) never@1445: HS_ARCH = zero never@1445: ARCH = zero never@1445: endif never@1445: duke@435: # ia64 duke@435: ifeq ($(ARCH), ia64) duke@435: ARCH_DATA_MODEL = 64 duke@435: MAKE_ARGS += LP64=1 duke@435: PLATFORM = linux-ia64 duke@435: VM_PLATFORM = linux_ia64 duke@435: HS_ARCH = ia64 duke@435: endif duke@435: duke@435: # sparc duke@435: ifeq ($(ARCH), sparc64) duke@435: ifeq ($(ARCH_DATA_MODEL), 64) duke@435: ARCH_DATA_MODEL = 64 duke@435: MAKE_ARGS += LP64=1 duke@435: PLATFORM = linux-sparcv9 duke@435: VM_PLATFORM = linux_sparcv9 duke@435: else duke@435: ARCH_DATA_MODEL = 32 duke@435: PLATFORM = linux-sparc duke@435: VM_PLATFORM = linux_sparc duke@435: endif duke@435: HS_ARCH = sparc duke@435: endif duke@435: dholmes@4095: # amd64/x86_64 dholmes@4095: ifneq (,$(findstring $(ARCH), amd64 x86_64)) duke@435: ifeq ($(ARCH_DATA_MODEL), 64) duke@435: ARCH_DATA_MODEL = 64 duke@435: MAKE_ARGS += LP64=1 duke@435: PLATFORM = linux-amd64 duke@435: VM_PLATFORM = linux_amd64 duke@435: HS_ARCH = x86 duke@435: else duke@435: ARCH_DATA_MODEL = 32 duke@435: PLATFORM = linux-i586 duke@435: VM_PLATFORM = linux_i486 duke@435: HS_ARCH = x86 duke@435: # We have to reset ARCH to i686 since SRCARCH relies on it drchase@4942: ARCH = i686 duke@435: endif duke@435: endif duke@435: dholmes@4095: # i686/i586 ie 32-bit x86 dholmes@4095: ifneq (,$(findstring $(ARCH), i686 i586)) duke@435: ARCH_DATA_MODEL = 32 duke@435: PLATFORM = linux-i586 duke@435: VM_PLATFORM = linux_i486 duke@435: HS_ARCH = x86 duke@435: endif duke@435: bobv@2036: # ARM bobv@2036: ifeq ($(ARCH), arm) bobv@2036: ARCH_DATA_MODEL = 32 bobv@2036: PLATFORM = linux-arm bobv@2036: VM_PLATFORM = linux_arm bobv@2036: HS_ARCH = arm bobv@2036: endif bobv@2036: bobv@2036: # PPC bobv@2036: ifeq ($(ARCH), ppc) bobv@2036: ARCH_DATA_MODEL = 32 bobv@2036: PLATFORM = linux-ppc bobv@2036: VM_PLATFORM = linux_ppc bobv@2036: HS_ARCH = ppc bobv@2036: endif bobv@2036: simonis@6452: # PPC64 simonis@6452: ifeq ($(ARCH), ppc64) simonis@6452: ARCH_DATA_MODEL = 64 simonis@6452: MAKE_ARGS += LP64=1 simonis@6452: PLATFORM = linux-ppc64 simonis@6452: VM_PLATFORM = linux_ppc64 simonis@6452: HS_ARCH = ppc simonis@6452: endif simonis@6452: erikj@3649: # On 32 bit linux we build server and client, on 64 bit just server. erikj@3649: ifeq ($(JVM_VARIANTS),) erikj@3649: ifeq ($(ARCH_DATA_MODEL), 32) erikj@3649: JVM_VARIANTS:=client,server erikj@3649: JVM_VARIANT_CLIENT:=true erikj@3649: JVM_VARIANT_SERVER:=true erikj@3649: else erikj@3649: JVM_VARIANTS:=server erikj@3649: JVM_VARIANT_SERVER:=true erikj@3649: endif erikj@3649: endif erikj@3649: dcubed@3150: # determine if HotSpot is being built in JDK6 or earlier version dcubed@3150: JDK6_OR_EARLIER=0 dcubed@3150: ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1" dcubed@3150: # if the longer variable names (newer build style) are set, then check those dcubed@3150: ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1" dcubed@3150: JDK6_OR_EARLIER=1 dcubed@3150: endif dcubed@3150: else dcubed@3150: # the longer variables aren't set so check the shorter variable names dcubed@3150: ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1" dcubed@3150: JDK6_OR_EARLIER=1 dcubed@3150: endif dcubed@3150: endif dcubed@3150: dcubed@3150: ifeq ($(JDK6_OR_EARLIER),0) dcubed@3724: # Full Debug Symbols is supported on JDK7 or newer. dcubed@3725: # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product dcubed@3725: # builds is enabled with debug info files ZIP'ed to save space. For dcubed@3725: # BUILD_FLAVOR != product builds, FDS is always enabled, after all a dcubed@3725: # debug build without debug info isn't very useful. dcubed@3725: # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. dcubed@3725: # dcubed@3725: # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be dcubed@3725: # disabled for a BUILD_FLAVOR == product build. dcubed@3725: # dcubed@3725: # Note: Use of a different variable name for the FDS override option dcubed@3725: # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS dcubed@3725: # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass dcubed@3725: # in options via environment variables, use of distinct variables dcubed@3725: # prevents strange behaviours. For example, in a BUILD_FLAVOR != dcubed@3725: # product build, the FULL_DEBUG_SYMBOLS environment variable will be dcubed@3725: # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If dcubed@3725: # the same variable name is used, then different values can be picked dcubed@3725: # up by different parts of the build. Just to be clear, we only need dcubed@3725: # two variable names because the incoming option value can be dcubed@3725: # overridden in some situations, e.g., a BUILD_FLAVOR != product dcubed@3725: # build. dcubed@3150: dholmes@4243: # Due to the multiple sub-make processes that occur this logic gets dholmes@4243: # executed multiple times. We reduce the noise by at least checking that dholmes@4243: # BUILD_FLAVOR has been set. dholmes@4243: ifneq ($(BUILD_FLAVOR),) dholmes@4243: ifeq ($(BUILD_FLAVOR), product) dholmes@4243: FULL_DEBUG_SYMBOLS ?= 1 dholmes@4243: ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) dholmes@4243: else dholmes@4243: # debug variants always get Full Debug Symbols (if available) dholmes@4243: ENABLE_FULL_DEBUG_SYMBOLS = 1 dholmes@4243: endif dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") dholmes@4243: # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later dcubed@3724: dholmes@4243: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dholmes@4243: # Default OBJCOPY comes from GNU Binutils on Linux dholmes@4243: ifeq ($(CROSS_COMPILE_ARCH),) dholmes@4243: DEF_OBJCOPY=/usr/bin/objcopy dholmes@4243: else dholmes@4243: # Assume objcopy is part of the cross-compilation toolset dholmes@4243: ifneq ($(ALT_COMPILER_PATH),) dholmes@4243: DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy dholmes@4243: endif dholmes@4243: endif dcubed@3724: OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) dcubed@3724: ifneq ($(ALT_OBJCOPY),) dcubed@3724: _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") dcubed@3724: OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) dcubed@3724: endif dcubed@3724: dholmes@4243: ifeq ($(OBJCOPY),) dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.") dholmes@4243: ENABLE_FULL_DEBUG_SYMBOLS=0 dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") dholmes@4243: else dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") dcubed@3724: dholmes@4243: # Library stripping policies for .debuginfo configs: dholmes@4243: # all_strip - strips everything from the library dholmes@4243: # min_strip - strips most stuff from the library; leaves minimum symbols dholmes@4243: # no_strip - does not strip the library at all dholmes@4243: # dholmes@4243: # Oracle security policy requires "all_strip". A waiver was granted on dholmes@4243: # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. dholmes@4243: # dholmes@4243: # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. dholmes@4243: # dholmes@4243: STRIP_POLICY ?= min_strip dcubed@3724: dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") dcubed@3724: dholmes@4243: ZIP_DEBUGINFO_FILES ?= 1 dcubed@3724: dholmes@4243: _JUNK_ := $(shell \ dholmes@4243: echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") dholmes@4243: endif dholmes@4243: endif # ENABLE_FULL_DEBUG_SYMBOLS=1 dholmes@4243: endif # BUILD_FLAVOR dholmes@4243: endif # JDK_6_OR_EARLIER dcubed@3150: duke@435: JDK_INCLUDE_SUBDIR=linux duke@435: never@3156: # Library suffix never@3156: LIBRARY_SUFFIX=so never@3156: duke@435: EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html kvn@1450: kvn@1450: # client and server subdirectories have symbolic links to ../libjsig.so never@3156: EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) dcubed@3724: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dcubed@3724: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@3724: EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz dcubed@3724: else dcubed@3724: EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo dcubed@3724: endif dcubed@3150: endif bobv@2036: EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server kvn@3044: EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client jprovino@4165: EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal kvn@1450: simonis@6452: ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true) erikj@3649: EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt erikj@3649: EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) dcubed@3724: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dcubed@3724: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@3724: EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz dcubed@3724: else dcubed@3724: EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo dcubed@3724: endif dcubed@3150: endif bobv@2036: endif bobv@2036: erikj@3649: ifeq ($(JVM_VARIANT_CLIENT),true) erikj@3649: EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt erikj@3649: EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) dcubed@3726: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dcubed@3726: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@3726: EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz dcubed@3726: else dcubed@3726: EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo dcubed@3150: endif drchase@4942: endif duke@435: endif bobv@2036: jprovino@4165: ifeq ($(JVM_VARIANT_MINIMAL1),true) jprovino@4165: EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt jprovino@4165: EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) jprovino@4165: jprovino@4165: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) jprovino@4165: ifeq ($(ZIP_DEBUGINFO_FILES),1) jprovino@4165: EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz jprovino@4165: else jprovino@4165: EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo jprovino@4165: endif drchase@4942: endif jprovino@4165: endif jprovino@4165: bobv@2036: # Serviceability Binaries bobv@2036: # No SA Support for PPC, IA64, ARM or zero never@3156: ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ drchase@4942: $(EXPORT_LIB_DIR)/sa-jdi.jar never@3156: ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ drchase@4942: $(EXPORT_LIB_DIR)/sa-jdi.jar dcubed@3724: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dcubed@3724: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@3724: ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz dcubed@3724: ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz dcubed@3724: else dcubed@3724: ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo dcubed@3724: ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo dcubed@3724: endif dcubed@3150: endif drchase@4942: ADD_SA_BINARIES/ppc = drchase@4942: ADD_SA_BINARIES/ia64 = drchase@4942: ADD_SA_BINARIES/arm = drchase@4942: ADD_SA_BINARIES/zero = bobv@2036: bpittore@4028: -include $(HS_ALT_MAKE)/linux/makefiles/defs.make bpittore@4028: bobv@2036: EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH)) bobv@2036: bobv@2036: