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