author | michaelm |
Wed, 29 Nov 2017 16:59:38 +0000 | |
branch | http-client-branch |
changeset 55912 | dfa9489d1cb1 |
parent 47871 | 5ab3961d20dd |
child 48021 | 3bb4d90d1ebc |
child 48093 | 2cb07c3778e1 |
permissions | -rw-r--r-- |
37437 | 1 |
# |
46560
388aa8d67c80
8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents:
44411
diff
changeset
|
2 |
# Copyright (c) 2013, 2017, 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 |
|
27 |
# jvm feature set, and specific file overrides. |
|
28 |
include lib/JvmFeatures.gmk |
|
29 |
include lib/JvmOverrideFiles.gmk |
|
30 |
||
47314 | 31 |
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileJvm.gmk)) |
37437 | 32 |
|
33 |
################################################################################ |
|
34 |
# Setup compilation of the main Hotspot native library (libjvm). |
|
35 |
||
36 |
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm |
|
37 |
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile |
|
38 |
||
39 |
################################################################################ |
|
40 |
# Platform independent setup |
|
41 |
||
42 |
# This variable may be added to by a custom extension |
|
47217 | 43 |
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot |
37437 | 44 |
|
45 |
JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \ |
|
47217 | 46 |
$d/share \ |
47 |
$d/os/$(HOTSPOT_TARGET_OS) \ |
|
48 |
$d/os/$(HOTSPOT_TARGET_OS_TYPE) \ |
|
49 |
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH) \ |
|
50 |
$d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \ |
|
37437 | 51 |
))) \ |
52 |
$(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles \ |
|
53 |
$(JVM_VARIANT_OUTPUTDIR)/gensrc/tracefiles \ |
|
54 |
# |
|
55 |
||
56 |
JVM_CFLAGS_INCLUDES += \ |
|
57 |
$(patsubst %,-I%,$(filter-out $(JVM_VARIANT_OUTPUTDIR)/gensrc/%, $(JVM_SRC_DIRS))) \ |
|
58 |
-I$(JVM_VARIANT_OUTPUTDIR)/gensrc \ |
|
47217 | 59 |
-I$(TOPDIR)/src/hotspot/share/precompiled \ |
47646 | 60 |
-I$(TOPDIR)/src/java.base/share/native/include \ |
47765
b7c7428eaab9
8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents:
47646
diff
changeset
|
61 |
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \ |
37437 | 62 |
# |
63 |
||
40010 | 64 |
# INCLUDE_SUFFIX_* is only meant for including the proper |
65 |
# platform files. Don't use it to guard code. Use the value of |
|
66 |
# 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
|
67 |
# Remaining TARGET_ARCH_* is needed to select the cpu specific |
42664 | 68 |
# sources for 64-bit ARM ports (arm versus aarch64). |
37437 | 69 |
JVM_CFLAGS_TARGET_DEFINES += \ |
70 |
-DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \ |
|
40010 | 71 |
-DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \ |
72 |
-DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \ |
|
46560
388aa8d67c80
8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents:
44411
diff
changeset
|
73 |
-DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \ |
37437 | 74 |
-DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \ |
75 |
-D$(HOTSPOT_TARGET_CPU_DEFINE) \ |
|
76 |
-DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \ |
|
77 |
# |
|
78 |
||
79 |
ifeq ($(DEBUG_LEVEL), release) |
|
80 |
# For hotspot, release builds differ internally between "optimized" and "product" |
|
81 |
# in that "optimize" does not define PRODUCT. |
|
82 |
ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized) |
|
83 |
JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT |
|
84 |
endif |
|
85 |
else ifeq ($(DEBUG_LEVEL), fastdebug) |
|
86 |
JVM_CFLAGS_DEBUGLEVEL := -DASSERT |
|
87 |
ifeq ($(filter $(OPENJDK_TARGET_OS), windows aix), ) |
|
88 |
# NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX. |
|
89 |
JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS |
|
90 |
endif |
|
91 |
else ifeq ($(DEBUG_LEVEL), slowdebug) |
|
92 |
# _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler |
|
93 |
JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_ |
|
94 |
endif |
|
95 |
||
96 |
JVM_CFLAGS += \ |
|
97 |
$(JVM_CFLAGS_DEBUGLEVEL) \ |
|
98 |
$(JVM_CFLAGS_TARGET_DEFINES) \ |
|
99 |
$(JVM_CFLAGS_FEATURES) \ |
|
100 |
$(JVM_CFLAGS_INCLUDES) \ |
|
101 |
$(EXTRA_CFLAGS) \ |
|
102 |
# |
|
103 |
||
104 |
JVM_LDFLAGS += \ |
|
105 |
$(SHARED_LIBRARY_FLAGS) \ |
|
106 |
$(JVM_LDFLAGS_FEATURES) \ |
|
107 |
$(EXTRA_LDFLAGS) \ |
|
108 |
# |
|
109 |
||
110 |
JVM_LIBS += \ |
|
111 |
$(JVM_LIBS_FEATURES) \ |
|
112 |
# |
|
113 |
||
114 |
# These files and directories are always excluded |
|
47871
5ab3961d20dd
8191204: Post-consolidation cleaning up of the build system
ihse
parents:
47765
diff
changeset
|
115 |
JVM_EXCLUDE_FILES += jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp args.cc |
37437 | 116 |
JVM_EXCLUDES += adlc |
117 |
||
118 |
# Needed by vm_version.cpp |
|
119 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
120 |
OPENJDK_TARGET_CPU_VM_VERSION := amd64 |
|
121 |
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
|
122 |
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
|
123 |
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
|
124 |
ifeq ($(OPENJDK_TARGET_CPU), aarch64) |
8c642d0b237e
8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents:
43402
diff
changeset
|
125 |
# 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
|
126 |
# 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
|
127 |
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
|
128 |
endif |
37437 | 129 |
else |
130 |
OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU) |
|
131 |
endif |
|
132 |
||
133 |
CFLAGS_VM_VERSION := \ |
|
134 |
$(VERSION_CFLAGS) \ |
|
135 |
-DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \ |
|
136 |
-DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \ |
|
137 |
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \ |
|
138 |
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \ |
|
139 |
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \ |
|
140 |
# |
|
141 |
||
142 |
# -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
|
143 |
ifeq ($(USE_PRECOMPILED_HEADER), false) |
37437 | 144 |
JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER |
145 |
endif |
|
146 |
||
147 |
################################################################################ |
|
148 |
# Platform specific setup |
|
149 |
||
42664 | 150 |
# ARM source selection |
151 |
||
152 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm) |
|
153 |
JVM_EXCLUDE_PATTERNS += arm_64 |
|
154 |
||
155 |
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
|
156 |
# For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm |
42664 | 157 |
# hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm. |
158 |
# Exclude the aarch64 and 32 bit arm files for this build. |
|
159 |
ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm) |
|
160 |
JVM_EXCLUDE_PATTERNS += arm_32 aarch64 |
|
161 |
endif |
|
162 |
endif |
|
163 |
||
37437 | 164 |
ifneq ($(filter $(OPENJDK_TARGET_OS), linux macosx windows), ) |
47217 | 165 |
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp |
37437 | 166 |
endif |
167 |
||
168 |
ifeq ($(OPENJDK_TARGET_CPU), x86) |
|
169 |
JVM_EXCLUDE_PATTERNS += x86_64 |
|
170 |
else ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
171 |
JVM_EXCLUDE_PATTERNS += x86_32 |
|
172 |
endif |
|
173 |
||
174 |
# Inline assembly for solaris |
|
175 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
176 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
47217 | 177 |
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.il |
37437 | 178 |
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
47217 | 179 |
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il |
37437 | 180 |
endif |
181 |
endif |
|
182 |
||
183 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9) |
|
184 |
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), false) |
|
185 |
# NOTE: In the old build, we weirdly enough set -g/-g0 always, regardless |
|
186 |
# of if debug symbols were needed. Without it, compilation fails on |
|
187 |
# sparc! :-( |
|
188 |
JVM_CFLAGS += -g0 |
|
189 |
endif |
|
190 |
endif |
|
191 |
||
192 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
193 |
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
|
194 |
RC_DESC := 64-Bit$(SPACE) |
|
195 |
endif |
|
196 |
JVM_RCFLAGS += -D"HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(RC_DESC)$(JVM_VARIANT) VM" |
|
197 |
endif |
|
198 |
||
199 |
JVM_OPTIMIZATION ?= HIGHEST_JVM |
|
200 |
||
41674
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
201 |
# 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
|
202 |
# 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
|
203 |
# default. |
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
204 |
JVM_STRIPFLAGS ?= $(STRIPFLAGS) |
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
205 |
|
37437 | 206 |
################################################################################ |
207 |
# Now set up the actual compilation of the main hotspot native library |
|
208 |
||
209 |
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \ |
|
41193
9e274c9c3047
8160630: libjimage.so and others should link statically to libgcc
erikj
parents:
40010
diff
changeset
|
210 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
37437 | 211 |
LIBRARY := jvm, \ |
41277 | 212 |
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ |
37437 | 213 |
SRC := $(JVM_SRC_DIRS), \ |
214 |
EXCLUDES := $(JVM_EXCLUDES), \ |
|
215 |
EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \ |
|
216 |
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \ |
|
217 |
EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \ |
|
218 |
CFLAGS := $(JVM_CFLAGS), \ |
|
219 |
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
220 |
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
221 |
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \ |
|
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46560
diff
changeset
|
222 |
DISABLED_WARNINGS_clang := tautological-compare, \ |
37437 | 223 |
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \ |
224 |
1540-1088 1500-010, \ |
|
225 |
ASFLAGS := $(JVM_ASFLAGS), \ |
|
226 |
LDFLAGS := $(JVM_LDFLAGS), \ |
|
227 |
LIBS := $(JVM_LIBS), \ |
|
228 |
OPTIMIZATION := $(JVM_OPTIMIZATION), \ |
|
229 |
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \ |
|
230 |
MAPFILE := $(JVM_MAPFILE), \ |
|
231 |
USE_MAPFILE_FOR_SYMBOLS := true, \ |
|
41674
8ff2f216109b
8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents:
40010
diff
changeset
|
232 |
STRIPFLAGS := $(JVM_STRIPFLAGS), \ |
37437 | 233 |
EMBED_MANIFEST := true, \ |
234 |
RC_FLAGS := $(JVM_RCFLAGS), \ |
|
47217 | 235 |
VERSIONINFO_RESOURCE := $(TOPDIR)/src/hotspot/os/windows/version.rc, \ |
37437 | 236 |
PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \ |
237 |
PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \ |
|
238 |
)) |
|
239 |
||
41277 | 240 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
241 |
# It doesn't matter which jvm.lib file gets exported, but we need |
|
242 |
# to pick just one. |
|
243 |
ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS))) |
|
244 |
$(eval $(call SetupCopyFiles, COPY_JVM_LIB, \ |
|
245 |
DEST := $(LIB_OUTPUTDIR), \ |
|
246 |
FILES :=$(JVM_VARIANT_OUTPUTDIR)/libjvm/objs/jvm.lib, \ |
|
247 |
)) |
|
248 |
TARGETS += $(COPY_JVM_LIB) |
|
249 |
endif |
|
250 |
endif |
|
251 |
||
37437 | 252 |
# AIX warning explanation: |
253 |
# 1500-010 : (W) WARNING in ...: Infinite loop. Program may not stop. |
|
254 |
# There are several infinite loops in the vm, so better suppress. |
|
255 |
# 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...". |
|
256 |
# 1540-0216 : (W) An expression of type .. cannot be converted to type .. |
|
257 |
# In hotspot this fires for functionpointer to pointer conversions |
|
258 |
# 1540-1088 : (W) The exception specification is being ignored. |
|
259 |
# In hotspot this is caused by throw() in declaration of new() in nmethod.hpp. |
|
260 |
# 1540-1090 : (I) The destructor of "..." might not be called. |
|
261 |
# 1540-1639 : (I) The behavior of long type bit fields has changed ... |
|
262 |
||
263 |
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only |
|
264 |
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated |
|
265 |
# after all object files are built, but before the jvm library is linked. |
|
266 |
include lib/JvmMapfile.gmk |
|
267 |
||
268 |
TARGETS += $(BUILD_LIBJVM) |