author | kvn |
Thu, 03 May 2018 09:07:40 -0700 | |
changeset 49972 | 37b2446d7f86 |
parent 49681 | 4beba2c2a329 |
child 50128 | ea4e6d3dbf60 |
permissions | -rw-r--r-- |
37437 | 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 | 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 |
# Include support files that will setup compiler flags due to the selected |
|
49553 | 27 |
# jvm feature set, specific file overrides, and general flags. |
37437 | 28 |
include lib/JvmFeatures.gmk |
29 |
include lib/JvmOverrideFiles.gmk |
|
49553 | 30 |
include lib/JvmFlags.gmk |
37437 | 31 |
|
49553 | 32 |
# Include support files that will setup DTRACE_EXTRA_OBJECT_FILES. |
33 |
include lib/JvmDtraceObjects.gmk |
|
37437 | 34 |
|
35 |
################################################################################ |
|
36 |
# Setup compilation of the main Hotspot native library (libjvm). |
|
37 |
||
38 |
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm |
|
39 |
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile |
|
40 |
||
41 |
################################################################################ |
|
42 |
# Platform independent setup |
|
43 |
||
44 |
JVM_LDFLAGS += \ |
|
45 |
$(SHARED_LIBRARY_FLAGS) \ |
|
46 |
$(JVM_LDFLAGS_FEATURES) \ |
|
47 |
$(EXTRA_LDFLAGS) \ |
|
48 |
# |
|
49 |
||
50 |
JVM_LIBS += \ |
|
51 |
$(JVM_LIBS_FEATURES) \ |
|
52 |
# |
|
53 |
||
54 |
# These files and directories are always excluded |
|
48093 | 55 |
JVM_EXCLUDE_FILES += args.cc |
37437 | 56 |
JVM_EXCLUDES += adlc |
57 |
||
58 |
# Needed by vm_version.cpp |
|
59 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
60 |
OPENJDK_TARGET_CPU_VM_VERSION := amd64 |
|
61 |
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
|
62 |
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
|
63 |
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
|
64 |
ifeq ($(OPENJDK_TARGET_CPU), aarch64) |
8c642d0b237e
8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents:
43402
diff
changeset
|
65 |
# 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
|
66 |
# 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
|
67 |
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
|
68 |
endif |
37437 | 69 |
else |
70 |
OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU) |
|
71 |
endif |
|
72 |
||
73 |
CFLAGS_VM_VERSION := \ |
|
74 |
$(VERSION_CFLAGS) \ |
|
75 |
-DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \ |
|
76 |
-DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \ |
|
77 |
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \ |
|
78 |
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \ |
|
79 |
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \ |
|
80 |
# |
|
81 |
||
82 |
################################################################################ |
|
83 |
# Platform specific setup |
|
84 |
||
42664 | 85 |
# ARM source selection |
86 |
||
87 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm) |
|
88 |
JVM_EXCLUDE_PATTERNS += arm_64 |
|
89 |
||
90 |
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
|
91 |
# For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm |
42664 | 92 |
# hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm. |
93 |
# Exclude the aarch64 and 32 bit arm files for this build. |
|
94 |
ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm) |
|
95 |
JVM_EXCLUDE_PATTERNS += arm_32 aarch64 |
|
96 |
endif |
|
97 |
endif |
|
98 |
||
37437 | 99 |
ifneq ($(filter $(OPENJDK_TARGET_OS), linux macosx windows), ) |
47217 | 100 |
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp |
37437 | 101 |
endif |
102 |
||
103 |
ifeq ($(OPENJDK_TARGET_CPU), x86) |
|
104 |
JVM_EXCLUDE_PATTERNS += x86_64 |
|
105 |
else ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
106 |
JVM_EXCLUDE_PATTERNS += x86_32 |
|
107 |
endif |
|
108 |
||
109 |
# Inline assembly for solaris |
|
110 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
111 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
47217 | 112 |
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.il |
37437 | 113 |
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
47217 | 114 |
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il |
37437 | 115 |
endif |
49678
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
116 |
# Exclude warnings in devstudio 12.6 |
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
117 |
ifeq ($(CC_VERSION_NUMBER), 5.15) |
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
118 |
DISABLED_WARNINGS_solstudio := SEC_ARR_OUTSIDE_BOUND_READ \ |
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
119 |
SEC_ARR_OUTSIDE_BOUND_WRITE |
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
120 |
endif |
37437 | 121 |
endif |
122 |
||
123 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9) |
|
124 |
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), false) |
|
125 |
# NOTE: In the old build, we weirdly enough set -g/-g0 always, regardless |
|
126 |
# of if debug symbols were needed. Without it, compilation fails on |
|
127 |
# sparc! :-( |
|
128 |
JVM_CFLAGS += -g0 |
|
129 |
endif |
|
130 |
endif |
|
131 |
||
132 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
133 |
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
|
134 |
RC_DESC := 64-Bit$(SPACE) |
|
135 |
endif |
|
136 |
JVM_RCFLAGS += -D"HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(RC_DESC)$(JVM_VARIANT) VM" |
|
137 |
endif |
|
138 |
||
139 |
JVM_OPTIMIZATION ?= HIGHEST_JVM |
|
140 |
||
41674
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
141 |
# 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
|
142 |
# 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
|
143 |
# default. |
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
144 |
JVM_STRIPFLAGS ?= $(STRIPFLAGS) |
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
145 |
|
37437 | 146 |
################################################################################ |
147 |
# Now set up the actual compilation of the main hotspot native library |
|
148 |
||
149 |
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \ |
|
49070
d7859531621b
8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents:
48608
diff
changeset
|
150 |
NAME := jvm, \ |
41193
9e274c9c3047
8160630: libjimage.so and others should link statically to libgcc
erikj
parents:
40010
diff
changeset
|
151 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
41277 | 152 |
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ |
37437 | 153 |
SRC := $(JVM_SRC_DIRS), \ |
154 |
EXCLUDES := $(JVM_EXCLUDES), \ |
|
155 |
EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \ |
|
156 |
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \ |
|
157 |
EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \ |
|
158 |
CFLAGS := $(JVM_CFLAGS), \ |
|
159 |
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
|
160 |
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \ |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46560
diff
changeset
|
161 |
DISABLED_WARNINGS_clang := tautological-compare, \ |
49678
fa26e7c6efb7
8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6
gadams
parents:
49412
diff
changeset
|
162 |
DISABLED_WARNINGS_solstudio := $(DISABLED_WARNINGS_solstudio), \ |
37437 | 163 |
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \ |
164 |
1540-1088 1500-010, \ |
|
165 |
ASFLAGS := $(JVM_ASFLAGS), \ |
|
166 |
LDFLAGS := $(JVM_LDFLAGS), \ |
|
167 |
LIBS := $(JVM_LIBS), \ |
|
168 |
OPTIMIZATION := $(JVM_OPTIMIZATION), \ |
|
169 |
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \ |
|
170 |
MAPFILE := $(JVM_MAPFILE), \ |
|
171 |
USE_MAPFILE_FOR_SYMBOLS := true, \ |
|
41674
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
172 |
STRIPFLAGS := $(JVM_STRIPFLAGS), \ |
37437 | 173 |
EMBED_MANIFEST := true, \ |
174 |
RC_FLAGS := $(JVM_RCFLAGS), \ |
|
47217 | 175 |
VERSIONINFO_RESOURCE := $(TOPDIR)/src/hotspot/os/windows/version.rc, \ |
37437 | 176 |
PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \ |
177 |
PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \ |
|
178 |
)) |
|
179 |
||
41277 | 180 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
181 |
# It doesn't matter which jvm.lib file gets exported, but we need |
|
182 |
# to pick just one. |
|
49263
78af880eec61
8199749: Debug symbols are not copied to exploded image on Mac
erikj
parents:
49160
diff
changeset
|
183 |
ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN)) |
41277 | 184 |
$(eval $(call SetupCopyFiles, COPY_JVM_LIB, \ |
185 |
DEST := $(LIB_OUTPUTDIR), \ |
|
49263
78af880eec61
8199749: Debug symbols are not copied to exploded image on Mac
erikj
parents:
49160
diff
changeset
|
186 |
FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \ |
41277 | 187 |
)) |
188 |
TARGETS += $(COPY_JVM_LIB) |
|
189 |
endif |
|
190 |
endif |
|
191 |
||
37437 | 192 |
# AIX warning explanation: |
193 |
# 1500-010 : (W) WARNING in ...: Infinite loop. Program may not stop. |
|
194 |
# There are several infinite loops in the vm, so better suppress. |
|
195 |
# 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...". |
|
196 |
# 1540-0216 : (W) An expression of type .. cannot be converted to type .. |
|
197 |
# In hotspot this fires for functionpointer to pointer conversions |
|
198 |
# 1540-1088 : (W) The exception specification is being ignored. |
|
199 |
# In hotspot this is caused by throw() in declaration of new() in nmethod.hpp. |
|
200 |
# 1540-1090 : (I) The destructor of "..." might not be called. |
|
201 |
# 1540-1639 : (I) The behavior of long type bit fields has changed ... |
|
202 |
||
203 |
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only |
|
204 |
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated |
|
205 |
# after all object files are built, but before the jvm library is linked. |
|
206 |
include lib/JvmMapfile.gmk |
|
207 |
||
208 |
TARGETS += $(BUILD_LIBJVM) |
|
49357
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
209 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
210 |
################################################################################ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
211 |
# 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
|
212 |
# 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
|
213 |
# 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
|
214 |
# 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
|
215 |
# |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
216 |
# 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
|
217 |
# |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
218 |
# -C demangle |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
219 |
# -d disassemble |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
220 |
# -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
|
221 |
# -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
|
222 |
# -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
|
223 |
# |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
224 |
# 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
|
225 |
# referenced. |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
226 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
227 |
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
|
228 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
229 |
DEMANGLED_REGEXP := [^:]operator (new|delete) |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
230 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
231 |
# 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
|
232 |
# 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
|
233 |
# 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
|
234 |
ifeq ($(TOOLCHAIN_TYPE), solstudio) |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
235 |
MANGLED_SYMS := \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
236 |
__1c2n6FL_pv_ \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
237 |
__1c2N6FL_pv_ \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
238 |
__1c2k6Fpv_v_ \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
239 |
__1c2K6Fpv_v_ \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
240 |
# |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
241 |
UNDEF_PATTERN := UNDEF |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
242 |
else |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
243 |
MANGLED_SYMS := \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
244 |
_ZdaPv \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
245 |
_ZdlPv \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
246 |
_Znam \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
247 |
_Znwm \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
248 |
# |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
249 |
UNDEF_PATTERN := ' U ' |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
250 |
endif |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
251 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
252 |
define SetupOperatorNewDeleteCheck |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
253 |
$1.op_check: $1 |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
254 |
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
|
255 |
| $(GREP) $(UNDEF_PATTERN)`" ]; then \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
256 |
$(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
|
257 |
$(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
|
258 |
$(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
|
259 |
exit 1; \ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
260 |
fi |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
261 |
$(TOUCH) $$@ |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
262 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
263 |
TARGETS += $1.op_check |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
264 |
endef |
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
265 |
|
aaedb8343784
8198243: Add build time check for global operator new/delete in object files
erikj
parents:
49070
diff
changeset
|
266 |
$(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
|
267 |
endif |