author | ljiang |
Tue, 05 Jun 2018 23:06:32 -0700 | |
changeset 50422 | 04b3e0cc53bb |
parent 50126 | 98f57dff16f3 |
child 50514 | 2a524e603529 |
child 56687 | f0d5c39dfbc1 |
child 56721 | 01b558efd286 |
child 56723 | d927981eeb64 |
child 56726 | 3a9b7a1f9197 |
permissions | -rw-r--r-- |
25859 | 1 |
# |
49070
d7859531621b
8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents:
48766
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
25859 | 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 LauncherCommon.gmk |
|
27 |
||
33523 | 28 |
$(eval $(call SetupBuildLauncher, pack200, \ |
36511 | 29 |
MAIN_MODULE := java.base, \ |
33523 | 30 |
MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \ |
31 |
)) |
|
25859 | 32 |
|
33 |
################################################################################ |
|
34 |
# The order of the object files on the link command line affects the size of the resulting |
|
35 |
# binary (at least on linux) which causes the size to differ between old and new build. |
|
36 |
||
49534 | 37 |
# Tell the compiler not to export any functions unless declared so in |
38 |
# the source code. On Windows, this is the default and cannot be changed. |
|
39 |
# On Mac, we have always exported all symbols, probably due to oversight |
|
40 |
# and/or misunderstanding. To emulate this, don't hide any symbols |
|
41 |
# by default. |
|
50126
98f57dff16f3
8202322: AIX: symbol visibility flags not support on xlc 12.1
mbaesken
parents:
49859
diff
changeset
|
42 |
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding |
49534 | 43 |
# Also provide an override for non-conformant libraries. |
44 |
ifeq ($(TOOLCHAIN_TYPE), gcc) |
|
45 |
CXXFLAGS_JDKEXE += -fvisibility=hidden |
|
46 |
LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL |
|
47 |
else ifeq ($(TOOLCHAIN_TYPE), clang) |
|
48 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
49 |
CXXFLAGS_JDKEXE += -fvisibility=hidden |
|
50 |
endif |
|
51 |
else ifeq ($(TOOLCHAIN_TYPE), solstudio) |
|
52 |
CXXFLAGS_JDKEXE += -xldscope=hidden |
|
53 |
else ifeq ($(TOOLCHAIN_TYPE), xlc) |
|
50126
98f57dff16f3
8202322: AIX: symbol visibility flags not support on xlc 12.1
mbaesken
parents:
49859
diff
changeset
|
54 |
ifneq ($(CC_VERSION_NUMBER), 12.1) |
98f57dff16f3
8202322: AIX: symbol visibility flags not support on xlc 12.1
mbaesken
parents:
49859
diff
changeset
|
55 |
CXXFLAGS_JDKEXE += -qvisibility=hidden |
98f57dff16f3
8202322: AIX: symbol visibility flags not support on xlc 12.1
mbaesken
parents:
49859
diff
changeset
|
56 |
endif |
49534 | 57 |
endif |
58 |
||
47217 | 59 |
UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \ |
60 |
$(TOPDIR)/src/jdk.pack/share/native/unpack200 |
|
61 |
UNPACKEXE_CFLAGS := -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \ |
|
62 |
-I$(TOPDIR)/src/java.base/share/native/libjava \ |
|
63 |
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava |
|
25859 | 64 |
|
65 |
ifeq ($(USE_EXTERNAL_LIBZ), true) |
|
66 |
UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB |
|
33305
ed708a0e3482
8140223: fix the build with a toolchain with a linker defaulting to ld --as-needed
erikj
parents:
30434
diff
changeset
|
67 |
UNPACKEXE_LIBS := -lz |
25859 | 68 |
else |
47217 | 69 |
UNPACKEXE_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/libzip/zlib |
27565 | 70 |
UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \ |
71 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \ |
|
72 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \ |
|
73 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zadler32$(OBJ_SUFFIX) \ |
|
74 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/compress$(OBJ_SUFFIX) \ |
|
75 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zutil$(OBJ_SUFFIX) \ |
|
76 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inflate$(OBJ_SUFFIX) \ |
|
77 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/infback$(OBJ_SUFFIX) \ |
|
78 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inftrees$(OBJ_SUFFIX) \ |
|
79 |
$(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inffast$(OBJ_SUFFIX) |
|
25859 | 80 |
|
81 |
endif |
|
82 |
||
49244
995a5556edfa
8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
49241
diff
changeset
|
83 |
$(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \ |
49070
d7859531621b
8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents:
48766
diff
changeset
|
84 |
NAME := unpack200, \ |
25859 | 85 |
SRC := $(UNPACKEXE_SRC), \ |
41479
bf50b06f27b5
8167479: arm 32/64 slowdebug fails to build on unpack200
erikj
parents:
41472
diff
changeset
|
86 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
25859 | 87 |
OPTIMIZATION := LOW, \ |
28846
b96683be2713
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
27799
diff
changeset
|
88 |
CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \ |
25859 | 89 |
CFLAGS_release := -DPRODUCT, \ |
90 |
CFLAGS_linux := -fPIC, \ |
|
91 |
CFLAGS_solaris := -KPIC, \ |
|
92 |
CFLAGS_macosx := -fPIC, \ |
|
48766
2c4d1993b5f9
8196985: Disable new warnings from GCC 7.3 in jdk libraries
erikj
parents:
47217
diff
changeset
|
93 |
DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \ |
28846
b96683be2713
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
27799
diff
changeset
|
94 |
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ |
b96683be2713
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
27799
diff
changeset
|
95 |
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ |
25859 | 96 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
33406 | 97 |
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \ |
33523 | 98 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \ |
47217 | 99 |
MANIFEST := $(TOPDIR)/src/jdk.pack/windows/native/unpack200/unpack200_proto.exe.manifest, \ |
33984
2333676816eb
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30434
diff
changeset
|
100 |
MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \ |
29925
6d47adfc6b47
8077847: Better handling of Windows executable manifest version
ihse
parents:
29879
diff
changeset
|
101 |
)) |
25859 | 102 |
|
103 |
ifneq ($(USE_EXTERNAL_LIBZ), true) |
|
104 |
||
105 |
$(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS) |
|
106 |
||
107 |
endif |
|
108 |
||
28846
b96683be2713
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
27799
diff
changeset
|
109 |
TARGETS += $(BUILD_UNPACKEXE) |
25859 | 110 |
|
111 |
################################################################################ |