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