author | ihse |
Mon, 19 Feb 2018 14:19:40 +0100 | |
branch | ihse-cflags-rewrite-branch |
changeset 56150 | 37625ab20ec7 |
parent 56149 | 0a4dbc2c7ed1 |
child 56153 | 13a257673a61 |
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 |
|
56150 | 26 |
m4_include([flags-ldflags.m4]) |
27 |
||
42538 | 28 |
################################################################################ |
29 |
# |
|
30 |
# Setup ABI profile (for arm) |
|
31 |
# |
|
32 |
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE], |
|
33 |
[ |
|
34 |
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], |
|
35 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])]) |
|
36 |
||
37 |
if test "x$with_abi_profile" != x; then |
|
38 |
if test "x$OPENJDK_TARGET_CPU" != xarm && \ |
|
39 |
test "x$OPENJDK_TARGET_CPU" != xaarch64; then |
|
40 |
AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) |
|
41 |
fi |
|
42 |
||
43 |
OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile |
|
44 |
AC_MSG_CHECKING([for ABI profle]) |
|
45 |
AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) |
|
46 |
||
47 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
|
48 |
ARM_FLOAT_TYPE=vfp-sflt |
|
49 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
50 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
|
51 |
ARM_FLOAT_TYPE=vfp-hflt |
|
52 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
53 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
|
54 |
ARM_FLOAT_TYPE=sflt |
|
55 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
56 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
|
57 |
ARM_FLOAT_TYPE=vfp-sflt |
|
58 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
59 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
|
60 |
ARM_FLOAT_TYPE=vfp-hflt |
|
61 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
62 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then |
|
63 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
64 |
ARM_FLOAT_TYPE= |
|
65 |
ARM_ARCH_TYPE_FLAGS= |
|
66 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
|
67 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
68 |
ARM_FLOAT_TYPE= |
|
69 |
ARM_ARCH_TYPE_FLAGS= |
|
70 |
else |
|
71 |
AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) |
|
72 |
fi |
|
73 |
||
74 |
if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then |
|
75 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' |
|
76 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
|
77 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
78 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
|
79 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
80 |
fi |
|
81 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
82 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
83 |
||
84 |
AC_MSG_CHECKING([for arch type flags]) |
|
85 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
86 |
||
87 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
88 |
# autoconf target triplet. |
|
89 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
90 |
# Sanity check that it is a known ABI. |
|
91 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
92 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
93 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
94 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
95 |
fi |
|
96 |
AC_MSG_CHECKING([for ABI property name]) |
|
97 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
98 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
99 |
||
100 |
# Pass these on to the open part of configure as if they were set using |
|
101 |
# --with-extra-c[xx]flags. |
|
102 |
EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
103 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
104 |
# Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS. |
|
105 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'" |
|
106 |
# And pass the architecture flags to the linker as well |
|
107 |
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
108 |
fi |
|
109 |
||
110 |
# When building with an abi profile, the name of that profile is appended on the |
|
111 |
# bundle platform, which is used in bundle names. |
|
112 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
113 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
114 |
fi |
|
115 |
]) |
|
116 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
117 |
# 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
|
118 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
119 |
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
|
120 |
[ |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
121 |
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
|
122 |
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
|
123 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
124 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
125 |
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
|
126 |
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
|
127 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
128 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
129 |
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
|
130 |
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
|
131 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
132 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
133 |
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
|
134 |
[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
|
135 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
136 |
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
|
137 |
[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
|
138 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
139 |
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
|
140 |
[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
|
141 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
142 |
EXTRA_CFLAGS="$with_extra_cflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
143 |
EXTRA_CXXFLAGS="$with_extra_cxxflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
144 |
EXTRA_LDFLAGS="$with_extra_ldflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
145 |
|
37402 | 146 |
AC_SUBST(EXTRA_CFLAGS) |
147 |
AC_SUBST(EXTRA_CXXFLAGS) |
|
148 |
AC_SUBST(EXTRA_LDFLAGS) |
|
149 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
150 |
# 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
|
151 |
# should include the extra parameters |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
152 |
CFLAGS="$EXTRA_CFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
153 |
CXXFLAGS="$EXTRA_CXXFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
154 |
LDFLAGS="$EXTRA_LDFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
155 |
CPPFLAGS="" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
156 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
157 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
158 |
# 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
|
159 |
# 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
|
160 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
161 |
# 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
|
162 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
163 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
164 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
165 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
166 |
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
|
167 |
# 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
|
168 |
# 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
|
169 |
# 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
|
170 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
171 |
$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
|
172 |
$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
|
173 |
-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
|
174 |
# 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
|
175 |
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
|
176 |
# Make sure this ld is runnable. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
177 |
if test -f "$SOLARIS_LD"; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
178 |
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
|
179 |
$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
|
180 |
else |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
181 |
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
|
182 |
fi |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
183 |
fi |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
184 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
185 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
186 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
187 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
188 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
189 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
190 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
191 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
192 |
# 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
|
193 |
$1CFLAGS="[$]$1CFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
194 |
$1CPPFLAGS="[$]$1CPPFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
195 |
$1CXXFLAGS="[$]$1CXXFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
196 |
$1LDFLAGS="[$]$1LDFLAGS [$]$1SYSROOT_LDFLAGS" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
197 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
198 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
199 |
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
|
200 |
# 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
|
201 |
$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
|
202 |
$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
|
203 |
# 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
|
204 |
# 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
|
205 |
$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
|
206 |
$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
|
207 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
208 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
209 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
210 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
211 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
212 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
213 |
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
214 |
[ |
56124 | 215 |
FLAGS_SETUP_TOOLCHAIN_CONTROL |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
216 |
|
56124 | 217 |
FLAGS_SETUP_ARFLAGS |
218 |
FLAGS_SETUP_STRIPFLAGS |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
219 |
|
56124 | 220 |
FLAGS_SETUP_RCFLAGS |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
221 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
222 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
223 |
# silence copyright notice and other headers. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
224 |
COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" |
20363 | 225 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
226 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
227 |
|
37402 | 228 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
229 |
[ |
56124 | 230 |
FLAGS_SETUP_SHARED_LIBS |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
231 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
232 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
14111 | 233 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
56124 | 234 |
if test "x$STATIC_BUILD" = xfalse; then |
37402 | 235 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
236 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
237 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
238 |
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
|
239 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
37402 | 240 |
if test "x$STATIC_BUILD" = xfalse; then |
241 |
JVM_CFLAGS="$JVM_CFLAGS -fPIC" |
|
242 |
fi |
|
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
243 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
244 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
36051 | 245 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
20363 | 246 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
247 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
248 |
|
20363 | 249 |
# The (cross) compiler is now configured, we can now test capabilities |
250 |
# of the target platform. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
251 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
252 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
253 |
# 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
|
254 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
255 |
# 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
|
256 |
# 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
|
257 |
# 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
|
258 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
259 |
# -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
|
260 |
# -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
|
261 |
# -fsingle: Use single precision floating point with 'float' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
262 |
# -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
|
263 |
# (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
|
264 |
# pointer types are not recommended) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
265 |
# -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
|
266 |
# (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
|
267 |
# -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
|
268 |
# -xrestrict: Pointer parameters to functions do not overlap |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
269 |
# (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
|
270 |
# 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
|
271 |
# -xlibmil: Inline some library routines |
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 |
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
274 |
# (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
|
275 |
# 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
|
276 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
277 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
278 |
[ |
56124 | 279 |
FLAGS_SETUP_DEBUG_SYMBOLS |
280 |
FLAGS_SETUP_QUALITY_CHECKS |
|
281 |
FLAGS_SETUP_OPTIMIZATION |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
282 |
|
37402 | 283 |
# Debug symbols for JVM_CFLAGS |
284 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
285 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs" |
|
286 |
if test "x$DEBUG_LEVEL" = xslowdebug; then |
|
287 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
288 |
else |
|
289 |
# -g0 does not disable inlining, which -g does. |
|
290 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0" |
|
291 |
fi |
|
292 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
293 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+" |
|
294 |
else |
|
295 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
296 |
fi |
|
297 |
AC_SUBST(JVM_CFLAGS_SYMBOLS) |
|
298 |
||
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
299 |
# bounds, memory and behavior checking options |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
300 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
301 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
302 |
slowdebug ) |
37402 | 303 |
# FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it |
35747 | 304 |
# get's added conditionally on whether we produce debug symbols or not. |
305 |
# This is most likely not really correct. |
|
306 |
||
37402 | 307 |
if test "x$STACK_PROTECTOR_CFLAG" != x; then |
308 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
|
309 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
310 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
311 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
312 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
313 |
|
37402 | 314 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
315 |
if test "x$DEBUG_LEVEL" != xrelease; then |
|
316 |
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
|
317 |
JVM_CFLAGS="$JVM_CFLAGS -homeparams" |
|
318 |
fi |
|
319 |
fi |
|
320 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
321 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
322 |
|
37402 | 323 |
|
324 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], |
|
325 |
[ |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
326 |
# Additional macosx handling |
56144 | 327 |
if test "x$FLAGS_OS" = xmacosx; then |
48751
54f355e65415
8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents:
48355
diff
changeset
|
328 |
# 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
|
329 |
# 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
|
330 |
# 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
|
331 |
# 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
|
332 |
# require code changes to build. |
25034
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
333 |
MACOSX_VERSION_MIN=10.7.0 |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
334 |
AC_SUBST(MACOSX_VERSION_MIN) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
335 |
|
45875 | 336 |
# Setting --with-macosx-version-max=<version> makes it an error to build or |
337 |
# link to macosx APIs that are newer than the given OS version. The expected |
|
338 |
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. |
|
339 |
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max], |
|
340 |
[error on use of newer functionality. @<:@macosx@:>@])], |
|
341 |
[ |
|
342 |
if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then |
|
343 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
344 |
elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then |
|
345 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
346 |
elif test "x$with_macosx_version_max" = "xno"; then |
|
347 |
# Use build system default |
|
348 |
MACOSX_VERSION_MAX= |
|
349 |
else |
|
350 |
AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn]) |
|
351 |
fi |
|
352 |
], |
|
353 |
[MACOSX_VERSION_MAX=] |
|
354 |
) |
|
355 |
AC_SUBST(MACOSX_VERSION_MAX) |
|
56144 | 356 |
fi |
45875 | 357 |
|
42538 | 358 |
FLAGS_SETUP_ABI_PROFILE |
46224
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 |
# 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
|
361 |
# |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
362 |
# 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
|
363 |
# 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
|
364 |
# don't let it update LIBS. |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
365 |
save_LIBS="$LIBS" |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
366 |
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
|
367 |
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
|
368 |
CLOCK_GETTIME_IN_LIBRT=true |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
369 |
fi |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
370 |
LIBS="$save_LIBS" |
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
371 |
|
56150 | 372 |
FLAGS_SETUP_LINKER_FLAGS_FOR_JDK |
56149 | 373 |
|
374 |
### CFLAGS |
|
375 |
||
56124 | 376 |
FLAGS_OS=OPENJDK_TARGET_OS |
377 |
FLAGS_OS_TYPE=OPENJDK_TARGET_OS_TYPE |
|
378 |
FLAGS_CPU=OPENJDK_TARGET_CPU |
|
379 |
FLAGS_CPU_ARCH=OPENJDK_TARGET_CPU_ARCH |
|
380 |
FLAGS_CPU_BITS=OPENJDK_TARGET_CPU_BITS |
|
381 |
FLAGS_CPU_ENDIAN=OPENJDK_TARGET_CPU_ENDIAN |
|
382 |
FLAGS_CPU_LEGACY=OPENJDK_TARGET_CPU_LEGACY |
|
383 |
FLAGS_ADD_LP64=OPENJDK_TARGET_ADD_LP64 |
|
384 |
||
37402 | 385 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET]) |
56124 | 386 |
|
387 |
FLAGS_OS=OPENJDK_BUILD_OS |
|
388 |
FLAGS_OS_TYPE=OPENJDK_BUILD_OS_TYPE |
|
389 |
FLAGS_CPU=OPENJDK_BUILD_CPU |
|
390 |
FLAGS_CPU_ARCH=OPENJDK_BUILD_CPU_ARCH |
|
391 |
FLAGS_CPU_BITS=OPENJDK_BUILD_CPU_BITS |
|
392 |
FLAGS_CPU_ENDIAN=OPENJDK_BUILD_CPU_ENDIAN |
|
393 |
FLAGS_CPU_LEGACY=OPENJDK_BUILD_CPU_LEGACY |
|
394 |
FLAGS_ADD_LP64=OPENJDK_BUILD_ADD_LP64= |
|
395 |
||
37402 | 396 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_]) |
397 |
||
398 |
# Tests are only ever compiled for TARGET |
|
399 |
# Flags for compiling test libraries |
|
56125 | 400 |
CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG ${_SPECIAL_EXTRA_1} ${_SPECIAL_EXTRA_2}" |
401 |
CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG ${_SPECIAL_EXTRA_1} ${_SPECIAL_EXTRA_2}" |
|
37402 | 402 |
|
403 |
# Flags for compiling test executables |
|
404 |
CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" |
|
405 |
CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" |
|
406 |
||
407 |
AC_SUBST(CFLAGS_TESTLIB) |
|
408 |
AC_SUBST(CFLAGS_TESTEXE) |
|
409 |
AC_SUBST(CXXFLAGS_TESTLIB) |
|
410 |
AC_SUBST(CXXFLAGS_TESTEXE) |
|
411 |
]) |
|
412 |
||
413 |
################################################################################ |
|
414 |
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check |
|
415 |
# conditionals against. |
|
416 |
# $2 - Optional prefix for each variable defined. |
|
417 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
418 |
[ |
56145 | 419 |
#### OS DEFINES, these should be independent on toolchain |
420 |
if test "x$FLAGS_OS" = xlinux; then |
|
421 |
$2_CFLAGS_OS_DEF_JVM="-DLINUX" |
|
56148 | 422 |
$2_CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
56145 | 423 |
elif test "x$FLAGS_OS" = xsolaris; then |
424 |
$2_CFLAGS_OS_DEF_JVM="-DSOLARIS" |
|
425 |
$2_SPECIAL_2="-D__solaris__" # add on both CFLAGS |
|
426 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2_SPECIAL_2}" |
|
427 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2_SPECIAL_2}" |
|
428 |
elif test "x$FLAGS_OS" = xmacosx; then |
|
429 |
$2_CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" |
|
430 |
$2_CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" |
|
431 |
elif test "x$FLAGS_OS" = xaix; then |
|
432 |
$2_CFLAGS_OS_DEF_JVM="-DAIX" |
|
433 |
elif test "x$FLAGS_OS" = xbsd; then |
|
434 |
$2_CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE" |
|
435 |
elif test "x$FLAGS_OS" = xwindows; then |
|
436 |
$2_CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" |
|
437 |
fi |
|
438 |
||
439 |
# Setup target OS define. Use OS target name but in upper case. |
|
440 |
FLAGS_OS_UPPERCASE=`$ECHO $FLAGS_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` |
|
441 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D$FLAGS_OS_UPPERCASE ${$2_CFLAGS_OS_DEF_JDK}" |
|
442 |
||
443 |
#### CPU DEFINES, these should be independent on toolchain |
|
444 |
||
445 |
# Setup target CPU |
|
446 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
447 |
$FLAGS_ADD_LP64 \ |
|
448 |
-DARCH='\"$FLAGS_CPU_LEGACY\"' -D$FLAGS_CPU_LEGACY" |
|
449 |
||
450 |
# Setup endianness |
|
451 |
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then |
|
56148 | 452 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DVM_LITTLE_ENDIAN" |
453 |
||
56145 | 454 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
455 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
456 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
457 |
# Note: -Dmacro is the same as #define macro 1 |
|
458 |
# -Dmacro= is the same as #define macro |
|
459 |
if test "x$FLAGS_OS" = xsolaris; then |
|
460 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" |
|
461 |
else |
|
462 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" |
|
463 |
fi |
|
464 |
else |
|
465 |
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they |
|
466 |
# are defined in the system? |
|
467 |
if test "x$FLAGS_OS" = xsolaris; then |
|
468 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN=" |
|
469 |
else |
|
470 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" |
|
471 |
fi |
|
472 |
fi |
|
473 |
||
56148 | 474 |
# setup CPU bit size |
475 |
||
476 |
if test "x$FLAGS_CPU_BITS" = x64; then |
|
477 |
if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then |
|
478 |
# Solaris does not have _LP64=1 in the old build. |
|
479 |
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. |
|
480 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_LP64=1" |
|
481 |
fi |
|
482 |
fi |
|
483 |
||
484 |
#### GLOBAL DEFINES |
|
485 |
# Set some common defines. These works for all compilers, but assume |
|
486 |
# -D is universally accepted. |
|
487 |
||
488 |
# Always enable optional macros for VM. |
|
489 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_FORMAT_MACROS" |
|
490 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_LIMIT_MACROS" |
|
491 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_CONSTANT_MACROS" |
|
492 |
||
493 |
# Setup some hard coded includes |
|
494 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
495 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
|
496 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ |
|
497 |
-I${TOPDIR}/src/java.base/share/native/libjava \ |
|
498 |
-I${TOPDIR}/src/java.base/$FLAGS_OS_TYPE/native/libjava \ |
|
499 |
-I${TOPDIR}/src/hotspot/share/include \ |
|
500 |
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_$1_OS_TYPE}/include" |
|
501 |
||
502 |
############################################################################### |
|
503 |
||
504 |
# Adjust flags according to debug level. |
|
505 |
# Setup debug/release defines |
|
506 |
if test "x$DEBUG_LEVEL" = xrelease; then |
|
507 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DNDEBUG" |
|
508 |
if test "x$FLAGS_OS" = xsolaris; then |
|
509 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DTRIMMED" |
|
510 |
fi |
|
511 |
else |
|
512 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" |
|
513 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS" |
|
514 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DDEBUG" |
|
515 |
||
516 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
517 |
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. |
|
518 |
# Hotspot now overflows its 64K TOC (currently only for debug), |
|
519 |
# so for debug we build with '-qpic=large -bbigtoc'. |
|
520 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qpic=large" |
|
521 |
fi |
|
522 |
fi |
|
523 |
||
524 |
||
56145 | 525 |
#### TOOLCHAIN DEFINES |
526 |
||
527 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
528 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE -D_REENTRANT" |
|
529 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
530 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE" |
|
531 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
56148 | 532 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSPARC_WORKS -D_Crun_inline_placement" |
56145 | 533 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
534 |
if test "x$FLAGS_CPU_ARCH" = xx86; then |
|
535 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB" |
|
536 |
fi |
|
537 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -DCC_NOEX" |
|
538 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
539 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT" |
|
540 |
$2_COMMON_TOOLCHAIN_DEFINES="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" |
|
541 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK ${$2_COMMON_TOOLCHAIN_DEFINES}" |
|
542 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK ${$2_COMMON_TOOLCHAIN_DEFINES}" |
|
543 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
544 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \ |
|
545 |
-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ |
|
546 |
-DWIN32 -DIAL" |
|
547 |
if test "x$FLAGS_CPU" = xx86_64; then |
|
548 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" |
|
549 |
else |
|
550 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" |
|
551 |
fi |
|
552 |
fi |
|
56144 | 553 |
|
554 |
# PER TOOLCHAIN: |
|
56148 | 555 |
# COMPILER-ARCH/CPU-special (-m, -f...) |
556 |
# COMPILER-warnings |
|
557 |
# COMPILER: shared-lib-special, exe-special |
|
558 |
# Special extras... |
|
559 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
560 |
if test "x$FLAGS_CPU_ARCH" = "xsparc"; then |
|
561 |
$2_SPECIAL_EXTRA_1="-xregs=no%appl" # add on both EXTRA |
|
562 |
fi |
|
563 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
564 |
$2_SPECIAL_1="-qchars=signed -qfullpath -qsaveopt" # add on both CFLAGS |
|
565 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2_SPECIAL_1}" |
|
566 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2_SPECIAL_1}" |
|
567 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
568 |
$2CXXSTD_CXXFLAG="-std=gnu++98" # only for CXX and JVM |
|
569 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror], |
|
570 |
IF_FALSE: [$2CXXSTD_CXXFLAG=""]) |
|
571 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}" |
|
572 |
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}" |
|
573 |
AC_SUBST($2CXXSTD_CXXFLAG) |
|
574 |
fi |
|
575 |
||
576 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}" |
|
577 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2EXTRA_CXXFLAGS}" |
|
578 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$2EXTRA_LDFLAGS}" |
|
579 |
||
580 |
||
581 |
############################################################################### |
|
582 |
# |
|
583 |
# |
|
584 |
# CFLAGS BASIC |
|
585 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
|
586 |
# COMMON to gcc and clang |
|
587 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe -fno-rtti -fno-exceptions \ |
|
588 |
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" |
|
589 |
fi |
|
590 |
||
591 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
592 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new" |
|
593 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -pipe" |
|
594 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
595 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2)) |
|
596 |
||
597 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
598 |
# Restrict the debug information created by Clang to avoid |
|
599 |
# too big object files and speed the build up a little bit |
|
600 |
# (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
|
601 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -flimit-debug-info" |
|
602 |
||
603 |
if test "x$FLAGS_OS" = xlinux; then |
|
604 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -pipe" |
|
605 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
606 |
fi |
|
607 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
608 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -xc99=%none -xCC -Xa -v -mt -W0,-noglobal" |
|
609 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -mt -features=no%except -norunpath -xnolib" |
|
610 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $PICFLAG" |
|
611 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -template=no%extdef -features=no%split_init \ |
|
612 |
-library=stlport4 -mt -features=no%except" |
|
613 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
614 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \ |
|
615 |
-qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ |
|
616 |
-qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" |
|
617 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
618 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -nologo -MD -MP" |
|
619 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \ |
|
620 |
-MD -Zc:wchar_t-" |
|
621 |
fi |
|
622 |
||
623 |
# CFLAGS WARNINGS STUFF |
|
624 |
# Set $2JVM_CFLAGS warning handling |
|
625 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
|
626 |
# COMMON to gcc and clang |
|
627 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wpointer-arith \ |
|
628 |
-Wsign-compare -Wunused-function" |
|
629 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
|
630 |
# Non-zero builds have stricter warnings |
|
631 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wundef -Wformat=2" |
|
632 |
fi |
|
633 |
||
634 |
fi |
|
635 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
636 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
|
637 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wunused-value -Woverloaded-virtual" |
|
638 |
||
639 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
640 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2, |
|
641 |
IF_AT_LEAST: [ |
|
642 |
# These flags either do not work or give spurious warnings prior to gcc 4.8. |
|
643 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized" |
|
644 |
] |
|
645 |
) |
|
646 |
fi |
|
647 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
|
648 |
# Non-zero builds have stricter warnings |
|
649 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wreturn-type" |
|
650 |
fi |
|
651 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
652 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-deprecated" |
|
653 |
if test "x$FLAGS_OS" = xlinux; then |
|
654 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-sometimes-uninitialized" |
|
655 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
|
656 |
fi |
|
657 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
658 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -errshort=tags" |
|
659 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -errtags=yes +w" |
|
660 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -errtags=yes -errfmt" |
|
661 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
662 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -W3" |
|
663 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS -W3 -wd4800" |
|
664 |
fi |
|
665 |
||
666 |
# CFLAGS PER CPU |
|
667 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || ; then |
|
668 |
# COMMON to gcc and clang |
|
669 |
if test "x$FLAGS_CPU" = xx86; then |
|
670 |
# Force compatibility with i586 on 32 bit intel platforms. |
|
671 |
$2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586" |
|
672 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586" |
|
673 |
fi |
|
674 |
fi |
|
675 |
||
676 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
677 |
if test "x$FLAGS_CPU_ARCH" = xppc; then |
|
678 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" |
|
679 |
if test "x$FLAGS_CPU" = xppc64; then |
|
680 |
# fixes `relocation truncated to fit' error for gcc 4.1. |
|
681 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mminimal-toc" |
|
682 |
# Use ppc64 instructions, but schedule for power5 |
|
683 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=powerpc64 -mtune=power5" |
|
684 |
elif test "x$FLAGS_CPU" = xppc64le; then |
|
685 |
# Little endian machine uses ELFv2 ABI. |
|
686 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DABI_ELFv2" |
|
687 |
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. |
|
688 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=power8 -mtune=power8" |
|
689 |
fi |
|
690 |
elif test "x$FLAGS_CPU" = xs390x; then |
|
691 |
BASIC_S390_FLAGS="-mbackchain -march=z10" |
|
692 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $BASIC_S390_FLAGS" |
|
693 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK $BASIC_S390_FLAGS" |
|
694 |
fi |
|
695 |
||
696 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
697 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
698 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
|
699 |
fi |
|
700 |
||
701 |
if test "x$FLAGS_CPU_ARCH" = xarm; then |
|
702 |
$2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char" |
|
703 |
fi |
|
704 |
||
705 |
# Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" |
|
706 |
# FIXME: This should not really be set using extra_cflags. |
|
707 |
if test "x$OPENJDK_TARGET_CPU" = xarm; then |
|
708 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi" |
|
709 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi" |
|
710 |
fi |
|
711 |
||
712 |
||
713 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
714 |
if test "x$FLAGS_OS" = xlinux; then |
|
715 |
# ppc test not really needed for clang |
|
716 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
717 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
718 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
|
719 |
fi |
|
720 |
fi |
|
721 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
722 |
if test "x$FLAGS_CPU" = xsparcv9; then |
|
723 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -xarch=sparc" |
|
724 |
fi |
|
725 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
726 |
if test "x$FLAGS_CPU" = xppc64; then |
|
727 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qarch=ppc64" |
|
728 |
fi |
|
729 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
730 |
if test "x$FLAGS_CPU" = xx86; then |
|
731 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -arch:IA32" |
|
732 |
fi |
|
733 |
fi |
|
734 |
||
735 |
||
736 |
# Set some common defines. These works for all compilers, but assume |
|
737 |
# -D is universally accepted. |
|
738 |
||
739 |
||
740 |
# Optional POSIX functionality needed by the VM |
|
741 |
||
742 |
if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then |
|
743 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSUPPORTS_CLOCK_MONOTONIC" |
|
744 |
if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then |
|
745 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DNEEDS_LIBRT" |
|
746 |
fi |
|
747 |
fi |
|
748 |
||
749 |
||
750 |
# Set some additional per-OS defines. |
|
751 |
||
752 |
||
753 |
# Additional macosx handling |
|
754 |
if test "x$FLAGS_OS" = xmacosx; then |
|
755 |
# Let the flags variables get resolved in make for easier override on make |
|
756 |
# command line. AvailabilityMacros.h versions have no dots, ex: 1070. |
|
757 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
758 |
-DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ |
|
759 |
-mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
760 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS \ |
|
761 |
-DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ |
|
762 |
-mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
763 |
||
764 |
if test -n "$MACOSX_VERSION_MAX"; then |
|
765 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
766 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" |
|
767 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS \ |
|
768 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" |
|
769 |
fi |
|
770 |
fi |
|
771 |
||
772 |
||
773 |
||
774 |
# Where does this really belong?? |
|
775 |
if test "x$FLAGS_OS" = xlinux; then |
|
776 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $PICFLAG" |
|
777 |
elif test "x$FLAGS_OS" = xmacosx; then |
|
778 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
|
779 |
fi |
|
780 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS ${$2_CFLAGS_OS_DEF_JVM}" |
|
781 |
||
782 |
||
783 |
||
784 |
||
785 |
# The shared libraries are compiled using the picflag. |
|
786 |
||
787 |
$2CFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
788 |
[$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK $PICFLAG ${$2_SPECIAL_EXTRA_1}" |
|
789 |
$2CXXFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
790 |
[$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK $PICFLAG ${$2_SPECIAL_EXTRA_1}" |
|
791 |
||
792 |
# Executable flags |
|
793 |
$2CFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK" |
|
794 |
$2CXXFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK" |
|
795 |
||
56149 | 796 |
AC_SUBST($2CFLAGS_JDKLIB) |
797 |
AC_SUBST($2CFLAGS_JDKEXE) |
|
798 |
AC_SUBST($2CXXFLAGS_JDKLIB) |
|
799 |
AC_SUBST($2CXXFLAGS_JDKEXE) |
|
800 |
||
801 |
||
802 |
############## ARFLAGS |
|
803 |
# Additional macosx handling |
|
804 |
if test "x$FLAGS_OS" = xmacosx; then |
|
805 |
$2ARFLAGS="$2$ARFLAGS -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
806 |
fi |
|
807 |
||
808 |
# Setup some hard coded includes |
|
809 |
||
810 |
############## ASFLAGS |
|
56148 | 811 |
|
56149 | 812 |
# Set $2JVM_ASFLAGS |
813 |
if test "x$FLAGS_OS" = xlinux; then |
|
814 |
if test "x$FLAGS_CPU" = xx86; then |
|
815 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586" |
|
816 |
fi |
|
817 |
elif test "x$FLAGS_OS" = xmacosx; then |
|
818 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
|
819 |
fi |
|
820 |
||
56144 | 821 |
|
56149 | 822 |
AC_SUBST($2JVM_CFLAGS) |
823 |
AC_SUBST($2JVM_LDFLAGS) |
|
824 |
AC_SUBST($2JVM_ASFLAGS) |
|
825 |
||
826 |
AC_SUBST($2JDKLIB_LIBS) |
|
827 |
AC_SUBST($2JDKEXE_LIBS) |
|
828 |
AC_SUBST($2JVM_LIBS) |
|
56144 | 829 |
|
56149 | 830 |
]) |
831 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
832 |
# 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
|
833 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 834 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
835 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
836 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
34923 | 837 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
16987 | 838 |
[ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
839 |
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) |
16987 | 840 |
supports=yes |
841 |
||
842 |
saved_cflags="$CFLAGS" |
|
34923 | 843 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
16987 | 844 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
845 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 846 |
[supports=no]) |
16987 | 847 |
AC_LANG_POP([C]) |
848 |
CFLAGS="$saved_cflags" |
|
849 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
850 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
851 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
852 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
853 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
854 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
855 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
856 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
857 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
858 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
859 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
860 |
# 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
|
861 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
862 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
863 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
864 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
865 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
866 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
867 |
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
|
868 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
869 |
|
16987 | 870 |
saved_cxxflags="$CXXFLAGS" |
34923 | 871 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
16987 | 872 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
873 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 874 |
[supports=no]) |
16987 | 875 |
AC_LANG_POP([C++]) |
876 |
CXXFLAGS="$saved_cxxflags" |
|
877 |
||
878 |
AC_MSG_RESULT([$supports]) |
|
879 |
if test "x$supports" = "xyes" ; then |
|
34923 | 880 |
: |
881 |
ARG_IF_TRUE |
|
16987 | 882 |
else |
34923 | 883 |
: |
884 |
ARG_IF_FALSE |
|
16987 | 885 |
fi |
886 |
]) |
|
887 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
888 |
# 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
|
889 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
890 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
891 |
# 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
|
892 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
893 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
894 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
895 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
896 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
897 |
IF_FALSE: [C_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
898 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
899 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
900 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
901 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
902 |
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
|
903 |
supports=no |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
904 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi |
42141 | 905 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
906 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
907 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
908 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
909 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
910 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
911 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
912 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
913 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
914 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
915 |
|
34923 | 916 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
917 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
918 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
919 |
# Check that the linker support an argument |
34923 | 920 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
921 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
922 |
[ |
34923 | 923 |
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
|
924 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
925 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
926 |
saved_ldflags="$LDFLAGS" |
34923 | 927 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
928 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
929 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
930 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
931 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
932 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
933 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
934 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
935 |
if test "x$supports" = "xyes" ; then |
34923 | 936 |
: |
937 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
938 |
else |
34923 | 939 |
: |
940 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
941 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
942 |
]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
943 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
944 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC], |
16987 | 945 |
[ |
22466 | 946 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
16987 | 947 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
34923 | 948 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
949 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
|
950 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
16987 | 951 |
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
|
952 |
|
30415 | 953 |
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors], |
954 |
[do not consider native warnings to be an error @<:@enabled@:>@])]) |
|
955 |
||
956 |
AC_MSG_CHECKING([if native warnings are errors]) |
|
957 |
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
|
958 |
AC_MSG_RESULT([yes (explicitly set)]) |
30415 | 959 |
WARNINGS_AS_ERRORS=true |
960 |
elif test "x$enable_warnings_as_errors" = "xno"; then |
|
961 |
AC_MSG_RESULT([no]) |
|
962 |
WARNINGS_AS_ERRORS=false |
|
963 |
elif test "x$enable_warnings_as_errors" = "x"; then |
|
964 |
AC_MSG_RESULT([yes (default)]) |
|
965 |
WARNINGS_AS_ERRORS=true |
|
966 |
else |
|
967 |
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument]) |
|
968 |
fi |
|
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
969 |
|
30415 | 970 |
AC_SUBST(WARNINGS_AS_ERRORS) |
971 |
||
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
972 |
case "${TOOLCHAIN_TYPE}" in |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
973 |
microsoft) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
974 |
DISABLE_WARNING_PREFIX="-wd" |
25882 | 975 |
CFLAGS_WARNINGS_ARE_ERRORS="-WX" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
976 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
977 |
solstudio) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
978 |
DISABLE_WARNING_PREFIX="-erroff=" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
979 |
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
|
980 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
981 |
gcc) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
982 |
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error |
34923 | 983 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
984 |
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true], |
|
985 |
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
|
986 |
) |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
987 |
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
|
988 |
DISABLE_WARNING_PREFIX="-Wno-" |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
989 |
else |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
990 |
DISABLE_WARNING_PREFIX= |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
991 |
fi |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
992 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
993 |
# 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
|
994 |
# 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
|
995 |
# build compiler |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
996 |
CC_OLD="$CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
997 |
CXX_OLD="$CXX" |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
998 |
CC="$BUILD_CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
999 |
CXX="$BUILD_CXX" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1000 |
CFLAGS_OLD="$CFLAGS" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1001 |
CFLAGS="" |
34923 | 1002 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
1003 |
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true], |
|
1004 |
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
|
1005 |
) |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1006 |
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
|
1007 |
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-" |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1008 |
else |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1009 |
BUILD_CC_DISABLE_WARNING_PREFIX= |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1010 |
fi |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1011 |
CC="$CC_OLD" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1012 |
CXX="$CXX_OLD" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1013 |
CFLAGS="$CFLAGS_OLD" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1014 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1015 |
clang) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1016 |
DISABLE_WARNING_PREFIX="-Wno-" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1017 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1018 |
;; |
35747 | 1019 |
xlc) |
1020 |
DISABLE_WARNING_PREFIX="-qsuppress=" |
|
1021 |
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" |
|
1022 |
;; |
|
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1023 |
esac |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1024 |
AC_SUBST(DISABLE_WARNING_PREFIX) |
36506 | 1025 |
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
|
1026 |
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) |
16987 | 1027 |
]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1028 |
|
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1029 |
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1030 |
# Arguments: |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1031 |
# $1 - Optional prefix for each variable defined. |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1032 |
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1033 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1034 |
# 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
|
1035 |
# 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
|
1036 |
# 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
|
1037 |
# member functions is non-null. |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1038 |
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
|
1039 |
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
|
1040 |
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
|
1041 |
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
|
1042 |
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
|
1043 |
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
|
1044 |
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
|
1045 |
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1046 |
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
|
1047 |
$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
|
1048 |
$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
|
1049 |
]) |