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