jdk

Форк
0
/
JvmFlags.gmk 
107 строк · 4.2 Кб
1
#
2
# Copyright (c) 2013, 2023, 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
23
# questions.
24
#
25

26
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFlags.gmk))
27

28
################################################################################
29
# Setup JVM_CFLAGS. These are shared between GensrcDtrace.gmk and CompileJvm.gmk.
30

31
# This variable may be added to by a custom extension
32
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot
33

34
JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \
35
        $d/share \
36
        $d/os/$(HOTSPOT_TARGET_OS) \
37
        $d/os/$(HOTSPOT_TARGET_OS_TYPE) \
38
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH) \
39
        $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
40
    ))) \
41
    $(JVM_VARIANT_OUTPUTDIR)/gensrc
42
    #
43

44
JVM_CFLAGS_INCLUDES += \
45
    $(patsubst %,-I%,$(JVM_SRC_DIRS)) \
46
    -I$(TOPDIR)/src/hotspot/share/precompiled \
47
    -I$(TOPDIR)/src/hotspot/share/include \
48
    -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
49
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
50
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
51
    -I$(TOPDIR)/src/java.base/share/native/libjimage \
52
    #
53

54
# INCLUDE_SUFFIX_* is only meant for including the proper
55
# platform files. Don't use it to guard code. Use the value of
56
# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
57
# Remaining TARGET_ARCH_* is needed to select the cpu specific
58
# sources for 64-bit ARM ports (arm versus aarch64).
59
JVM_CFLAGS_TARGET_DEFINES += \
60
    -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
61
    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
62
    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
63
    -DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \
64
    -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
65
    -D$(HOTSPOT_TARGET_CPU_DEFINE) \
66
    -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
67
    #
68

69
ifeq ($(DEBUG_LEVEL), release)
70
  # release builds disable uses of assert macro from <assert.h>.
71
  JVM_CFLAGS_DEBUGLEVEL := -DNDEBUG
72
  # For hotspot, release builds differ internally between "optimized" and "product"
73
  # in that "optimize" does not define PRODUCT.
74
  ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
75
    JVM_CFLAGS_DEBUGLEVEL += -DPRODUCT
76
  endif
77
else ifeq ($(DEBUG_LEVEL), fastdebug)
78
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT
79
  ifeq ($(call isTargetOs, aix), false)
80
    # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on AIX.
81
    JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS
82
  endif
83
else ifeq ($(DEBUG_LEVEL), slowdebug)
84
  # _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler
85
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_
86
endif
87

88
JVM_CFLAGS += \
89
    $(JVM_CFLAGS_DEBUGLEVEL) \
90
    $(JVM_CFLAGS_TARGET_DEFINES) \
91
    $(JVM_CFLAGS_FEATURES) \
92
    $(JVM_CFLAGS_INCLUDES) \
93
    $(EXTRA_CFLAGS) \
94
    #
95

96
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
97
ifeq ($(USE_PRECOMPILED_HEADER), false)
98
  JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
99
endif
100

101
ifneq ($(HOTSPOT_OVERRIDE_LIBPATH), )
102
  JVM_CFLAGS += -DOVERRIDE_LIBPATH='"$(HOTSPOT_OVERRIDE_LIBPATH)"'
103
endif
104

105
ifeq ($(ENABLE_COMPATIBLE_CDS_ALIGNMENT), true)
106
  JVM_CFLAGS += -DCOMPATIBLE_CDS_ALIGNMENT
107
endif
108

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.