author | ihse |
Mon, 19 Feb 2018 12:47:47 +0100 | |
branch | ihse-cflags-rewrite-branch |
changeset 56148 | 2dc251b685a2 |
parent 56147 | fd62484132bc |
child 56149 | 0a4dbc2c7ed1 |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
48767
0c6ce8fdb50a
8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
gadams
parents:
48751
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
42538 | 26 |
################################################################################ |
27 |
# |
|
28 |
# Setup ABI profile (for arm) |
|
29 |
# |
|
30 |
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE], |
|
31 |
[ |
|
32 |
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], |
|
33 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])]) |
|
34 |
||
35 |
if test "x$with_abi_profile" != x; then |
|
36 |
if test "x$OPENJDK_TARGET_CPU" != xarm && \ |
|
37 |
test "x$OPENJDK_TARGET_CPU" != xaarch64; then |
|
38 |
AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) |
|
39 |
fi |
|
40 |
||
41 |
OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile |
|
42 |
AC_MSG_CHECKING([for ABI profle]) |
|
43 |
AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) |
|
44 |
||
45 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
|
46 |
ARM_FLOAT_TYPE=vfp-sflt |
|
47 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
48 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
|
49 |
ARM_FLOAT_TYPE=vfp-hflt |
|
50 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
51 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
|
52 |
ARM_FLOAT_TYPE=sflt |
|
53 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
54 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
|
55 |
ARM_FLOAT_TYPE=vfp-sflt |
|
56 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
57 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
|
58 |
ARM_FLOAT_TYPE=vfp-hflt |
|
59 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
60 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then |
|
61 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
62 |
ARM_FLOAT_TYPE= |
|
63 |
ARM_ARCH_TYPE_FLAGS= |
|
64 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
|
65 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
66 |
ARM_FLOAT_TYPE= |
|
67 |
ARM_ARCH_TYPE_FLAGS= |
|
68 |
else |
|
69 |
AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) |
|
70 |
fi |
|
71 |
||
72 |
if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then |
|
73 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' |
|
74 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
|
75 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
76 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
|
77 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
78 |
fi |
|
79 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
80 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
81 |
||
82 |
AC_MSG_CHECKING([for arch type flags]) |
|
83 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
84 |
||
85 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
86 |
# autoconf target triplet. |
|
87 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
88 |
# Sanity check that it is a known ABI. |
|
89 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
90 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
91 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
92 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
93 |
fi |
|
94 |
AC_MSG_CHECKING([for ABI property name]) |
|
95 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
96 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
97 |
||
98 |
# Pass these on to the open part of configure as if they were set using |
|
99 |
# --with-extra-c[xx]flags. |
|
100 |
EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
101 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
102 |
# Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS. |
|
103 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'" |
|
104 |
# And pass the architecture flags to the linker as well |
|
105 |
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
106 |
fi |
|
107 |
||
108 |
# When building with an abi profile, the name of that profile is appended on the |
|
109 |
# bundle platform, which is used in bundle names. |
|
110 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
111 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
112 |
fi |
|
113 |
]) |
|
114 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
115 |
# Reset the global CFLAGS/LDFLAGS variables and initialize them with the |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
116 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
117 |
AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
118 |
[ |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
119 |
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
120 |
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
121 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
122 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
123 |
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
124 |
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
125 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
126 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
127 |
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
128 |
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
129 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
130 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
131 |
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
132 |
[extra flags to be used when compiling jdk c-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
133 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
134 |
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
135 |
[extra flags to be used when compiling jdk c++-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
136 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
137 |
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
138 |
[extra flags to be used when linking jdk])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
139 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
140 |
EXTRA_CFLAGS="$with_extra_cflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
141 |
EXTRA_CXXFLAGS="$with_extra_cxxflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
142 |
EXTRA_LDFLAGS="$with_extra_ldflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
143 |
|
37402 | 144 |
AC_SUBST(EXTRA_CFLAGS) |
145 |
AC_SUBST(EXTRA_CXXFLAGS) |
|
146 |
AC_SUBST(EXTRA_LDFLAGS) |
|
147 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
148 |
# The global CFLAGS and LDLAGS variables are used by configure tests and |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
149 |
# should include the extra parameters |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
150 |
CFLAGS="$EXTRA_CFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
151 |
CXXFLAGS="$EXTRA_CXXFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
152 |
LDFLAGS="$EXTRA_LDFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
153 |
CPPFLAGS="" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
154 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
155 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
156 |
# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
157 |
# that configure can use them while detecting compilers. |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
158 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
159 |
# Param 1 - Optional prefix to all variables. (e.g BUILD_) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
160 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
161 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
162 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
163 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
164 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
165 |
# Solaris Studio does not have a concept of sysroot. Instead we must |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
166 |
# make sure the default include and lib dirs are appended to each |
35450
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
167 |
# compile and link command line. Must also add -I-xbuiltin to enable |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
168 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
169 |
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include" |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
170 |
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ |
41040
7b919a4497ff
8165161: Solaris: /usr/ccs /opt/sfw and /opt/csw are dead, references should be expunged
alanbur
parents:
39940
diff
changeset
|
171 |
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR" |
48909
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
172 |
# If the devkit contains the ld linker, make sure we use it. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
173 |
AC_PATH_PROG(SOLARIS_LD, ld, , $DEVKIT_TOOLCHAIN_PATH:$DEVKIT_EXTRA_PATH) |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
174 |
# Make sure this ld is runnable. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
175 |
if test -f "$SOLARIS_LD"; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
176 |
if "$SOLARIS_LD" -V > /dev/null 2> /dev/null; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
177 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -Yl,$(dirname $SOLARIS_LD)" |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
178 |
else |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
179 |
AC_MSG_WARN([Could not run $SOLARIS_LD found in devkit, reverting to system ld]) |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
180 |
fi |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
181 |
fi |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
182 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
183 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
184 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
185 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
186 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
187 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
188 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
189 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
190 |
# The global CFLAGS and LDFLAGS variables need these for configure to function |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
191 |
$1CFLAGS="[$]$1CFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
192 |
$1CPPFLAGS="[$]$1CPPFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
193 |
$1CXXFLAGS="[$]$1CXXFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
194 |
$1LDFLAGS="[$]$1LDFLAGS [$]$1SYSROOT_LDFLAGS" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
195 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
196 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
197 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
198 |
# We also need -iframework<path>/System/Library/Frameworks |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
199 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
200 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
201 |
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
202 |
# set this here so it doesn't have to be peppered throughout the forest |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
203 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
204 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
205 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
206 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
207 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
208 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
209 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
210 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
211 |
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
212 |
[ |
56124 | 213 |
FLAGS_SETUP_TOOLCHAIN_CONTROL |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
214 |
|
56124 | 215 |
FLAGS_SETUP_ARFLAGS |
216 |
FLAGS_SETUP_STRIPFLAGS |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
217 |
|
56124 | 218 |
FLAGS_SETUP_RCFLAGS |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
219 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
220 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
221 |
# silence copyright notice and other headers. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
222 |
COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" |
20363 | 223 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
224 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
225 |
|
37402 | 226 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
227 |
[ |
56124 | 228 |
FLAGS_SETUP_SHARED_LIBS |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
229 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
230 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
14111 | 231 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
56124 | 232 |
if test "x$STATIC_BUILD" = xfalse; then |
37402 | 233 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
234 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
235 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
236 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
237 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
37402 | 238 |
if test "x$STATIC_BUILD" = xfalse; then |
239 |
JVM_CFLAGS="$JVM_CFLAGS -fPIC" |
|
240 |
fi |
|
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
241 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
242 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
36051 | 243 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
20363 | 244 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
245 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
246 |
|
20363 | 247 |
# The (cross) compiler is now configured, we can now test capabilities |
248 |
# of the target platform. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
249 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
250 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
251 |
# Documentation on common flags used for solstudio in HIGHEST. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
252 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
253 |
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
254 |
# done with care, there are some assumptions below that need to |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
255 |
# be understood about the use of pointers, and IEEE behavior. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
256 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
257 |
# -fns: Use non-standard floating point mode (not IEEE 754) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
258 |
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
259 |
# -fsingle: Use single precision floating point with 'float' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
260 |
# -xalias_level=basic: Assume memory references via basic pointer types do not alias |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
261 |
# (Source with excessing pointer casting and data access with mixed |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
262 |
# pointer types are not recommended) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
263 |
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
264 |
# (If you expect perfect errno behavior, do not use this) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
265 |
# -xdepend: Loop data dependency optimizations (need -xO3 or higher) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
266 |
# -xrestrict: Pointer parameters to functions do not overlap |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
267 |
# (Similar to -xalias_level=basic usage, but less obvious sometimes. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
268 |
# If you pass in multiple pointers to the same data, do not use this) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
269 |
# -xlibmil: Inline some library routines |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
270 |
# (If you expect perfect errno behavior, do not use this) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
271 |
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
272 |
# (If you expect perfect errno behavior, do not use this) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
273 |
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
274 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
275 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
276 |
[ |
56124 | 277 |
FLAGS_SETUP_DEBUG_SYMBOLS |
278 |
FLAGS_SETUP_QUALITY_CHECKS |
|
279 |
FLAGS_SETUP_OPTIMIZATION |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
280 |
|
37402 | 281 |
# Debug symbols for JVM_CFLAGS |
282 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
283 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs" |
|
284 |
if test "x$DEBUG_LEVEL" = xslowdebug; then |
|
285 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
286 |
else |
|
287 |
# -g0 does not disable inlining, which -g does. |
|
288 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0" |
|
289 |
fi |
|
290 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
291 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+" |
|
292 |
else |
|
293 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
294 |
fi |
|
295 |
AC_SUBST(JVM_CFLAGS_SYMBOLS) |
|
296 |
||
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
297 |
# bounds, memory and behavior checking options |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
298 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
299 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
300 |
slowdebug ) |
37402 | 301 |
# FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it |
35747 | 302 |
# get's added conditionally on whether we produce debug symbols or not. |
303 |
# This is most likely not really correct. |
|
304 |
||
37402 | 305 |
if test "x$STACK_PROTECTOR_CFLAG" != x; then |
306 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
|
307 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
308 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
309 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
310 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
311 |
|
37402 | 312 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
313 |
if test "x$DEBUG_LEVEL" != xrelease; then |
|
314 |
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
|
315 |
JVM_CFLAGS="$JVM_CFLAGS -homeparams" |
|
316 |
fi |
|
317 |
fi |
|
318 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
319 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
320 |
|
37402 | 321 |
|
322 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], |
|
323 |
[ |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
324 |
# Additional macosx handling |
56144 | 325 |
if test "x$FLAGS_OS" = xmacosx; then |
48751
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
326 |
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built |
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
327 |
# binaries should be compatible with, even if compiled on a newer version |
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
328 |
# of the OS. It currently has a hard coded value. Setting this also limits |
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
329 |
# exposure to API changes in header files. Bumping this is likely to |
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
330 |
# require code changes to build. |
25034
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
331 |
MACOSX_VERSION_MIN=10.7.0 |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
332 |
AC_SUBST(MACOSX_VERSION_MIN) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
333 |
|
45875 | 334 |
# Setting --with-macosx-version-max=<version> makes it an error to build or |
335 |
# link to macosx APIs that are newer than the given OS version. The expected |
|
336 |
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. |
|
337 |
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max], |
|
338 |
[error on use of newer functionality. @<:@macosx@:>@])], |
|
339 |
[ |
|
340 |
if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then |
|
341 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
342 |
elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then |
|
343 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
344 |
elif test "x$with_macosx_version_max" = "xno"; then |
|
345 |
# Use build system default |
|
346 |
MACOSX_VERSION_MAX= |
|
347 |
else |
|
348 |
AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn]) |
|
349 |
fi |
|
350 |
], |
|
351 |
[MACOSX_VERSION_MAX=] |
|
352 |
) |
|
353 |
AC_SUBST(MACOSX_VERSION_MAX) |
|
56144 | 354 |
fi |
45875 | 355 |
|
42538 | 356 |
FLAGS_SETUP_ABI_PROFILE |
46224
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
357 |
|
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
358 |
# Optional POSIX functionality needed by the JVM |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
359 |
# |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
360 |
# Check if clock_gettime is available and in which library. This indicates |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
361 |
# availability of CLOCK_MONOTONIC for hotspot. But we don't need to link, so |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
362 |
# don't let it update LIBS. |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
363 |
save_LIBS="$LIBS" |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
364 |
AC_SEARCH_LIBS(clock_gettime, rt, [HAS_CLOCK_GETTIME=true], []) |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
365 |
if test "x$LIBS" = "x-lrt "; then |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
366 |
CLOCK_GETTIME_IN_LIBRT=true |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
367 |
fi |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
368 |
LIBS="$save_LIBS" |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
369 |
|
56124 | 370 |
FLAGS_OS=OPENJDK_TARGET_OS |
371 |
FLAGS_OS_TYPE=OPENJDK_TARGET_OS_TYPE |
|
372 |
FLAGS_CPU=OPENJDK_TARGET_CPU |
|
373 |
FLAGS_CPU_ARCH=OPENJDK_TARGET_CPU_ARCH |
|
374 |
FLAGS_CPU_BITS=OPENJDK_TARGET_CPU_BITS |
|
375 |
FLAGS_CPU_ENDIAN=OPENJDK_TARGET_CPU_ENDIAN |
|
376 |
FLAGS_CPU_LEGACY=OPENJDK_TARGET_CPU_LEGACY |
|
377 |
FLAGS_ADD_LP64=OPENJDK_TARGET_ADD_LP64 |
|
378 |
||
56144 | 379 |
# On some platforms (mac) the linker warns about non existing -L dirs. |
380 |
# For any of the variants server, client or minimal, the dir matches the |
|
381 |
# variant name. The "main" variant should be used for linking. For the |
|
382 |
# rest, the dir is just server. |
|
383 |
if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \ |
|
384 |
|| HOTSPOT_CHECK_JVM_VARIANT(minimal); then |
|
385 |
JVM_VARIANT_PATH=$JVM_VARIANT_MAIN |
|
386 |
else |
|
387 |
JVM_VARIANT_PATH=server |
|
388 |
fi |
|
389 |
||
37402 | 390 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET]) |
56124 | 391 |
|
392 |
FLAGS_OS=OPENJDK_BUILD_OS |
|
393 |
FLAGS_OS_TYPE=OPENJDK_BUILD_OS_TYPE |
|
394 |
FLAGS_CPU=OPENJDK_BUILD_CPU |
|
395 |
FLAGS_CPU_ARCH=OPENJDK_BUILD_CPU_ARCH |
|
396 |
FLAGS_CPU_BITS=OPENJDK_BUILD_CPU_BITS |
|
397 |
FLAGS_CPU_ENDIAN=OPENJDK_BUILD_CPU_ENDIAN |
|
398 |
FLAGS_CPU_LEGACY=OPENJDK_BUILD_CPU_LEGACY |
|
399 |
FLAGS_ADD_LP64=OPENJDK_BUILD_ADD_LP64= |
|
400 |
||
56144 | 401 |
# When building a buildjdk, it's always only the server variant |
402 |
OPENJDK_BUILD_JVM_VARIANT_PATH=server |
|
403 |
||
37402 | 404 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_]) |
405 |
||
406 |
# Tests are only ever compiled for TARGET |
|
407 |
# Flags for compiling test libraries |
|
56125 | 408 |
CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG ${_SPECIAL_EXTRA_1} ${_SPECIAL_EXTRA_2}" |
409 |
CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG ${_SPECIAL_EXTRA_1} ${_SPECIAL_EXTRA_2}" |
|
37402 | 410 |
|
411 |
# Flags for compiling test executables |
|
412 |
CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" |
|
413 |
CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" |
|
414 |
||
415 |
AC_SUBST(CFLAGS_TESTLIB) |
|
416 |
AC_SUBST(CFLAGS_TESTEXE) |
|
417 |
AC_SUBST(CXXFLAGS_TESTLIB) |
|
418 |
AC_SUBST(CXXFLAGS_TESTEXE) |
|
419 |
||
420 |
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" |
|
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
421 |
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS" |
37402 | 422 |
|
423 |
AC_SUBST(LDFLAGS_TESTLIB) |
|
424 |
AC_SUBST(LDFLAGS_TESTEXE) |
|
425 |
||
426 |
]) |
|
427 |
||
428 |
################################################################################ |
|
429 |
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check |
|
430 |
# conditionals against. |
|
431 |
# $2 - Optional prefix for each variable defined. |
|
432 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
433 |
[ |
56145 | 434 |
#### OS DEFINES, these should be independent on toolchain |
435 |
if test "x$FLAGS_OS" = xlinux; then |
|
436 |
$2_CFLAGS_OS_DEF_JVM="-DLINUX" |
|
56148 | 437 |
$2_CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
56145 | 438 |
elif test "x$FLAGS_OS" = xsolaris; then |
439 |
$2_CFLAGS_OS_DEF_JVM="-DSOLARIS" |
|
440 |
$2_SPECIAL_2="-D__solaris__" # add on both CFLAGS |
|
441 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2_SPECIAL_2}" |
|
442 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2_SPECIAL_2}" |
|
443 |
elif test "x$FLAGS_OS" = xmacosx; then |
|
444 |
$2_CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" |
|
445 |
$2_CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" |
|
446 |
elif test "x$FLAGS_OS" = xaix; then |
|
447 |
$2_CFLAGS_OS_DEF_JVM="-DAIX" |
|
448 |
elif test "x$FLAGS_OS" = xbsd; then |
|
449 |
$2_CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE" |
|
450 |
elif test "x$FLAGS_OS" = xwindows; then |
|
451 |
$2_CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" |
|
452 |
fi |
|
453 |
||
454 |
# Setup target OS define. Use OS target name but in upper case. |
|
455 |
FLAGS_OS_UPPERCASE=`$ECHO $FLAGS_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` |
|
456 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D$FLAGS_OS_UPPERCASE ${$2_CFLAGS_OS_DEF_JDK}" |
|
457 |
||
458 |
#### CPU DEFINES, these should be independent on toolchain |
|
459 |
||
460 |
# Setup target CPU |
|
461 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
462 |
$FLAGS_ADD_LP64 \ |
|
463 |
-DARCH='\"$FLAGS_CPU_LEGACY\"' -D$FLAGS_CPU_LEGACY" |
|
464 |
||
465 |
# Setup endianness |
|
466 |
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then |
|
56148 | 467 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DVM_LITTLE_ENDIAN" |
468 |
||
56145 | 469 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
470 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
471 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
472 |
# Note: -Dmacro is the same as #define macro 1 |
|
473 |
# -Dmacro= is the same as #define macro |
|
474 |
if test "x$FLAGS_OS" = xsolaris; then |
|
475 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" |
|
476 |
else |
|
477 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" |
|
478 |
fi |
|
479 |
else |
|
480 |
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they |
|
481 |
# are defined in the system? |
|
482 |
if test "x$FLAGS_OS" = xsolaris; then |
|
483 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN=" |
|
484 |
else |
|
485 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" |
|
486 |
fi |
|
487 |
fi |
|
488 |
||
56148 | 489 |
# setup CPU bit size |
490 |
||
491 |
if test "x$FLAGS_CPU_BITS" = x64; then |
|
492 |
if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then |
|
493 |
# Solaris does not have _LP64=1 in the old build. |
|
494 |
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. |
|
495 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_LP64=1" |
|
496 |
fi |
|
497 |
fi |
|
498 |
||
499 |
#### GLOBAL DEFINES |
|
500 |
# Set some common defines. These works for all compilers, but assume |
|
501 |
# -D is universally accepted. |
|
502 |
||
503 |
# Always enable optional macros for VM. |
|
504 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_FORMAT_MACROS" |
|
505 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_LIMIT_MACROS" |
|
506 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_CONSTANT_MACROS" |
|
507 |
||
508 |
# Setup some hard coded includes |
|
509 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
510 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
|
511 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ |
|
512 |
-I${TOPDIR}/src/java.base/share/native/libjava \ |
|
513 |
-I${TOPDIR}/src/java.base/$FLAGS_OS_TYPE/native/libjava \ |
|
514 |
-I${TOPDIR}/src/hotspot/share/include \ |
|
515 |
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_$1_OS_TYPE}/include" |
|
516 |
||
517 |
############################################################################### |
|
518 |
||
519 |
# Adjust flags according to debug level. |
|
520 |
# Setup debug/release defines |
|
521 |
if test "x$DEBUG_LEVEL" = xrelease; then |
|
522 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DNDEBUG" |
|
523 |
if test "x$FLAGS_OS" = xsolaris; then |
|
524 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DTRIMMED" |
|
525 |
fi |
|
526 |
else |
|
527 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" |
|
528 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS" |
|
529 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DDEBUG" |
|
530 |
||
531 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
532 |
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. |
|
533 |
# Hotspot now overflows its 64K TOC (currently only for debug), |
|
534 |
# so for debug we build with '-qpic=large -bbigtoc'. |
|
535 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qpic=large" |
|
536 |
fi |
|
537 |
fi |
|
538 |
||
539 |
||
56145 | 540 |
#### TOOLCHAIN DEFINES |
541 |
||
542 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
543 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE -D_REENTRANT" |
|
544 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
545 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE" |
|
546 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
56148 | 547 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSPARC_WORKS -D_Crun_inline_placement" |
56145 | 548 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
549 |
if test "x$FLAGS_CPU_ARCH" = xx86; then |
|
550 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB" |
|
551 |
fi |
|
552 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -DCC_NOEX" |
|
553 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
554 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT" |
|
555 |
$2_COMMON_TOOLCHAIN_DEFINES="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" |
|
556 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK ${$2_COMMON_TOOLCHAIN_DEFINES}" |
|
557 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK ${$2_COMMON_TOOLCHAIN_DEFINES}" |
|
558 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
559 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \ |
|
560 |
-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ |
|
561 |
-DWIN32 -DIAL" |
|
562 |
if test "x$FLAGS_CPU" = xx86_64; then |
|
563 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" |
|
564 |
else |
|
565 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" |
|
566 |
fi |
|
567 |
fi |
|
56144 | 568 |
|
569 |
# PER TOOLCHAIN: |
|
56148 | 570 |
# COMPILER-ARCH/CPU-special (-m, -f...) |
571 |
# COMPILER-warnings |
|
572 |
# COMPILER: shared-lib-special, exe-special |
|
573 |
# Special extras... |
|
574 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
575 |
if test "x$FLAGS_CPU_ARCH" = "xsparc"; then |
|
576 |
$2_SPECIAL_EXTRA_1="-xregs=no%appl" # add on both EXTRA |
|
577 |
fi |
|
578 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
579 |
$2_SPECIAL_1="-qchars=signed -qfullpath -qsaveopt" # add on both CFLAGS |
|
580 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2_SPECIAL_1}" |
|
581 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2_SPECIAL_1}" |
|
582 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
583 |
$2CXXSTD_CXXFLAG="-std=gnu++98" # only for CXX and JVM |
|
584 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror], |
|
585 |
IF_FALSE: [$2CXXSTD_CXXFLAG=""]) |
|
586 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}" |
|
587 |
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}" |
|
588 |
AC_SUBST($2CXXSTD_CXXFLAG) |
|
589 |
fi |
|
590 |
||
591 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}" |
|
592 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2EXTRA_CXXFLAGS}" |
|
593 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$2EXTRA_LDFLAGS}" |
|
594 |
||
595 |
||
596 |
############################################################################### |
|
597 |
# |
|
598 |
# |
|
599 |
# CFLAGS BASIC |
|
600 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
|
601 |
# COMMON to gcc and clang |
|
602 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe -fno-rtti -fno-exceptions \ |
|
603 |
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" |
|
604 |
fi |
|
605 |
||
606 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
607 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new" |
|
608 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -pipe" |
|
609 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
610 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2)) |
|
611 |
||
612 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
613 |
# Restrict the debug information created by Clang to avoid |
|
614 |
# too big object files and speed the build up a little bit |
|
615 |
# (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
|
616 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -flimit-debug-info" |
|
617 |
||
618 |
if test "x$FLAGS_OS" = xlinux; then |
|
619 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -pipe" |
|
620 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
621 |
fi |
|
622 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
623 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -xc99=%none -xCC -Xa -v -mt -W0,-noglobal" |
|
624 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -mt -features=no%except -norunpath -xnolib" |
|
625 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $PICFLAG" |
|
626 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -template=no%extdef -features=no%split_init \ |
|
627 |
-library=stlport4 -mt -features=no%except" |
|
628 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
629 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \ |
|
630 |
-qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ |
|
631 |
-qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" |
|
632 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
633 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -nologo -MD -MP" |
|
634 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \ |
|
635 |
-MD -Zc:wchar_t-" |
|
636 |
fi |
|
637 |
||
638 |
# CFLAGS WARNINGS STUFF |
|
639 |
# Set $2JVM_CFLAGS warning handling |
|
640 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
|
641 |
# COMMON to gcc and clang |
|
642 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wpointer-arith \ |
|
643 |
-Wsign-compare -Wunused-function" |
|
644 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
|
645 |
# Non-zero builds have stricter warnings |
|
646 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wundef -Wformat=2" |
|
647 |
fi |
|
648 |
||
649 |
fi |
|
650 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
651 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
|
652 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wunused-value -Woverloaded-virtual" |
|
653 |
||
654 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
655 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2, |
|
656 |
IF_AT_LEAST: [ |
|
657 |
# These flags either do not work or give spurious warnings prior to gcc 4.8. |
|
658 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized" |
|
659 |
] |
|
660 |
) |
|
661 |
fi |
|
662 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
|
663 |
# Non-zero builds have stricter warnings |
|
664 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wreturn-type" |
|
665 |
fi |
|
666 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
667 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-deprecated" |
|
668 |
if test "x$FLAGS_OS" = xlinux; then |
|
669 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-sometimes-uninitialized" |
|
670 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
|
671 |
fi |
|
672 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
673 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -errshort=tags" |
|
674 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -errtags=yes +w" |
|
675 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -errtags=yes -errfmt" |
|
676 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
677 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -W3" |
|
678 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -W3 -wd4800" |
|
679 |
fi |
|
680 |
||
681 |
# CFLAGS PER CPU |
|
682 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || ; then |
|
683 |
# COMMON to gcc and clang |
|
684 |
if test "x$FLAGS_CPU" = xx86; then |
|
685 |
# Force compatibility with i586 on 32 bit intel platforms. |
|
686 |
$2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586" |
|
687 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586" |
|
688 |
fi |
|
689 |
fi |
|
690 |
||
691 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
692 |
if test "x$FLAGS_CPU_ARCH" = xppc; then |
|
693 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" |
|
694 |
if test "x$FLAGS_CPU" = xppc64; then |
|
695 |
# fixes `relocation truncated to fit' error for gcc 4.1. |
|
696 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mminimal-toc" |
|
697 |
# Use ppc64 instructions, but schedule for power5 |
|
698 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=powerpc64 -mtune=power5" |
|
699 |
elif test "x$FLAGS_CPU" = xppc64le; then |
|
700 |
# Little endian machine uses ELFv2 ABI. |
|
701 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DABI_ELFv2" |
|
702 |
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. |
|
703 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=power8 -mtune=power8" |
|
704 |
fi |
|
705 |
elif test "x$FLAGS_CPU" = xs390x; then |
|
706 |
BASIC_S390_FLAGS="-mbackchain -march=z10" |
|
707 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $BASIC_S390_FLAGS" |
|
708 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK $BASIC_S390_FLAGS" |
|
709 |
fi |
|
710 |
||
711 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
712 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
713 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
|
714 |
fi |
|
715 |
||
716 |
if test "x$FLAGS_CPU_ARCH" = xarm; then |
|
717 |
$2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char" |
|
718 |
fi |
|
719 |
||
720 |
# Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" |
|
721 |
# FIXME: This should not really be set using extra_cflags. |
|
722 |
if test "x$OPENJDK_TARGET_CPU" = xarm; then |
|
723 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi" |
|
724 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi" |
|
725 |
fi |
|
726 |
||
727 |
||
728 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
729 |
if test "x$FLAGS_OS" = xlinux; then |
|
730 |
# ppc test not really needed for clang |
|
731 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
732 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
733 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
|
734 |
fi |
|
735 |
fi |
|
736 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
737 |
if test "x$FLAGS_CPU" = xsparcv9; then |
|
738 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -xarch=sparc" |
|
739 |
fi |
|
740 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
741 |
if test "x$FLAGS_CPU" = xppc64; then |
|
742 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qarch=ppc64" |
|
743 |
fi |
|
744 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
745 |
if test "x$FLAGS_CPU" = xx86; then |
|
746 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -arch:IA32" |
|
747 |
fi |
|
748 |
fi |
|
749 |
||
750 |
||
751 |
# Set some common defines. These works for all compilers, but assume |
|
752 |
# -D is universally accepted. |
|
753 |
||
754 |
||
755 |
# Optional POSIX functionality needed by the VM |
|
756 |
||
757 |
if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then |
|
758 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSUPPORTS_CLOCK_MONOTONIC" |
|
759 |
if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then |
|
760 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DNEEDS_LIBRT" |
|
761 |
fi |
|
762 |
fi |
|
763 |
||
764 |
||
765 |
# Set some additional per-OS defines. |
|
766 |
||
767 |
||
768 |
# Additional macosx handling |
|
769 |
if test "x$FLAGS_OS" = xmacosx; then |
|
770 |
# Let the flags variables get resolved in make for easier override on make |
|
771 |
# command line. AvailabilityMacros.h versions have no dots, ex: 1070. |
|
772 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
773 |
-DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ |
|
774 |
-mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
775 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS \ |
|
776 |
-DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ |
|
777 |
-mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
778 |
||
779 |
if test -n "$MACOSX_VERSION_MAX"; then |
|
780 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
781 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" |
|
782 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS \ |
|
783 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" |
|
784 |
fi |
|
785 |
fi |
|
786 |
||
787 |
||
788 |
||
789 |
# Where does this really belong?? |
|
790 |
if test "x$FLAGS_OS" = xlinux; then |
|
791 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $PICFLAG" |
|
792 |
elif test "x$FLAGS_OS" = xmacosx; then |
|
793 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
|
794 |
fi |
|
795 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS ${$2_CFLAGS_OS_DEF_JVM}" |
|
796 |
||
797 |
||
798 |
||
799 |
||
800 |
# The shared libraries are compiled using the picflag. |
|
801 |
||
802 |
$2CFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
803 |
[$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK $PICFLAG ${$2_SPECIAL_EXTRA_1}" |
|
804 |
$2CXXFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
805 |
[$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK $PICFLAG ${$2_SPECIAL_EXTRA_1}" |
|
806 |
||
807 |
# Executable flags |
|
808 |
$2CFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK" |
|
809 |
$2CXXFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK" |
|
810 |
||
811 |
############## LINKER ############################ |
|
812 |
||
813 |
# PER TOOLCHAIN: |
|
56144 | 814 |
# LINKER_BASIC |
815 |
# LINKER: shared-lib-special, exe-special |
|
816 |
# LINKER: arch/cpu-special |
|
817 |
||
818 |
# LINKER LDFLAGS |
|
819 |
||
820 |
# BASIC_LDFLAGS (per toolchain) |
|
821 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
822 |
# If this is a --hash-style=gnu system, use --hash-style=both, why? |
|
823 |
# We have previously set HAS_GNU_HASH if this is the case |
|
824 |
if test -n "$HAS_GNU_HASH"; then |
|
825 |
BASIC_LDFLAGS="-Wl,--hash-style=both" |
|
826 |
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both" |
|
827 |
AC_SUBST(LIBJSIG_HASHSTYLE_LDFLAGS) |
|
828 |
fi |
|
829 |
||
830 |
# And since we now know that the linker is gnu, then add -z defs, to forbid |
|
831 |
# undefined symbols in object files. |
|
832 |
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs" |
|
833 |
||
834 |
BASIC_LDFLAGS_JDK_ONLY= |
|
835 |
BASIC_LDFLAGS_JVM_ONLY="-Wl,-z,noexecstack -Wl,-O1" |
|
836 |
||
837 |
BASIC_LDFLAGS_JDK_LIB_ONLY="-Wl,-z,noexecstack" |
|
838 |
LIBJSIG_NOEXECSTACK_LDFLAGS="-Wl,-z,noexecstack" |
|
839 |
||
840 |
||
841 |
if test "x$HAS_LINKER_RELRO" = "xtrue"; then |
|
842 |
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY $LINKER_RELRO_FLAG" |
|
843 |
fi |
|
844 |
||
845 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
846 |
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 -stdlib=libstdc++ -fPIC" |
|
847 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
848 |
BASIC_LDFLAGS="-Wl,-z,defs" |
|
849 |
BASIC_LDFLAGS_ONLYCXX="-norunpath" |
|
850 |
BASIC_LDFLAGS_ONLYCXX_JDK_ONLY="-xnolib" |
|
851 |
||
852 |
BASIC_LDFLAGS_JDK_ONLY="-ztext" |
|
853 |
BASIC_LDFLAGS_JVM_ONLY="-library=%none -mt -z noversion" |
|
854 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
855 |
BASIC_LDFLAGS="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K" |
|
56147 | 856 |
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r" |
56144 | 857 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
858 |
BASIC_LDFLAGS="-nologo -opt:ref" |
|
859 |
BASIC_LDFLAGS_JDK_ONLY="-incremental:no" |
|
860 |
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows -base:0x8000000" |
|
861 |
fi |
|
862 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${BASIC_LDFLAGS}" |
|
863 |
$2JVM_LDFLAGS="${$2JVM_LDFLAGS} ${BASIC_LDFLAGS} $BASIC_LDFLAGS_ONLYCXX" |
|
864 |
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $BASIC_LDFLAGS_ONLYCXX" |
|
865 |
||
866 |
# CPU_LDFLAGS (per toolchain) |
|
867 |
# This can differ between TARGET and BUILD. |
|
868 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
869 |
if test "x$FLAGS_CPU" = xx86; then |
|
870 |
$2_CPU_LDFLAGS_JVM_ONLY="-march=i586" |
|
871 |
fi |
|
872 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
873 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
874 |
if test "x$FLAGS_CPU_ARCH" = "xsparc"; then |
|
875 |
$2_CPU_LDFLAGS_JVM_ONLY="-xarch=sparc" |
|
876 |
fi |
|
877 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
878 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
879 |
if test "x$FLAGS_CPU" = "xx86"; then |
|
880 |
$2_CPU_LDFLAGS="-safeseh" |
|
881 |
# NOTE: Old build added -machine. Probably not needed. |
|
882 |
$2_CPU_LDFLAGS_JVM_ONLY="-machine:I386" |
|
883 |
else |
|
884 |
$2_CPU_LDFLAGS_JVM_ONLY="-machine:AMD64" |
|
885 |
fi |
|
886 |
fi |
|
887 |
fi |
|
888 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$2_CPU_LDFLAGS}" |
|
889 |
$2JVM_LDFLAGS="${$2JVM_LDFLAGS} ${$2_CPU_LDFLAGS} ${$2_CPU_LDFLAGS_JVM_ONLY}" |
|
890 |
||
891 |
# OS_LDFLAGS (per toolchain) |
|
892 |
if test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
893 |
if test "x$FLAGS_OS" = xmacosx; then |
|
894 |
# Assume clang or gcc. |
|
895 |
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead. |
|
896 |
OS_LDFLAGS_JVM_ONLY="[$]$2JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." |
|
897 |
||
898 |
OS_LDFLAGS_JDK_ONLY="[$]$2LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
899 |
fi |
|
900 |
fi |
|
901 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$OS_LDFLAGS_JDK_ONLY}" |
|
902 |
$2JVM_LDFLAGS="${$2JVM_LDFLAGS} ${$OS_LDFLAGS_JVM_ONLY}" |
|
903 |
||
904 |
# DEBUGLEVEL_LDFLAGS (per toolchain) |
|
905 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
906 |
if test "x$FLAGS_OS" = xlinux; then |
|
907 |
if test x$DEBUG_LEVEL = xrelease; then |
|
908 |
DEBUGLEVEL_LDFLAGS_JDK_ONLY="${$2LDFLAGS_JDK} -Wl,-O1" |
|
909 |
else |
|
910 |
# mark relocations read only on (fast/slow) debug builds |
|
911 |
if test "x$HAS_LINKER_RELRO" = "xtrue"; then |
|
912 |
DEBUGLEVEL_LDFLAGS_JDK_ONLY="$LINKER_RELRO_FLAG" |
|
913 |
fi |
|
914 |
fi |
|
915 |
if test x$DEBUG_LEVEL = xslowdebug; then |
|
916 |
if test "x$HAS_LINKER_NOW" = "xtrue"; then |
|
917 |
# do relocations at load |
|
918 |
DEBUGLEVEL_LDFLAGS="$LINKER_NOW_FLAG" |
|
919 |
fi |
|
920 |
fi |
|
921 |
fi |
|
922 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
923 |
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. |
|
924 |
# Hotspot now overflows its 64K TOC (currently only for debug), |
|
925 |
# so we build with '-qpic=large -bbigtoc'. |
|
926 |
if test "x$DEBUG_LEVEL" != xrelease; then |
|
927 |
DEBUGLEVEL_LDFLAGS_JVM_ONLY="[$]$2JVM_LDFLAGS -bbigtoc" |
|
928 |
fi |
|
929 |
fi |
|
930 |
||
931 |
# EXECUTABLE_LDFLAGS (per toolchain) |
|
932 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
933 |
EXECUTABLE_LDFLAGS="[$]$2LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined" |
|
934 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
935 |
if test "x$FLAGS_CPU" = "x86_64"; then |
|
936 |
LDFLAGS_STACK_SIZE=1048576 |
|
937 |
else |
|
938 |
LDFLAGS_STACK_SIZE=327680 |
|
939 |
fi |
|
940 |
$2_CPU_EXECUTABLE_LDFLAGS="${$2LDFLAGS_JDKEXE} -stack:$LDFLAGS_STACK_SIZE" |
|
941 |
fi |
|
942 |
$2LDFLAGS_JDKEXE="${$2LDFLAGS_JDK}" |
|
943 |
$2LDFLAGS_JDKEXE="${$2LDFLAGS_JDKEXE} ${$2EXTRA_LDFLAGS_JDK}" |
|
944 |
||
945 |
# LIBRARY_LDFLAGS (per toolchain) |
|
946 |
# Customize LDFLAGS for libs |
|
947 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
948 |
LDFLAGS_JDK_LIBPATH="-libpath:${OUTPUTDIR}/support/modules_libs/java.base" |
|
949 |
else |
|
950 |
LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
951 |
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$2JVM_VARIANT_PATH}" |
|
952 |
fi |
|
953 |
||
954 |
LIBRARY_LDFLAGS_JDK_ONLY="${SHARED_LIBRARY_FLAGS} ${LDFLAGS_NO_EXEC_STACK} $LDFLAGS_JDK_LIBPATH ${$2EXTRA_LDFLAGS_JDK} $BASIC_LDFLAGS_JDK_LIB_ONLY" |
|
955 |
$2LDFLAGS_JDKLIB="${LIBRARY_LDFLAGS_JDK_ONLY} " |
|
956 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
957 |
|
37402 | 958 |
AC_SUBST($2CFLAGS_JDKLIB) |
959 |
AC_SUBST($2CFLAGS_JDKEXE) |
|
960 |
AC_SUBST($2CXXFLAGS_JDKLIB) |
|
961 |
AC_SUBST($2CXXFLAGS_JDKEXE) |
|
29305
4ddc6faf7842
8073021: add native code coverage target into makefiles
erikj
parents:
29304
diff
changeset
|
962 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
963 |
|
56148 | 964 |
############## ARFLAGS |
965 |
# Additional macosx handling |
|
966 |
if test "x$FLAGS_OS" = xmacosx; then |
|
967 |
$2ARFLAGS="$2$ARFLAGS -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
968 |
fi |
|
969 |
||
970 |
# Setup some hard coded includes |
|
971 |
||
972 |
############## ASFLAGS |
|
973 |
||
37402 | 974 |
# Set $2JVM_ASFLAGS |
56124 | 975 |
if test "x$FLAGS_OS" = xlinux; then |
976 |
if test "x$FLAGS_CPU" = xx86; then |
|
37402 | 977 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586" |
978 |
fi |
|
56124 | 979 |
elif test "x$FLAGS_OS" = xmacosx; then |
37402 | 980 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
981 |
fi |
|
982 |
||
983 |
AC_SUBST($2LDFLAGS_JDKLIB) |
|
984 |
AC_SUBST($2LDFLAGS_JDKEXE) |
|
985 |
AC_SUBST($2JDKLIB_LIBS) |
|
986 |
AC_SUBST($2JDKEXE_LIBS) |
|
987 |
AC_SUBST($2LDFLAGS_CXX_JDK) |
|
988 |
AC_SUBST($2LDFLAGS_HASH_STYLE) |
|
47264
8b5ed0358b3a
8187045: [linux] Not all libraries in the VM are linked with -z,noexecstack
goetz
parents:
47253
diff
changeset
|
989 |
AC_SUBST($2LDFLAGS_NO_EXEC_STACK) |
29305
4ddc6faf7842
8073021: add native code coverage target into makefiles
erikj
parents:
29304
diff
changeset
|
990 |
|
37402 | 991 |
AC_SUBST($2JVM_CFLAGS) |
992 |
AC_SUBST($2JVM_LDFLAGS) |
|
993 |
AC_SUBST($2JVM_ASFLAGS) |
|
994 |
AC_SUBST($2JVM_LIBS) |
|
995 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
996 |
]) |
16987 | 997 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
998 |
# FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
999 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 1000 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1001 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1002 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
34923 | 1003 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
16987 | 1004 |
[ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1005 |
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) |
16987 | 1006 |
supports=yes |
1007 |
||
1008 |
saved_cflags="$CFLAGS" |
|
34923 | 1009 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
16987 | 1010 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1011 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 1012 |
[supports=no]) |
16987 | 1013 |
AC_LANG_POP([C]) |
1014 |
CFLAGS="$saved_cflags" |
|
1015 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1016 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1017 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1018 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1019 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1020 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1021 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1022 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1023 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1024 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1025 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1026 |
# FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1027 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1028 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1029 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1030 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1031 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1032 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1033 |
AC_MSG_CHECKING([if the C++ compiler supports "ARG_ARGUMENT"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1034 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1035 |
|
16987 | 1036 |
saved_cxxflags="$CXXFLAGS" |
34923 | 1037 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
16987 | 1038 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1039 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 1040 |
[supports=no]) |
16987 | 1041 |
AC_LANG_POP([C++]) |
1042 |
CXXFLAGS="$saved_cxxflags" |
|
1043 |
||
1044 |
AC_MSG_RESULT([$supports]) |
|
1045 |
if test "x$supports" = "xyes" ; then |
|
34923 | 1046 |
: |
1047 |
ARG_IF_TRUE |
|
16987 | 1048 |
else |
34923 | 1049 |
: |
1050 |
ARG_IF_FALSE |
|
16987 | 1051 |
fi |
1052 |
]) |
|
1053 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1054 |
# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1055 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1056 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1057 |
# Check that the C and C++ compilers support an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1058 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1059 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1060 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1061 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1062 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1063 |
IF_FALSE: [C_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1064 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1065 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1066 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1067 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1068 |
AC_MSG_CHECKING([if both compilers support "ARG_ARGUMENT"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1069 |
supports=no |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1070 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi |
42141 | 1071 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1072 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1073 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1074 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1075 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1076 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1077 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1078 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1079 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1080 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1081 |
|
34923 | 1082 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
1083 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1084 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1085 |
# Check that the linker support an argument |
34923 | 1086 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
1087 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1088 |
[ |
34923 | 1089 |
AC_MSG_CHECKING([if linker supports "ARG_ARGUMENT"]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1090 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1091 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1092 |
saved_ldflags="$LDFLAGS" |
34923 | 1093 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1094 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1095 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1096 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1097 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1098 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1099 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1100 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1101 |
if test "x$supports" = "xyes" ; then |
34923 | 1102 |
: |
1103 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1104 |
else |
34923 | 1105 |
: |
1106 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1107 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1108 |
]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1109 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1110 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC], |
16987 | 1111 |
[ |
22466 | 1112 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
16987 | 1113 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
34923 | 1114 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
1115 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
|
1116 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
16987 | 1117 |
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1118 |
|
30415 | 1119 |
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors], |
1120 |
[do not consider native warnings to be an error @<:@enabled@:>@])]) |
|
1121 |
||
1122 |
AC_MSG_CHECKING([if native warnings are errors]) |
|
1123 |
if test "x$enable_warnings_as_errors" = "xyes"; then |
|
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
42141
diff
changeset
|
1124 |
AC_MSG_RESULT([yes (explicitly set)]) |
30415 | 1125 |
WARNINGS_AS_ERRORS=true |
1126 |
elif test "x$enable_warnings_as_errors" = "xno"; then |
|
1127 |
AC_MSG_RESULT([no]) |
|
1128 |
WARNINGS_AS_ERRORS=false |
|
1129 |
elif test "x$enable_warnings_as_errors" = "x"; then |
|
1130 |
AC_MSG_RESULT([yes (default)]) |
|
1131 |
WARNINGS_AS_ERRORS=true |
|
1132 |
else |
|
1133 |
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument]) |
|
1134 |
fi |
|
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1135 |
|
30415 | 1136 |
AC_SUBST(WARNINGS_AS_ERRORS) |
1137 |
||
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1138 |
case "${TOOLCHAIN_TYPE}" in |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1139 |
microsoft) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1140 |
DISABLE_WARNING_PREFIX="-wd" |
25882 | 1141 |
CFLAGS_WARNINGS_ARE_ERRORS="-WX" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1142 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1143 |
solstudio) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1144 |
DISABLE_WARNING_PREFIX="-erroff=" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1145 |
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1146 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1147 |
gcc) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1148 |
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error |
34923 | 1149 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
1150 |
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true], |
|
1151 |
IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false] |
|
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1152 |
) |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1153 |
if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1154 |
DISABLE_WARNING_PREFIX="-Wno-" |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1155 |
else |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1156 |
DISABLE_WARNING_PREFIX= |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1157 |
fi |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1158 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1159 |
# Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1160 |
# CFLAGS since any target specific flags will likely not work with the |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1161 |
# build compiler |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1162 |
CC_OLD="$CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1163 |
CXX_OLD="$CXX" |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1164 |
CC="$BUILD_CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1165 |
CXX="$BUILD_CXX" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1166 |
CFLAGS_OLD="$CFLAGS" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1167 |
CFLAGS="" |
34923 | 1168 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
1169 |
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true], |
|
1170 |
IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false] |
|
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1171 |
) |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1172 |
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1173 |
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-" |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1174 |
else |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1175 |
BUILD_CC_DISABLE_WARNING_PREFIX= |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1176 |
fi |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1177 |
CC="$CC_OLD" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1178 |
CXX="$CXX_OLD" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1179 |
CFLAGS="$CFLAGS_OLD" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1180 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1181 |
clang) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1182 |
DISABLE_WARNING_PREFIX="-Wno-" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1183 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1184 |
;; |
35747 | 1185 |
xlc) |
1186 |
DISABLE_WARNING_PREFIX="-qsuppress=" |
|
1187 |
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" |
|
1188 |
;; |
|
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1189 |
esac |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1190 |
AC_SUBST(DISABLE_WARNING_PREFIX) |
36506 | 1191 |
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX) |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1192 |
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) |
16987 | 1193 |
]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1194 |
|
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1195 |
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1196 |
# Arguments: |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1197 |
# $1 - Optional prefix for each variable defined. |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1198 |
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1199 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1200 |
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1201 |
# runs afoul of the more aggressive versions of these optimisations. |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1202 |
# Notably, value range propagation now assumes that the this pointer of C++ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1203 |
# member functions is non-null. |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1204 |
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1205 |
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1206 |
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror], |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1207 |
dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1208 |
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1209 |
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1210 |
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror], |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1211 |
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1212 |
AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1213 |
$1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1214 |
$1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1215 |
]) |