Tue, 08 Aug 2017 15:57:29 +0800
merge
1 #
2 # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
23 #
25 #
26 # This file has been modified by Loongson Technology in 2015. These
27 # modifications are Copyright (c) 2015 Loongson Technology, and are made
28 # available on the same license terms set forth above.
29 #
31 # The common definitions for hotspot linux builds.
32 # Include the top level defs.make under make directory instead of this one.
33 # This file is included into make/defs.make.
35 SLASH_JAVA ?= /java
37 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
39 # ARCH can be set explicitly in spec.gmk
40 ifndef ARCH
41 ARCH := $(shell uname -m)
42 # Fold little endian PowerPC64 into big-endian (if ARCH is set in
43 # hotspot-spec.gmk, this will be done by the configure script).
44 ifeq ($(ARCH),ppc64le)
45 ARCH := ppc64
46 endif
47 endif
48 ifeq ($(ARCH), mips64el)
49 ARCH=mips64
50 endif
52 PATH_SEP ?= :
54 ifeq ($(LP64), 1)
55 ARCH_DATA_MODEL ?= 64
56 else
57 ARCH_DATA_MODEL ?= 32
58 endif
60 # zero
61 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
62 ifeq ($(ARCH_DATA_MODEL), 64)
63 MAKE_ARGS += LP64=1
64 endif
65 PLATFORM = linux-zero
66 VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH))
67 HS_ARCH = zero
68 ARCH = zero
69 endif
71 # ia64
72 ifeq ($(ARCH), ia64)
73 ARCH_DATA_MODEL = 64
74 MAKE_ARGS += LP64=1
75 PLATFORM = linux-ia64
76 VM_PLATFORM = linux_ia64
77 HS_ARCH = ia64
78 endif
80 # sparc
81 ifeq ($(ARCH), sparc64)
82 ifeq ($(ARCH_DATA_MODEL), 64)
83 ARCH_DATA_MODEL = 64
84 MAKE_ARGS += LP64=1
85 PLATFORM = linux-sparcv9
86 VM_PLATFORM = linux_sparcv9
87 else
88 ARCH_DATA_MODEL = 32
89 PLATFORM = linux-sparc
90 VM_PLATFORM = linux_sparc
91 endif
92 HS_ARCH = sparc
93 endif
95 # mips
96 ifeq ($(ARCH), mips64)
97 ARCH_DATA_MODEL = 64
98 MAKE_ARGS += LP64=1
99 VM_PLATFORM = linux_mips64
100 PLATFORM = linux-mips64
101 HS_ARCH = mips
102 endif
104 # amd64/x86_64
105 ifneq (,$(findstring $(ARCH), amd64 x86_64))
106 ifeq ($(ARCH_DATA_MODEL), 64)
107 ARCH_DATA_MODEL = 64
108 MAKE_ARGS += LP64=1
109 PLATFORM = linux-amd64
110 VM_PLATFORM = linux_amd64
111 HS_ARCH = x86
112 else
113 ARCH_DATA_MODEL = 32
114 PLATFORM = linux-i586
115 VM_PLATFORM = linux_i486
116 HS_ARCH = x86
117 # We have to reset ARCH to i686 since SRCARCH relies on it
118 ARCH = i686
119 endif
120 endif
122 # i686/i586 ie 32-bit x86
123 ifneq (,$(findstring $(ARCH), i686 i586))
124 ARCH_DATA_MODEL = 32
125 PLATFORM = linux-i586
126 VM_PLATFORM = linux_i486
127 HS_ARCH = x86
128 endif
130 # ARM
131 ifeq ($(ARCH), arm)
132 ARCH_DATA_MODEL = 32
133 PLATFORM = linux-arm
134 VM_PLATFORM = linux_arm
135 HS_ARCH = arm
136 endif
138 # PPC
139 ifeq ($(ARCH), ppc)
140 ARCH_DATA_MODEL = 32
141 PLATFORM = linux-ppc
142 VM_PLATFORM = linux_ppc
143 HS_ARCH = ppc
144 endif
146 # PPC64
147 ifeq ($(ARCH), ppc64)
148 ARCH_DATA_MODEL = 64
149 MAKE_ARGS += LP64=1
150 PLATFORM = linux-ppc64
151 VM_PLATFORM = linux_ppc64
152 HS_ARCH = ppc
153 endif
155 # On 32 bit linux we build server and client, on 64 bit just server.
156 ifeq ($(JVM_VARIANTS),)
157 ifeq ($(ARCH_DATA_MODEL), 32)
158 JVM_VARIANTS:=client,server
159 JVM_VARIANT_CLIENT:=true
160 JVM_VARIANT_SERVER:=true
161 else
162 JVM_VARIANTS:=server
163 JVM_VARIANT_SERVER:=true
164 endif
165 endif
167 # determine if HotSpot is being built in JDK6 or earlier version
168 JDK6_OR_EARLIER=0
169 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
170 # if the longer variable names (newer build style) are set, then check those
171 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
172 JDK6_OR_EARLIER=1
173 endif
174 else
175 # the longer variables aren't set so check the shorter variable names
176 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
177 JDK6_OR_EARLIER=1
178 endif
179 endif
181 ifeq ($(JDK6_OR_EARLIER),0)
182 # Full Debug Symbols is supported on JDK7 or newer.
183 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
184 # builds is enabled with debug info files ZIP'ed to save space. For
185 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
186 # debug build without debug info isn't very useful.
187 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
188 #
189 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
190 # disabled for a BUILD_FLAVOR == product build.
191 #
192 # Note: Use of a different variable name for the FDS override option
193 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
194 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
195 # in options via environment variables, use of distinct variables
196 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
197 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
198 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
199 # the same variable name is used, then different values can be picked
200 # up by different parts of the build. Just to be clear, we only need
201 # two variable names because the incoming option value can be
202 # overridden in some situations, e.g., a BUILD_FLAVOR != product
203 # build.
205 # Due to the multiple sub-make processes that occur this logic gets
206 # executed multiple times. We reduce the noise by at least checking that
207 # BUILD_FLAVOR has been set.
208 ifneq ($(BUILD_FLAVOR),)
209 ifeq ($(BUILD_FLAVOR), product)
210 FULL_DEBUG_SYMBOLS ?= 1
211 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
212 else
213 # debug variants always get Full Debug Symbols (if available)
214 ENABLE_FULL_DEBUG_SYMBOLS = 1
215 endif
216 _JUNK_ := $(shell \
217 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
218 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
220 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
221 # Default OBJCOPY comes from GNU Binutils on Linux
222 ifeq ($(CROSS_COMPILE_ARCH),)
223 DEF_OBJCOPY=/usr/bin/objcopy
224 else
225 # Assume objcopy is part of the cross-compilation toolset
226 ifneq ($(ALT_COMPILER_PATH),)
227 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
228 endif
229 endif
230 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
231 ifneq ($(ALT_OBJCOPY),)
232 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
233 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
234 endif
236 ifeq ($(OBJCOPY),)
237 _JUNK_ := $(shell \
238 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
239 ENABLE_FULL_DEBUG_SYMBOLS=0
240 _JUNK_ := $(shell \
241 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
242 else
243 _JUNK_ := $(shell \
244 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
246 # Library stripping policies for .debuginfo configs:
247 # all_strip - strips everything from the library
248 # min_strip - strips most stuff from the library; leaves minimum symbols
249 # no_strip - does not strip the library at all
250 #
251 # Oracle security policy requires "all_strip". A waiver was granted on
252 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
253 #
254 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
255 #
256 STRIP_POLICY ?= min_strip
258 _JUNK_ := $(shell \
259 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
261 ZIP_DEBUGINFO_FILES ?= 1
263 _JUNK_ := $(shell \
264 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
265 endif
266 endif # ENABLE_FULL_DEBUG_SYMBOLS=1
267 endif # BUILD_FLAVOR
268 endif # JDK_6_OR_EARLIER
270 JDK_INCLUDE_SUBDIR=linux
272 # Library suffix
273 LIBRARY_SUFFIX=so
275 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
277 # client and server subdirectories have symbolic links to ../libjsig.so
278 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
279 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
280 ifeq ($(ZIP_DEBUGINFO_FILES),1)
281 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
282 else
283 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
284 endif
285 endif
286 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
287 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
288 EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
290 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)
291 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
292 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
293 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
294 ifeq ($(ZIP_DEBUGINFO_FILES),1)
295 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
296 else
297 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
298 endif
299 endif
300 endif
302 ifeq ($(JVM_VARIANT_CLIENT),true)
303 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
304 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
305 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
306 ifeq ($(ZIP_DEBUGINFO_FILES),1)
307 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
308 else
309 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
310 endif
311 endif
312 endif
314 ifeq ($(JVM_VARIANT_MINIMAL1),true)
315 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
316 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
318 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
319 ifeq ($(ZIP_DEBUGINFO_FILES),1)
320 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
321 else
322 EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
323 endif
324 endif
325 endif
327 # Serviceability Binaries
328 # No SA Support for PPC, IA64, ARM or zero
329 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
330 $(EXPORT_LIB_DIR)/sa-jdi.jar
331 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
332 $(EXPORT_LIB_DIR)/sa-jdi.jar
333 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
334 ifeq ($(ZIP_DEBUGINFO_FILES),1)
335 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
336 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
337 else
338 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
339 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
340 endif
341 endif
342 ADD_SA_BINARIES/ppc =
343 ADD_SA_BINARIES/ia64 =
344 ADD_SA_BINARIES/arm =
345 ADD_SA_BINARIES/zero =
347 -include $(HS_ALT_MAKE)/linux/makefiles/defs.make
349 EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))