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