2016-04-08 11:14:23 +00:00
|
|
|
#
|
2024-04-04 03:42:12 +00:00
|
|
|
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
2016-04-08 11:14:23 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFeatures.gmk))
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Setup CFLAGS and EXCLUDES for the libjvm compilation, depending on which
|
|
|
|
# jvm features are selected for this jvm variant.
|
|
|
|
|
|
|
|
ifeq ($(call check-jvm-feature, compiler1), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DCOMPILER1
|
|
|
|
else
|
2018-04-26 18:42:43 +00:00
|
|
|
JVM_EXCLUDE_PATTERNS += c1_ c1/
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(call check-jvm-feature, compiler2), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DCOMPILER2
|
|
|
|
JVM_SRC_DIRS += $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles
|
|
|
|
else
|
|
|
|
JVM_EXCLUDES += opto libadt
|
|
|
|
JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
|
2018-05-19 16:01:04 +00:00
|
|
|
JVM_EXCLUDE_PATTERNS += c2_ runtime_ /c2/
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(call check-jvm-feature, zero), true)
|
2020-06-24 13:56:20 +00:00
|
|
|
JVM_EXCLUDES += opto libadt
|
|
|
|
JVM_EXCLUDE_PATTERNS += c1_ c1/ c2_ runtime_ /c2/
|
2024-08-30 08:58:18 +00:00
|
|
|
JVM_EXCLUDE_FILES += templateInterpreter.cpp \
|
|
|
|
templateInterpreterGenerator.cpp bcEscapeAnalyzer.cpp ciTypeFlow.cpp
|
|
|
|
JVM_CFLAGS_FEATURES += -DZERO \
|
|
|
|
-DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
|
2016-04-08 11:14:23 +00:00
|
|
|
JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
|
2019-03-22 15:14:21 +00:00
|
|
|
ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
|
|
|
|
JVM_LDFLAGS_FEATURES += $(call SET_EXECUTABLE_ORIGIN,/..)
|
|
|
|
endif
|
2020-06-24 13:56:20 +00:00
|
|
|
else
|
|
|
|
JVM_EXCLUDE_PATTERNS += /zero/
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
2021-09-16 08:25:43 +00:00
|
|
|
ifeq ($(JVM_VARIANT), core)
|
|
|
|
JVM_CFLAGS_FEATURES += -DVMTYPE=\"Core\"
|
|
|
|
endif
|
|
|
|
|
2020-04-28 17:41:39 +00:00
|
|
|
ifeq ($(JVM_VARIANT), custom)
|
|
|
|
JVM_CFLAGS_FEATURES += -DVMTYPE=\"Custom\"
|
|
|
|
endif
|
|
|
|
|
2016-04-08 11:14:23 +00:00
|
|
|
ifeq ($(call check-jvm-feature, minimal), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, linux), true)
|
2024-08-30 08:58:18 +00:00
|
|
|
# Override the default -g with a more liberal strip policy for the
|
|
|
|
# minimal JVM
|
2016-10-05 09:05:18 +00:00
|
|
|
JVM_STRIPFLAGS := --strip-unneeded
|
|
|
|
endif
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(call check-jvm-feature, dtrace), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DDTRACE_ENABLED
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, jvmti), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
|
2024-08-30 08:58:18 +00:00
|
|
|
JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp \
|
|
|
|
jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiManageCapabilities.cpp \
|
|
|
|
jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp jvmtiCodeBlobEvents.cpp \
|
|
|
|
jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp \
|
|
|
|
jvmtiEnvThreadState.cpp jvmtiTagMap.cpp jvmtiEventController.cpp \
|
|
|
|
evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
|
|
|
|
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp \
|
|
|
|
jvmtiAgentList.cpp jfrJvmtiAgent.cpp
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, jvmci), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_JVMCI=0
|
|
|
|
JVM_EXCLUDES += jvmci
|
|
|
|
JVM_EXCLUDE_FILES += jvmciCodeInstaller_$(HOTSPOT_TARGET_CPU_ARCH).cpp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, vm-structs), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_VM_STRUCTS=0
|
|
|
|
JVM_EXCLUDE_FILES += vmStructs.cpp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, jni-check), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_JNI_CHECK=0
|
|
|
|
JVM_EXCLUDE_FILES += jniCheck.cpp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, services), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_SERVICES=0
|
|
|
|
JVM_EXCLUDE_FILES += heapDumper.cpp heapInspection.cpp \
|
|
|
|
attachListener_$(HOTSPOT_TARGET_OS).cpp attachListener.cpp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, management), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_MANAGEMENT=0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, cds), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
|
|
|
|
JVM_EXCLUDE_FILES += \
|
2020-09-13 14:45:12 +00:00
|
|
|
classLoaderDataShared.cpp \
|
2016-04-08 11:14:23 +00:00
|
|
|
classLoaderExt.cpp \
|
2020-08-14 01:40:51 +00:00
|
|
|
systemDictionaryShared.cpp
|
2021-04-23 04:13:02 +00:00
|
|
|
JVM_EXCLUDE_PATTERNS += cds/
|
2016-04-08 11:14:23 +00:00
|
|
|
endif
|
|
|
|
|
2018-05-04 09:41:35 +00:00
|
|
|
ifneq ($(call check-jvm-feature, g1gc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_G1GC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/g1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, parallelgc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_PARALLELGC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/parallel
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call check-jvm-feature, serialgc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/serial
|
|
|
|
endif
|
2018-05-15 18:24:34 +00:00
|
|
|
|
2018-06-12 13:03:00 +00:00
|
|
|
ifneq ($(call check-jvm-feature, epsilongc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_EPSILONGC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/epsilon
|
|
|
|
endif
|
|
|
|
|
8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Erik Osterlund <erik.osterlund@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Kim Barrett <kim.barrett@oracle.com>
Co-authored-by: Nils Eliasson <nils.eliasson@oracle.com>
Co-authored-by: Rickard Backman <rickard.backman@oracle.com>
Co-authored-by: Roland Westrelin <rwestrel@redhat.com>
Co-authored-by: Coleen Phillimore <coleen.phillimore@oracle.com>
Co-authored-by: Robbin Ehn <robbin.ehn@oracle.com>
Co-authored-by: Gerard Ziemski <gerard.ziemski@oracle.com>
Co-authored-by: Hugh Wilkinson <hugh.wilkinson@intel.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Co-authored-by: Bill Wheeler <bill.npo.wheeler@intel.com>
Co-authored-by: Vinay K. Awasthi <vinay.k.awasthi@intel.com>
Co-authored-by: Yasumasa Suenaga <yasuenag@gmail.com>
Reviewed-by: pliden, stefank, eosterlund, ehelin, sjohanss, rbackman, coleenp, ihse, jgeorge, lmesnik, rkennke
2018-06-12 15:40:28 +00:00
|
|
|
ifneq ($(call check-jvm-feature, zgc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_ZGC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/z
|
|
|
|
endif
|
|
|
|
|
2018-12-10 14:47:44 +00:00
|
|
|
ifneq ($(call check-jvm-feature, shenandoahgc), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_SHENANDOAHGC=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += gc/shenandoah
|
|
|
|
endif
|
|
|
|
|
2018-05-15 18:24:34 +00:00
|
|
|
ifneq ($(call check-jvm-feature, jfr), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -DINCLUDE_JFR=0
|
|
|
|
JVM_EXCLUDE_PATTERNS += jfr
|
2020-03-27 16:47:13 +00:00
|
|
|
JVM_EXCLUDE_FILES += compilerEvent.cpp
|
2018-05-15 18:24:34 +00:00
|
|
|
endif
|
|
|
|
|
2016-12-19 17:39:01 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
ifeq ($(call check-jvm-feature, link-time-opt), true)
|
2022-08-22 11:00:17 +00:00
|
|
|
# Set JVM_OPTIMIZATION directly so other jvm-feature flags can override it
|
|
|
|
# later on if desired
|
|
|
|
JVM_OPTIMIZATION := HIGHEST_JVM
|
|
|
|
ifeq ($(call isCompiler, gcc), true)
|
2024-08-30 08:58:18 +00:00
|
|
|
JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing \
|
|
|
|
-fno-fat-lto-objects
|
|
|
|
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \
|
|
|
|
-fuse-linker-plugin -fno-strict-aliasing
|
2023-04-14 17:18:28 +00:00
|
|
|
else ifeq ($(call isCompiler, microsoft), true)
|
|
|
|
JVM_CFLAGS_FEATURES += -GL
|
|
|
|
JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL
|
2023-04-02 06:54:09 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(call isCompiler, gcc), true)
|
|
|
|
JVM_LDFLAGS_FEATURES += -O1
|
2022-08-22 11:00:17 +00:00
|
|
|
endif
|
2016-12-19 17:39:01 +00:00
|
|
|
endif
|
|
|
|
|
2020-02-25 08:46:12 +00:00
|
|
|
ifeq ($(call check-jvm-feature, opt-size), true)
|
|
|
|
JVM_OPTIMIZATION := SIZE
|
|
|
|
OPT_SPEED_SRC := \
|
|
|
|
allocation.cpp \
|
|
|
|
assembler.cpp \
|
|
|
|
barrierSet.cpp \
|
|
|
|
basicLock.cpp \
|
|
|
|
bytecode.cpp \
|
|
|
|
bytecodeInterpreter.cpp \
|
|
|
|
c1_Compilation.cpp \
|
|
|
|
c1_Compiler.cpp \
|
|
|
|
c1_GraphBuilder.cpp \
|
|
|
|
c1_LinearScan.cpp \
|
|
|
|
c1_LIR.cpp \
|
|
|
|
ciEnv.cpp \
|
|
|
|
ciObjectFactory.cpp \
|
|
|
|
codeBlob.cpp \
|
|
|
|
constantPool.cpp \
|
|
|
|
constMethod.cpp \
|
|
|
|
classLoader.cpp \
|
|
|
|
classLoaderData.cpp \
|
|
|
|
classFileParser.cpp \
|
|
|
|
classFileStream.cpp \
|
|
|
|
cpCache.cpp \
|
|
|
|
defNewGeneration.cpp \
|
|
|
|
frame_arm.cpp \
|
|
|
|
frame_aarch64.cpp \
|
|
|
|
frame_ppc.cpp \
|
|
|
|
frame_s390.cpp \
|
|
|
|
frame_x86.cpp \
|
|
|
|
genCollectedHeap.cpp \
|
|
|
|
generation.cpp \
|
|
|
|
growableArray.cpp \
|
|
|
|
handles.cpp \
|
|
|
|
hashtable.cpp \
|
|
|
|
heap.cpp \
|
|
|
|
icache.cpp \
|
|
|
|
icache_arm.cpp \
|
|
|
|
icache_aarch64.cpp \
|
|
|
|
icache_ppc.cpp \
|
|
|
|
icache_s390.cpp \
|
|
|
|
icache_x86.cpp \
|
|
|
|
instanceKlass.cpp \
|
|
|
|
invocationCounter.cpp \
|
|
|
|
iterator.cpp \
|
|
|
|
javaCalls.cpp \
|
|
|
|
javaClasses.cpp \
|
|
|
|
jniFastGetField_arm.cpp \
|
|
|
|
jvm.cpp \
|
|
|
|
linkResolver.cpp \
|
|
|
|
klass.cpp \
|
|
|
|
klassVtable.cpp \
|
|
|
|
markSweep.cpp \
|
|
|
|
memRegion.cpp \
|
|
|
|
memoryPool.cpp \
|
|
|
|
method.cpp \
|
|
|
|
methodHandles.cpp \
|
|
|
|
methodHandles_arm.cpp \
|
|
|
|
methodLiveness.cpp \
|
|
|
|
metaspace.cpp \
|
|
|
|
mutex.cpp \
|
|
|
|
mutexLocker.cpp \
|
|
|
|
nativeLookup.cpp \
|
|
|
|
objArrayKlass.cpp \
|
|
|
|
os_linux.cpp \
|
|
|
|
os_linux_arm.cpp \
|
|
|
|
resourceArea.cpp \
|
|
|
|
rewriter.cpp \
|
|
|
|
sharedRuntime.cpp \
|
|
|
|
signature.cpp \
|
|
|
|
space.cpp \
|
|
|
|
stackMapTable.cpp \
|
|
|
|
symbolTable.cpp \
|
|
|
|
systemDictionary.cpp \
|
|
|
|
symbol.cpp \
|
|
|
|
synchronizer.cpp \
|
|
|
|
timer.cpp \
|
|
|
|
typeArrayKlass.cpp \
|
|
|
|
unsafe.cpp \
|
|
|
|
utf8.cpp \
|
|
|
|
vmSymbols.cpp \
|
|
|
|
#
|
2016-12-19 17:39:01 +00:00
|
|
|
|
2020-02-25 08:46:12 +00:00
|
|
|
$(foreach s, $(OPT_SPEED_SRC), \
|
|
|
|
$(eval BUILD_LIBJVM_$s_OPTIMIZATION := HIGHEST_JVM))
|
2016-12-19 17:39:01 +00:00
|
|
|
|
2020-02-25 08:46:12 +00:00
|
|
|
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
|
2016-12-19 17:39:01 +00:00
|
|
|
BUILD_LIBJVM_systemDictionary.cpp_CXXFLAGS := -fno-optimize-sibling-calls
|
|
|
|
endif
|
|
|
|
endif
|