make/hotspot/lib/CompileJvm.gmk
author jwilhelm
Tue, 20 Mar 2018 04:36:44 +0100
changeset 49412 2c3b9dbba7bc
parent 49263 78af880eec61
parent 49357 aaedb8343784
child 49553 58cffb6ec13c
child 49678 fa26e7c6efb7
permissions -rw-r--r--
Merge
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
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    26
# Include support files that will setup compiler flags due to the selected
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
# jvm feature set, and specific file overrides.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
include lib/JvmFeatures.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
include lib/JvmOverrideFiles.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    31
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileJvm.gmk))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
# Setup compilation of the main Hotspot native library (libjvm).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
# Platform independent setup
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
# This variable may be added to by a custom extension
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    43
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    46
        $d/share \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    47
        $d/os/$(HOTSPOT_TARGET_OS) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    48
        $d/os/$(HOTSPOT_TARGET_OS_TYPE) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    49
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    50
        $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
    ))) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
    $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
    $(JVM_VARIANT_OUTPUTDIR)/gensrc/tracefiles \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
JVM_CFLAGS_INCLUDES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
    $(patsubst %,-I%,$(filter-out $(JVM_VARIANT_OUTPUTDIR)/gensrc/%, $(JVM_SRC_DIRS))) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
    -I$(JVM_VARIANT_OUTPUTDIR)/gensrc \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    59
    -I$(TOPDIR)/src/hotspot/share/precompiled \
48300
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 48111
diff changeset
    60
    -I$(TOPDIR)/src/hotspot/share/include \
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 48111
diff changeset
    61
    -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48300
diff changeset
    62
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48300
diff changeset
    63
    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
48011
dac108a7b06a 8191203: Remove duplicated jimage.hpp
ihse
parents: 48009
diff changeset
    64
    -I$(TOPDIR)/src/java.base/share/native/libjimage \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    67
# INCLUDE_SUFFIX_* is only meant for including the proper
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    68
# platform files. Don't use it to guard code. Use the value of
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    69
# 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
    70
# Remaining TARGET_ARCH_* is needed to select the cpu specific
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
    71
# sources for 64-bit ARM ports (arm versus aarch64).
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
JVM_CFLAGS_TARGET_DEFINES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    74
    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    75
    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
46560
388aa8d67c80 8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents: 44411
diff changeset
    76
    -DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    -D$(HOTSPOT_TARGET_CPU_DEFINE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
ifeq ($(DEBUG_LEVEL), release)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
  # For hotspot, release builds differ internally between "optimized" and "product"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
  # in that "optimize" does not define PRODUCT.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
  ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
    JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
else ifeq ($(DEBUG_LEVEL), fastdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
  ifeq ($(filter $(OPENJDK_TARGET_OS), windows aix), )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
    # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
    JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
else ifeq ($(DEBUG_LEVEL), slowdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
  # _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
JVM_CFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
    $(JVM_CFLAGS_DEBUGLEVEL) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
    $(JVM_CFLAGS_TARGET_DEFINES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
    $(JVM_CFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
    $(JVM_CFLAGS_INCLUDES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
    $(EXTRA_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
JVM_LDFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
    $(SHARED_LIBRARY_FLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
    $(JVM_LDFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
    $(EXTRA_LDFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
JVM_LIBS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
    $(JVM_LIBS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
# These files and directories are always excluded
48093
jwilhelm
parents: 47871 48090
diff changeset
   118
JVM_EXCLUDE_FILES += args.cc
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
JVM_EXCLUDES += adlc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
# Needed by vm_version.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
  OPENJDK_TARGET_CPU_VM_VERSION := amd64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   125
  OPENJDK_TARGET_CPU_VM_VERSION := sparc
44411
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   126
else ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   127
  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   128
    # This sets the Oracle Aarch64 port to use arm64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   129
    # while the original Aarch64 port uses aarch64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   130
    OPENJDK_TARGET_CPU_VM_VERSION := arm64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   131
  endif
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
  OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
CFLAGS_VM_VERSION := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
    $(VERSION_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
    -DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
    -DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
    -DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
    -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
    -DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   143
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
# -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
   146
ifeq ($(USE_PRECOMPILED_HEADER), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
  JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   148
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   150
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
# Platform specific setup
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   153
# ARM source selection
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   154
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   155
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   156
  JVM_EXCLUDE_PATTERNS += arm_64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   157
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   158
else ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-aarch64)
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
   159
  # For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   160
  # hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   161
  # Exclude the aarch64 and 32 bit arm files for this build.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   162
  ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   163
    JVM_EXCLUDE_PATTERNS += arm_32 aarch64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   164
  endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   165
endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   166
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
ifneq ($(filter $(OPENJDK_TARGET_OS), linux macosx windows), )
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   168
  JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
ifeq ($(OPENJDK_TARGET_CPU), x86)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
  JVM_EXCLUDE_PATTERNS += x86_64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   173
else ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   174
  JVM_EXCLUDE_PATTERNS += x86_32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   175
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   177
# Inline assembly for solaris
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   178
ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   179
  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   180
    JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.il
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
  else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   182
    JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   186
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   187
  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), false)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   188
    # NOTE: In the old build, we weirdly enough set -g/-g0 always, regardless
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   189
    # of if debug symbols were needed. Without it, compilation fails on
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   190
    # sparc! :-(
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
    JVM_CFLAGS += -g0
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   194
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   195
ifeq ($(OPENJDK_TARGET_OS), windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   197
    RC_DESC := 64-Bit$(SPACE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   198
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   199
  JVM_RCFLAGS += -D"HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(RC_DESC)$(JVM_VARIANT) VM"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   201
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   202
JVM_OPTIMIZATION ?= HIGHEST_JVM
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   203
41674
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   204
# Need to set JVM_STRIPFLAGS to the default value from SPEC since the STRIPFLAGS
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   205
# parameter to SetupNativeCompilation allows an empty value to override the
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   206
# default.
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   207
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   208
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   210
# Now set up the actual compilation of the main hotspot native library
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   211
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   212
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 48608
diff changeset
   213
    NAME := jvm, \
41193
9e274c9c3047 8160630: libjimage.so and others should link statically to libgcc
erikj
parents: 40010
diff changeset
   214
    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   215
    OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   216
    SRC := $(JVM_SRC_DIRS), \
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49070
diff changeset
   217
    EXTRA_FILES := $(DTRACE_EXTRA_SOURCE_FILES), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   218
    EXCLUDES := $(JVM_EXCLUDES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   219
    EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   220
    EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   221
    EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   222
    CFLAGS := $(JVM_CFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   223
    vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48300
diff changeset
   224
    arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 46560
diff changeset
   225
    DISABLED_WARNINGS_clang := tautological-compare, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   226
    DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   227
        1540-1088 1500-010, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   228
    ASFLAGS := $(JVM_ASFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   229
    LDFLAGS := $(JVM_LDFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   230
    LIBS := $(JVM_LIBS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   231
    OPTIMIZATION := $(JVM_OPTIMIZATION), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   232
    OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   233
    MAPFILE := $(JVM_MAPFILE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   234
    USE_MAPFILE_FOR_SYMBOLS := true, \
41674
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   235
    STRIPFLAGS := $(JVM_STRIPFLAGS), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   236
    EMBED_MANIFEST := true, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   237
    RC_FLAGS := $(JVM_RCFLAGS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   238
    VERSIONINFO_RESOURCE := $(TOPDIR)/src/hotspot/os/windows/version.rc, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   239
    PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   240
    PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   241
))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   242
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   243
ifeq ($(OPENJDK_TARGET_OS), windows)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   244
  # It doesn't matter which jvm.lib file gets exported, but we need
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   245
  # to pick just one.
49263
78af880eec61 8199749: Debug symbols are not copied to exploded image on Mac
erikj
parents: 49160
diff changeset
   246
  ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN))
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   247
    $(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   248
        DEST := $(LIB_OUTPUTDIR), \
49263
78af880eec61 8199749: Debug symbols are not copied to exploded image on Mac
erikj
parents: 49160
diff changeset
   249
        FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   250
    ))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   251
    TARGETS += $(COPY_JVM_LIB)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   252
  endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   253
endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   254
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   255
# AIX warning explanation:
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   256
# 1500-010  : (W) WARNING in ...: Infinite loop.  Program may not stop.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   257
#             There are several infinite loops in the vm, so better suppress.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   258
# 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...".
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   259
# 1540-0216 : (W) An expression of type .. cannot be converted to type ..
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   260
#             In hotspot this fires for functionpointer to pointer conversions
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   261
# 1540-1088 : (W) The exception specification is being ignored.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   262
#             In hotspot this is caused by throw() in declaration of new() in nmethod.hpp.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   263
# 1540-1090 : (I) The destructor of "..." might not be called.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   264
# 1540-1639 : (I) The behavior of long type bit fields has changed ...
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   265
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   266
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   267
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   268
# after all object files are built, but before the jvm library is linked.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   269
include lib/JvmMapfile.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   270
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   271
TARGETS += $(BUILD_LIBJVM)
49357
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   272
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   273
################################################################################
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   274
# Hotspot disallows the use of global operators 'new' and 'delete'. This build
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   275
# time check helps enforce this requirement. If you trigger this check and the
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   276
# reference is not obvious from the source, GNU objdump can be used to help find
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   277
# the reference if compiled with GCC:
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   278
#
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   279
# objdump -lrdSC <path/to/file.o>
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   280
#
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   281
# -C demangle
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   282
# -d disassemble
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   283
# -r print relocation entries, interspersed with the disassembly
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   284
# -S print source code, intermixed with disassembly
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   285
# -l include filenames and line numbers
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   286
#
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   287
# Search the output for the operator(s) of interest, to see where they are
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   288
# referenced.
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   289
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   290
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), )
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   291
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   292
  DEMANGLED_REGEXP := [^:]operator (new|delete)
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   293
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   294
  # Running c++filt to find offending symbols in all files is too expensive,
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   295
  # especially on Solaris, so use mangled names when looking for symbols.
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   296
  # Save the demangling for when something is actually found.
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   297
  ifeq ($(TOOLCHAIN_TYPE), solstudio)
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   298
    MANGLED_SYMS := \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   299
        __1c2n6FL_pv_ \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   300
        __1c2N6FL_pv_ \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   301
        __1c2k6Fpv_v_ \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   302
        __1c2K6Fpv_v_ \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   303
        #
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   304
    UNDEF_PATTERN := UNDEF
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   305
  else
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   306
    MANGLED_SYMS := \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   307
        _ZdaPv \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   308
        _ZdlPv \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   309
        _Znam \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   310
        _Znwm \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   311
        #
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   312
    UNDEF_PATTERN := ' U '
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   313
  endif
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   314
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   315
  define SetupOperatorNewDeleteCheck
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   316
    $1.op_check: $1
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   317
	if [ -n "`$(NM) $$< | $(GREP) $(addprefix -e , $(MANGLED_SYMS)) \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   318
	    | $(GREP) $(UNDEF_PATTERN)`" ]; then \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   319
	  $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   320
	  $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   321
	  $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   322
	  exit 1; \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   323
	fi
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   324
	$(TOUCH) $$@
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   325
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   326
    TARGETS += $1.op_check
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   327
  endef
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   328
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   329
  $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 49070
diff changeset
   330
endif