< prev index next >

make/hotspot/lib/JvmFeatures.gmk

Print this page


   1 #
   2 # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  30 # jvm features are selected for this jvm variant.
  31 
  32 ifeq ($(call check-jvm-feature, compiler1), true)
  33   JVM_CFLAGS_FEATURES += -DCOMPILER1
  34 else
  35   JVM_EXCLUDE_PATTERNS += c1_ c1/
  36 endif
  37 
  38 ifeq ($(call check-jvm-feature, compiler2), true)
  39   JVM_CFLAGS_FEATURES += -DCOMPILER2
  40   JVM_SRC_DIRS += $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles
  41 else
  42   JVM_EXCLUDES += opto libadt
  43   JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
  44   JVM_EXCLUDE_PATTERNS += c2_ runtime_ /c2/
  45 endif
  46 
  47 ifeq ($(call check-jvm-feature, zero), true)
  48   JVM_CFLAGS_FEATURES += -DZERO -DCC_INTERP -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
  49   JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
  50   ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
  51     JVM_LDFLAGS_FEATURES += $(call SET_EXECUTABLE_ORIGIN,/..)
  52   endif
  53   ifeq ($(call isTargetCpu, sparcv9), true)
  54     BUILD_LIBJVM_EXTRA_FILES := $(TOPDIR)/src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp
  55   endif
  56 endif
  57 
  58 ifeq ($(call check-jvm-feature, minimal), true)
  59   JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
  60   ifeq ($(call isTargetOs, linux), true)
  61     # Override the default -g with a more liberal strip policy for the minimal JVM
  62     JVM_STRIPFLAGS := --strip-unneeded
  63   endif
  64 endif
  65 
  66 ifeq ($(call check-jvm-feature, dtrace), true)
  67   JVM_CFLAGS_FEATURES += -DDTRACE_ENABLED
  68 endif
  69 
  70 ifeq ($(call check-jvm-feature, static-build), true)
  71   JVM_CFLAGS_FEATURES += -DSTATIC_BUILD=1
  72 endif
  73 
  74 ifneq ($(call check-jvm-feature, jvmti), true)
  75   JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
  76   JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
  77       jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
  78       jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
  79       jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
  80       jvmtiClassFileReconstituter.cpp


  94 ifneq ($(call check-jvm-feature, jni-check), true)
  95   JVM_CFLAGS_FEATURES += -DINCLUDE_JNI_CHECK=0
  96   JVM_EXCLUDE_FILES += jniCheck.cpp
  97 endif
  98 
  99 ifneq ($(call check-jvm-feature, services), true)
 100   JVM_CFLAGS_FEATURES += -DINCLUDE_SERVICES=0
 101   JVM_EXCLUDE_FILES += heapDumper.cpp heapInspection.cpp \
 102       attachListener_$(HOTSPOT_TARGET_OS).cpp attachListener.cpp
 103 endif
 104 
 105 ifneq ($(call check-jvm-feature, management), true)
 106   JVM_CFLAGS_FEATURES += -DINCLUDE_MANAGEMENT=0
 107 endif
 108 
 109 ifneq ($(call check-jvm-feature, cds), true)
 110   JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
 111   JVM_EXCLUDE_FILES += \
 112       classListParser.cpp \
 113       classLoaderExt.cpp \
 114       dynamicArchive.cpp \
 115       filemap.cpp \
 116       heapShared.cpp \
 117       metaspaceShared.cpp \
 118       metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
 119       metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
 120       sharedClassUtil.cpp \
 121       sharedPathsMiscInfo.cpp \
 122       systemDictionaryShared.cpp \
 123       #
 124 endif
 125 
 126 ifneq ($(call check-jvm-feature, nmt), true)
 127   JVM_CFLAGS_FEATURES += -DINCLUDE_NMT=0
 128   JVM_EXCLUDE_FILES += \
 129       memBaseline.cpp memReporter.cpp mallocTracker.cpp virtualMemoryTracker.cpp nmtCommon.cpp \
 130       memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp threadStackTracker.cpp
 131 endif
 132 
 133 ifneq ($(call check-jvm-feature, aot), true)
 134   JVM_CFLAGS_FEATURES += -DINCLUDE_AOT=0
 135   JVM_EXCLUDE_FILES += \
 136       compiledIC_aot_x86_64.cpp compiledIC_aot_aarch64.cpp      \
 137       compilerRuntime.cpp aotCodeHeap.cpp aotCompiledMethod.cpp \
 138       aotLoader.cpp compiledIC_aot.cpp
 139 endif
 140 
 141 ifneq ($(call check-jvm-feature, cmsgc), true)
 142   JVM_CFLAGS_FEATURES += -DINCLUDE_CMSGC=0
 143   JVM_EXCLUDE_PATTERNS += gc/cms
 144 endif
 145 
 146 ifneq ($(call check-jvm-feature, g1gc), true)
 147   JVM_CFLAGS_FEATURES += -DINCLUDE_G1GC=0
 148   JVM_EXCLUDE_PATTERNS += gc/g1
 149 endif
 150 
 151 ifneq ($(call check-jvm-feature, parallelgc), true)
 152   JVM_CFLAGS_FEATURES += -DINCLUDE_PARALLELGC=0
 153   JVM_EXCLUDE_PATTERNS += gc/parallel
 154 endif
 155 
 156 ifneq ($(call check-jvm-feature, serialgc), true)
 157   JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0
 158   JVM_EXCLUDE_PATTERNS += gc/serial
 159   # If serial is disabled, we cannot use serial as OldGC in parallel
 160   JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp
 161 endif
 162 
 163 ifneq ($(call check-jvm-feature, epsilongc), true)
 164   JVM_CFLAGS_FEATURES += -DINCLUDE_EPSILONGC=0
 165   JVM_EXCLUDE_PATTERNS += gc/epsilon
 166 endif
 167 
 168 ifneq ($(call check-jvm-feature, zgc), true)
 169   JVM_CFLAGS_FEATURES += -DINCLUDE_ZGC=0
 170   JVM_EXCLUDE_PATTERNS += gc/z
 171 endif
 172 
 173 ifneq ($(call check-jvm-feature, shenandoahgc), true)
 174   JVM_CFLAGS_FEATURES += -DINCLUDE_SHENANDOAHGC=0
 175   JVM_EXCLUDE_PATTERNS += gc/shenandoah
 176 endif
 177 
 178 ifneq ($(call check-jvm-feature, jfr), true)
 179   JVM_CFLAGS_FEATURES += -DINCLUDE_JFR=0
 180   JVM_EXCLUDE_PATTERNS += jfr
 181 endif
 182 
 183 ################################################################################
 184 
 185 ifeq ($(call check-jvm-feature, link-time-opt), true)
 186   # NOTE: Disable automatic opimization level and let the explicit cflag control
 187   # optimization level instead. This activates O3 on slowdebug builds, just
 188   # like the old build, but it's probably not right.
 189   JVM_OPTIMIZATION :=
 190   JVM_CFLAGS_FEATURES += -O3 -flto
 191   JVM_LDFLAGS_FEATURES += -O3 -flto -fuse-linker-plugin -fno-strict-aliasing
 192 endif
 193 
 194 ifeq ($(call check-jvm-feature, minimal), true)
 195   ifeq ($(call check-jvm-feature, link-time-opt), false)


   1 #
   2 # Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  30 # jvm features are selected for this jvm variant.
  31 
  32 ifeq ($(call check-jvm-feature, compiler1), true)
  33   JVM_CFLAGS_FEATURES += -DCOMPILER1
  34 else
  35   JVM_EXCLUDE_PATTERNS += c1_ c1/
  36 endif
  37 
  38 ifeq ($(call check-jvm-feature, compiler2), true)
  39   JVM_CFLAGS_FEATURES += -DCOMPILER2
  40   JVM_SRC_DIRS += $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles
  41 else
  42   JVM_EXCLUDES += opto libadt
  43   JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
  44   JVM_EXCLUDE_PATTERNS += c2_ runtime_ /c2/
  45 endif
  46 
  47 ifeq ($(call check-jvm-feature, zero), true)
  48   JVM_CFLAGS_FEATURES += -DZERO -DCC_INTERP -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
  49   JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
  50   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)



  51     BUILD_LIBJVM_EXTRA_FILES := $(TOPDIR)/src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp
  52   endif
  53 endif
  54 
  55 ifeq ($(call check-jvm-feature, minimal), true)
  56   JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
  57   ifeq ($(OPENJDK_TARGET_OS), linux)
  58     # Override the default -g with a more liberal strip policy for the minimal JVM
  59     JVM_STRIPFLAGS := --strip-unneeded
  60   endif
  61 endif
  62 
  63 ifeq ($(call check-jvm-feature, dtrace), true)
  64   JVM_CFLAGS_FEATURES += -DDTRACE_ENABLED
  65 endif
  66 
  67 ifeq ($(call check-jvm-feature, static-build), true)
  68   JVM_CFLAGS_FEATURES += -DSTATIC_BUILD=1
  69 endif
  70 
  71 ifneq ($(call check-jvm-feature, jvmti), true)
  72   JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
  73   JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
  74       jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
  75       jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
  76       jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
  77       jvmtiClassFileReconstituter.cpp


  91 ifneq ($(call check-jvm-feature, jni-check), true)
  92   JVM_CFLAGS_FEATURES += -DINCLUDE_JNI_CHECK=0
  93   JVM_EXCLUDE_FILES += jniCheck.cpp
  94 endif
  95 
  96 ifneq ($(call check-jvm-feature, services), true)
  97   JVM_CFLAGS_FEATURES += -DINCLUDE_SERVICES=0
  98   JVM_EXCLUDE_FILES += heapDumper.cpp heapInspection.cpp \
  99       attachListener_$(HOTSPOT_TARGET_OS).cpp attachListener.cpp
 100 endif
 101 
 102 ifneq ($(call check-jvm-feature, management), true)
 103   JVM_CFLAGS_FEATURES += -DINCLUDE_MANAGEMENT=0
 104 endif
 105 
 106 ifneq ($(call check-jvm-feature, cds), true)
 107   JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
 108   JVM_EXCLUDE_FILES += \
 109       classListParser.cpp \
 110       classLoaderExt.cpp \

 111       filemap.cpp \
 112       heapShared.cpp \
 113       metaspaceShared.cpp \
 114       metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
 115       metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
 116       sharedClassUtil.cpp \
 117       sharedPathsMiscInfo.cpp \
 118       systemDictionaryShared.cpp \
 119       #
 120 endif
 121 
 122 ifneq ($(call check-jvm-feature, nmt), true)
 123   JVM_CFLAGS_FEATURES += -DINCLUDE_NMT=0
 124   JVM_EXCLUDE_FILES += \
 125       memBaseline.cpp memReporter.cpp mallocTracker.cpp virtualMemoryTracker.cpp nmtCommon.cpp \
 126       memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp
 127 endif
 128 
 129 ifneq ($(call check-jvm-feature, aot), true)
 130   JVM_CFLAGS_FEATURES += -DINCLUDE_AOT=0
 131   JVM_EXCLUDE_FILES += \
 132       compiledIC_aot_x86_64.cpp compiledIC_aot_aarch64.cpp      \
 133       compilerRuntime.cpp aotCodeHeap.cpp aotCompiledMethod.cpp \
 134       aotLoader.cpp compiledIC_aot.cpp
 135 endif
 136 
 137 ifneq ($(call check-jvm-feature, cmsgc), true)
 138   JVM_CFLAGS_FEATURES += -DINCLUDE_CMSGC=0
 139   JVM_EXCLUDE_PATTERNS += gc/cms
 140 endif
 141 
 142 ifneq ($(call check-jvm-feature, g1gc), true)
 143   JVM_CFLAGS_FEATURES += -DINCLUDE_G1GC=0
 144   JVM_EXCLUDE_PATTERNS += gc/g1
 145 endif
 146 
 147 ifneq ($(call check-jvm-feature, parallelgc), true)
 148   JVM_CFLAGS_FEATURES += -DINCLUDE_PARALLELGC=0
 149   JVM_EXCLUDE_PATTERNS += gc/parallel
 150 endif
 151 
 152 ifneq ($(call check-jvm-feature, serialgc), true)
 153   JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0
 154   JVM_EXCLUDE_PATTERNS += gc/serial
 155   # If serial is disabled, we cannot use serial as OldGC in parallel
 156   JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp
 157 endif
 158 
 159 ifneq ($(call check-jvm-feature, epsilongc), true)
 160   JVM_CFLAGS_FEATURES += -DINCLUDE_EPSILONGC=0
 161   JVM_EXCLUDE_PATTERNS += gc/epsilon
 162 endif
 163 
 164 ifneq ($(call check-jvm-feature, zgc), true)
 165   JVM_CFLAGS_FEATURES += -DINCLUDE_ZGC=0
 166   JVM_EXCLUDE_PATTERNS += gc/z





 167 endif
 168 
 169 ifneq ($(call check-jvm-feature, jfr), true)
 170   JVM_CFLAGS_FEATURES += -DINCLUDE_JFR=0
 171   JVM_EXCLUDE_PATTERNS += jfr
 172 endif
 173 
 174 ################################################################################
 175 
 176 ifeq ($(call check-jvm-feature, link-time-opt), true)
 177   # NOTE: Disable automatic opimization level and let the explicit cflag control
 178   # optimization level instead. This activates O3 on slowdebug builds, just
 179   # like the old build, but it's probably not right.
 180   JVM_OPTIMIZATION :=
 181   JVM_CFLAGS_FEATURES += -O3 -flto
 182   JVM_LDFLAGS_FEATURES += -O3 -flto -fuse-linker-plugin -fno-strict-aliasing
 183 endif
 184 
 185 ifeq ($(call check-jvm-feature, minimal), true)
 186   ifeq ($(call check-jvm-feature, link-time-opt), false)


< prev index next >