make/hotspot/lib/JvmFlags.gmk
author ihse
Thu, 07 Feb 2019 12:35:45 +0100
changeset 53683 48ff68e2fe5c
parent 52734 d537553ed639
child 53717 f09d78e1fbfe
permissions -rw-r--r--
8218431: Improved platform checking in makefiles Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48608
diff changeset
     2
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49412
diff changeset
    26
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFlags.gmk))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
################################################################################
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49412
diff changeset
    29
# Setup JVM_CFLAGS. These are shared between GensrcDtrace.gmk and CompileJvm.gmk.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
# This variable may be added to by a custom extension
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    32
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    35
        $d/share \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    36
        $d/os/$(HOTSPOT_TARGET_OS) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    37
        $d/os/$(HOTSPOT_TARGET_OS_TYPE) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    38
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    39
        $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
    ))) \
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49412
diff changeset
    41
    $(JVM_VARIANT_OUTPUTDIR)/gensrc
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
JVM_CFLAGS_INCLUDES += \
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49412
diff changeset
    45
    $(patsubst %,-I%,$(JVM_SRC_DIRS)) \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    46
    -I$(TOPDIR)/src/hotspot/share/precompiled \
48300
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 48111
diff changeset
    47
    -I$(TOPDIR)/src/hotspot/share/include \
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 48111
diff changeset
    48
    -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48300
diff changeset
    49
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48300
diff changeset
    50
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
48011
dac108a7b06a 8191203: Remove duplicated jimage.hpp
ihse
parents: 48009
diff changeset
    51
    -I$(TOPDIR)/src/java.base/share/native/libjimage \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    54
# INCLUDE_SUFFIX_* is only meant for including the proper
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    55
# platform files. Don't use it to guard code. Use the value of
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    56
# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
    57
# Remaining TARGET_ARCH_* is needed to select the cpu specific
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
    58
# sources for 64-bit ARM ports (arm versus aarch64).
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
JVM_CFLAGS_TARGET_DEFINES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
    -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    61
    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    62
    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
46560
388aa8d67c80 8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents: 44411
diff changeset
    63
    -DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
    -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
    -D$(HOTSPOT_TARGET_CPU_DEFINE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
    -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
ifeq ($(DEBUG_LEVEL), release)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
  # For hotspot, release builds differ internally between "optimized" and "product"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
  # in that "optimize" does not define PRODUCT.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
  ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
else ifeq ($(DEBUG_LEVEL), fastdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52734
diff changeset
    77
  ifeq ($call isTargetOs, windows aix), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
else ifeq ($(DEBUG_LEVEL), slowdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
  # _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
JVM_CFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
    $(JVM_CFLAGS_DEBUGLEVEL) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
    $(JVM_CFLAGS_TARGET_DEFINES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
    $(JVM_CFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
    $(JVM_CFLAGS_INCLUDES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
    $(EXTRA_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
    95
ifeq ($(USE_PRECOMPILED_HEADER), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
  JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
endif
52734
d537553ed639 8214332: Add a flag for overriding default JNI library search path
dholmes
parents: 49761
diff changeset
    98
d537553ed639 8214332: Add a flag for overriding default JNI library search path
dholmes
parents: 49761
diff changeset
    99
ifneq ($(HOTSPOT_OVERRIDE_LIBPATH), )
d537553ed639 8214332: Add a flag for overriding default JNI library search path
dholmes
parents: 49761
diff changeset
   100
  JVM_CFLAGS += -DOVERRIDE_LIBPATH='"$(HOTSPOT_OVERRIDE_LIBPATH)"'
d537553ed639 8214332: Add a flag for overriding default JNI library search path
dholmes
parents: 49761
diff changeset
   101
endif