author | lana |
Fri, 20 Jan 2017 19:09:53 +0000 | |
changeset 43255 | c910b570468e |
parent 43057 | 32d7aa6c6a4a |
child 43383 | 5e74f3dd4656 |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
35451
d0b71f2375d0
8129395: Configure should verify that -fstack-protector is valid - take 2
ihse
parents:
35450
diff
changeset
|
2 |
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
42538 | 26 |
################################################################################ |
27 |
# |
|
28 |
# Setup ABI profile (for arm) |
|
29 |
# |
|
30 |
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE], |
|
31 |
[ |
|
32 |
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], |
|
33 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])]) |
|
34 |
||
35 |
if test "x$with_abi_profile" != x; then |
|
36 |
if test "x$OPENJDK_TARGET_CPU" != xarm && \ |
|
37 |
test "x$OPENJDK_TARGET_CPU" != xaarch64; then |
|
38 |
AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) |
|
39 |
fi |
|
40 |
||
41 |
OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile |
|
42 |
AC_MSG_CHECKING([for ABI profle]) |
|
43 |
AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) |
|
44 |
||
45 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
|
46 |
ARM_FLOAT_TYPE=vfp-sflt |
|
47 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
48 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
|
49 |
ARM_FLOAT_TYPE=vfp-hflt |
|
50 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
51 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
|
52 |
ARM_FLOAT_TYPE=sflt |
|
53 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
54 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
|
55 |
ARM_FLOAT_TYPE=vfp-sflt |
|
56 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
57 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
|
58 |
ARM_FLOAT_TYPE=vfp-hflt |
|
59 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
60 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then |
|
61 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
62 |
ARM_FLOAT_TYPE= |
|
63 |
ARM_ARCH_TYPE_FLAGS= |
|
64 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
|
65 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
66 |
ARM_FLOAT_TYPE= |
|
67 |
ARM_ARCH_TYPE_FLAGS= |
|
68 |
else |
|
69 |
AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) |
|
70 |
fi |
|
71 |
||
72 |
if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then |
|
73 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' |
|
74 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
|
75 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
76 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
|
77 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
78 |
fi |
|
79 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
80 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
81 |
||
82 |
AC_MSG_CHECKING([for arch type flags]) |
|
83 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
84 |
||
85 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
86 |
# autoconf target triplet. |
|
87 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
88 |
# Sanity check that it is a known ABI. |
|
89 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
90 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
91 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
92 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
93 |
fi |
|
94 |
AC_MSG_CHECKING([for ABI property name]) |
|
95 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
96 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
97 |
||
98 |
# Pass these on to the open part of configure as if they were set using |
|
99 |
# --with-extra-c[xx]flags. |
|
100 |
EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
101 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
102 |
# Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" |
|
103 |
# FIXME: This should not really be set using extra_cflags. |
|
104 |
if test "x$OPENJDK_TARGET_CPU" = xarm; then |
|
105 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi" |
|
106 |
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi" |
|
107 |
fi |
|
108 |
# Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS. |
|
109 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'" |
|
110 |
# And pass the architecture flags to the linker as well |
|
111 |
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" |
|
112 |
fi |
|
113 |
||
114 |
# When building with an abi profile, the name of that profile is appended on the |
|
115 |
# bundle platform, which is used in bundle names. |
|
116 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
117 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
118 |
fi |
|
119 |
]) |
|
120 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
121 |
# Reset the global CFLAGS/LDFLAGS variables and initialize them with the |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
122 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
123 |
AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
124 |
[ |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
125 |
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
126 |
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
127 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
128 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
129 |
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
130 |
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
131 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
132 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
133 |
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
134 |
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
135 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
136 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
137 |
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
138 |
[extra flags to be used when compiling jdk c-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
139 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
140 |
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
141 |
[extra flags to be used when compiling jdk c++-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
142 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
143 |
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
144 |
[extra flags to be used when linking jdk])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
145 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
146 |
EXTRA_CFLAGS="$with_extra_cflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
147 |
EXTRA_CXXFLAGS="$with_extra_cxxflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
148 |
EXTRA_LDFLAGS="$with_extra_ldflags" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
149 |
|
37402 | 150 |
AC_SUBST(EXTRA_CFLAGS) |
151 |
AC_SUBST(EXTRA_CXXFLAGS) |
|
152 |
AC_SUBST(EXTRA_LDFLAGS) |
|
153 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
154 |
# The global CFLAGS and LDLAGS variables are used by configure tests and |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
155 |
# should include the extra parameters |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
156 |
CFLAGS="$EXTRA_CFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
157 |
CXXFLAGS="$EXTRA_CXXFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
158 |
LDFLAGS="$EXTRA_LDFLAGS" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
159 |
CPPFLAGS="" |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
160 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
161 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
162 |
# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
163 |
# that configure can use them while detecting compilers. |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
164 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
165 |
# Param 1 - Optional prefix to all variables. (e.g BUILD_) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
166 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
167 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
168 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
169 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
170 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
171 |
# Solaris Studio does not have a concept of sysroot. Instead we must |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
172 |
# make sure the default include and lib dirs are appended to each |
35450
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
173 |
# compile and link command line. Must also add -I-xbuiltin to enable |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
174 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
175 |
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include" |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
176 |
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ |
41040
7b919a4497ff
8165161: Solaris: /usr/ccs /opt/sfw and /opt/csw are dead, references should be expunged
alanbur
parents:
39940
diff
changeset
|
177 |
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
178 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
179 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
180 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
181 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
182 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
183 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
184 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
185 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
186 |
# The global CFLAGS and LDFLAGS variables need these for configure to function |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
187 |
$1CFLAGS="[$]$1CFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
188 |
$1CPPFLAGS="[$]$1CPPFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
189 |
$1CXXFLAGS="[$]$1CXXFLAGS [$]$1SYSROOT_CFLAGS" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
190 |
$1LDFLAGS="[$]$1LDFLAGS [$]$1SYSROOT_LDFLAGS" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
191 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
192 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
193 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
194 |
# We also need -iframework<path>/System/Library/Frameworks |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
195 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
196 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
197 |
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
198 |
# set this here so it doesn't have to be peppered throughout the forest |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
199 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
200 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
201 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
202 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
203 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
204 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
205 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
206 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
207 |
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
208 |
[ |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
209 |
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
210 |
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler |
36051 | 211 |
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder |
212 |
# commands produced by the link step (currently AIX only) |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
213 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
214 |
COMPILER_TARGET_BITS_FLAG="-q" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
215 |
COMPILER_COMMAND_FILE_FLAG="-f" |
36051 | 216 |
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" |
22458
6a74da13c52f
8022411: Allow overriding of CXX and CC with absolute path
ihse
parents:
22179
diff
changeset
|
217 |
else |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
218 |
COMPILER_TARGET_BITS_FLAG="-m" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
219 |
COMPILER_COMMAND_FILE_FLAG="@" |
36051 | 220 |
COMPILER_BINDCMD_FILE_FLAG="" |
34864
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
221 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
222 |
# The solstudio linker does not support @-files. |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
223 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
224 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
225 |
fi |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
226 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
227 |
# Check if @file is supported by gcc |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
228 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
229 |
AC_MSG_CHECKING([if @file is supported by gcc]) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
230 |
# Extra emtpy "" to prevent ECHO from interpreting '--version' as argument |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
231 |
$ECHO "" "--version" > command.file |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
232 |
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
233 |
AC_MSG_RESULT(yes) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
234 |
COMPILER_COMMAND_FILE_FLAG="@" |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
235 |
else |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
236 |
AC_MSG_RESULT(no) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
237 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
238 |
fi |
38843
2b141e8e916f
8158535: Configure script uses basic tools directly in many places
erikj
parents:
37864
diff
changeset
|
239 |
$RM command.file |
34864
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
240 |
fi |
20363 | 241 |
fi |
22467 | 242 |
AC_SUBST(COMPILER_TARGET_BITS_FLAG) |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
243 |
AC_SUBST(COMPILER_COMMAND_FILE_FLAG) |
36051 | 244 |
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) |
22466 | 245 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
246 |
# FIXME: figure out if we should select AR flags depending on OS or toolchain. |
20363 | 247 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
248 |
ARFLAGS="-r" |
22467 | 249 |
elif test "x$OPENJDK_TARGET_OS" = xaix; then |
22466 | 250 |
ARFLAGS="-X64" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
251 |
elif test "x$OPENJDK_TARGET_OS" = xwindows; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
252 |
# lib.exe is used as AR to create static libraries. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
253 |
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" |
20363 | 254 |
else |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
255 |
ARFLAGS="" |
20363 | 256 |
fi |
257 |
AC_SUBST(ARFLAGS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
258 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
259 |
## Setup strip. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
260 |
# FIXME: should this really be per platform, or should it be per toolchain type? |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
261 |
# strip is not provided by clang or solstudio; so guessing platform makes most sense. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
262 |
# FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
263 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
264 |
STRIPFLAGS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
265 |
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
266 |
STRIPFLAGS="-x" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
267 |
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
268 |
STRIPFLAGS="-S" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
269 |
elif test "x$OPENJDK_TARGET_OS" = xaix; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
270 |
STRIPFLAGS="-X32_64" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
271 |
fi |
14111 | 272 |
|
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
30856
diff
changeset
|
273 |
AC_SUBST(STRIPFLAGS) |
22721
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 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
276 |
CC_OUT_OPTION=-Fo |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
277 |
EXE_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
278 |
LD_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
279 |
AR_OUT_OPTION=-out: |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
280 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
281 |
# The option used to specify the target .o,.a or .so file. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
282 |
# When compiling, how to specify the to be created object file. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
283 |
CC_OUT_OPTION='-o$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
284 |
# When linking, how to specify the to be created executable. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
285 |
EXE_OUT_OPTION='-o$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
286 |
# When linking, how to specify the to be created dynamically linkable library. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
287 |
LD_OUT_OPTION='-o$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
288 |
# When archiving, how to specify the to be create static archive for object files. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
289 |
AR_OUT_OPTION='rcs$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
290 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
291 |
AC_SUBST(CC_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
292 |
AC_SUBST(EXE_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
293 |
AC_SUBST(LD_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
294 |
AC_SUBST(AR_OUT_OPTION) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
295 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
296 |
# On Windows, we need to set RC flags. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
297 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
27593
4703225f5be4
8065913: Various improvements in SetupNativeCompilation
ihse
parents:
27586
diff
changeset
|
298 |
RC_FLAGS="-nologo -l0x409" |
37402 | 299 |
JVM_RCFLAGS="-nologo" |
35747 | 300 |
if test "x$DEBUG_LEVEL" = xrelease; then |
27593
4703225f5be4
8065913: Various improvements in SetupNativeCompilation
ihse
parents:
27586
diff
changeset
|
301 |
RC_FLAGS="$RC_FLAGS -DNDEBUG" |
37402 | 302 |
JVM_RCFLAGS="$JVM_RCFLAGS -DNDEBUG" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
303 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
304 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
305 |
# The version variables used to create RC_FLAGS may be overridden |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
306 |
# in a custom configure script, or possibly the command line. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
307 |
# Let those variables be expanded at make time in spec.gmk. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
308 |
# The \$ are escaped to the shell, and the $(...) variables |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
309 |
# are evaluated by make. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
310 |
RC_FLAGS="$RC_FLAGS \ |
33926
3a19edba4808
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30740
diff
changeset
|
311 |
-D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \ |
27593
4703225f5be4
8065913: Various improvements in SetupNativeCompilation
ihse
parents:
27586
diff
changeset
|
312 |
-D\"JDK_COMPANY=\$(COMPANY_NAME)\" \ |
4703225f5be4
8065913: Various improvements in SetupNativeCompilation
ihse
parents:
27586
diff
changeset
|
313 |
-D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ |
33941
c112bac36e88
8135083: Product version string for DLLs and EXEs should not include trailing zeros
dtitov
parents:
33927
diff
changeset
|
314 |
-D\"JDK_VER=\$(VERSION_NUMBER)\" \ |
27593
4703225f5be4
8065913: Various improvements in SetupNativeCompilation
ihse
parents:
27586
diff
changeset
|
315 |
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ |
33926
3a19edba4808
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30740
diff
changeset
|
316 |
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_MAJOR)\" \ |
3a19edba4808
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30740
diff
changeset
|
317 |
-D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\"" |
37402 | 318 |
|
319 |
JVM_RCFLAGS="$JVM_RCFLAGS \ |
|
320 |
-D\"HS_BUILD_ID=\$(VERSION_STRING)\" \ |
|
321 |
-D\"HS_COMPANY=\$(COMPANY_NAME)\" \ |
|
322 |
-D\"JDK_DOTVER=\$(VERSION_NUMBER_FOUR_POSITIONS)\" \ |
|
323 |
-D\"HS_COPYRIGHT=Copyright $COPYRIGHT_YEAR\" \ |
|
324 |
-D\"HS_NAME=\$(PRODUCT_NAME) \$(VERSION_SHORT)\" \ |
|
325 |
-D\"JDK_VER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\" \ |
|
326 |
-D\"HS_FNAME=jvm.dll\" \ |
|
327 |
-D\"HS_INTERNAL_NAME=jvm\"" |
|
20363 | 328 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
329 |
AC_SUBST(RC_FLAGS) |
37402 | 330 |
AC_SUBST(JVM_RCFLAGS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
331 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
332 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
333 |
# silence copyright notice and other headers. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
334 |
COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" |
20363 | 335 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
336 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
337 |
|
37402 | 338 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
339 |
[ |
20363 | 340 |
############################################################################### |
341 |
# |
|
342 |
# How to compile shared libraries. |
|
343 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
344 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
345 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
346 |
PICFLAG="-fPIC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
347 |
C_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
348 |
CXX_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
349 |
|
14111 | 350 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
351 |
# Linking is different on MacOSX |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
352 |
if test "x$STATIC_BUILD" = xtrue; then |
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
353 |
SHARED_LIBRARY_FLAGS ='-undefined dynamic_lookup' |
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
354 |
else |
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
355 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" |
37402 | 356 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
357 |
fi |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
358 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
359 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
360 |
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' |
35747 | 361 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
362 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
363 |
# Default works for linux, might work on other platforms as well. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
364 |
SHARED_LIBRARY_FLAGS='-shared' |
41875 | 365 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
366 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
367 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
368 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
369 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
370 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
371 |
C_FLAG_REORDER='' |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
372 |
CXX_FLAG_REORDER='' |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
373 |
|
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
374 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
375 |
# Linking is different on MacOSX |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
376 |
PICFLAG='' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
377 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
378 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
379 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
380 |
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' |
35747 | 381 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' |
37402 | 382 |
|
383 |
if test "x$STATIC_BUILD" = xfalse; then |
|
384 |
JVM_CFLAGS="$JVM_CFLAGS -fPIC" |
|
385 |
fi |
|
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
386 |
else |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
387 |
# Default works for linux, might work on other platforms as well. |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
388 |
PICFLAG='-fPIC' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
389 |
SHARED_LIBRARY_FLAGS='-shared' |
41875 | 390 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
391 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
392 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
42538 | 393 |
|
394 |
# arm specific settings |
|
395 |
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then |
|
396 |
# '-Wl,-z,origin' isn't used on arm. |
|
397 |
SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1' |
|
398 |
else |
|
399 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
|
400 |
fi |
|
401 |
||
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
402 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
403 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
42141 | 404 |
if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
405 |
PICFLAG="-xcode=pic32" |
|
406 |
else |
|
407 |
PICFLAG="-KPIC" |
|
408 |
fi |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
409 |
C_FLAG_REORDER='-xF' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
410 |
CXX_FLAG_REORDER='-xF' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
411 |
SHARED_LIBRARY_FLAGS="-G" |
41875 | 412 |
SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
413 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
414 |
SET_SHARED_LIBRARY_NAME='-h [$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
415 |
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
416 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
36051 | 417 |
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only |
418 |
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker |
|
419 |
# will have to patch this single instruction with a call to some out-of-order code which |
|
420 |
# does the load from the TOC. This is of course slow. But in that case we also would have |
|
421 |
# to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. |
|
422 |
# With 'qpic=large' the compiler will by default generate a two-instruction sequence which |
|
423 |
# can be patched directly by the linker and does not require a jump to out-of-order code. |
|
424 |
# Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' |
|
425 |
# instead. This creates a distinct TOC for every compilation unit (and thus requires two |
|
426 |
# loads for accessing a global variable). But there are rumors that this may be seen as a |
|
427 |
# 'performance feature' because of improved code locality of the symbols used in a |
|
428 |
# compilation unit. |
|
429 |
PICFLAG="-qpic" |
|
430 |
JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
431 |
C_FLAG_REORDER='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
432 |
CXX_FLAG_REORDER='' |
36051 | 433 |
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
434 |
SET_EXECUTABLE_ORIGIN="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
435 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
436 |
SET_SHARED_LIBRARY_NAME='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
437 |
SET_SHARED_LIBRARY_MAPFILE='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
438 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
439 |
PICFLAG="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
440 |
C_FLAG_REORDER='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
441 |
CXX_FLAG_REORDER='' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
442 |
SHARED_LIBRARY_FLAGS="-dll" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
443 |
SET_EXECUTABLE_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
444 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
445 |
SET_SHARED_LIBRARY_NAME='' |
35747 | 446 |
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1' |
20363 | 447 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
448 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
449 |
AC_SUBST(C_FLAG_REORDER) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
450 |
AC_SUBST(CXX_FLAG_REORDER) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
451 |
AC_SUBST(SET_EXECUTABLE_ORIGIN) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
452 |
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) |
20363 | 453 |
AC_SUBST(SET_SHARED_LIBRARY_NAME) |
454 |
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
455 |
AC_SUBST(SHARED_LIBRARY_FLAGS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
456 |
|
20363 | 457 |
# The (cross) compiler is now configured, we can now test capabilities |
458 |
# of the target platform. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
459 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
460 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
461 |
# 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
|
462 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
463 |
# 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
|
464 |
# 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
|
465 |
# 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
|
466 |
# |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
467 |
# -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
|
468 |
# -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
|
469 |
# -fsingle: Use single precision floating point with 'float' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
470 |
# -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
|
471 |
# (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
|
472 |
# pointer types are not recommended) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
473 |
# -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
|
474 |
# (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
|
475 |
# -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
|
476 |
# -xrestrict: Pointer parameters to functions do not overlap |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
477 |
# (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
|
478 |
# 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
|
479 |
# -xlibmil: Inline some library routines |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
480 |
# (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
|
481 |
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
482 |
# (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
|
483 |
# 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
|
484 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
485 |
# FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
486 |
# Bug? |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
487 |
#if test "x$OPENJDK_TARGET_CPU" = xsparc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
488 |
# CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
489 |
# CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
490 |
#fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
491 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
492 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
493 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
494 |
|
20363 | 495 |
############################################################################### |
496 |
# |
|
497 |
# Setup the opt flags for different compilers |
|
498 |
# and different operating systems. |
|
499 |
# |
|
13697 | 500 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
501 |
# FIXME: this was indirectly the old default, but just inherited. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
502 |
# if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
503 |
# C_FLAG_DEPS="-MMD -MF" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
504 |
# fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
505 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
506 |
# Generate make dependency files |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
507 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
508 |
C_FLAG_DEPS="-MMD -MF" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
509 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
510 |
C_FLAG_DEPS="-MMD -MF" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
511 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
512 |
C_FLAG_DEPS="-xMMD -xMF" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
513 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
514 |
C_FLAG_DEPS="-qmakedep=gcc -MF" |
20363 | 515 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
516 |
CXX_FLAG_DEPS="$C_FLAG_DEPS" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
517 |
AC_SUBST(C_FLAG_DEPS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
518 |
AC_SUBST(CXX_FLAG_DEPS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
519 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
520 |
# Debug symbols |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
521 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
522 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
523 |
# reduce from default "-g2" option to save space |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
524 |
CFLAGS_DEBUG_SYMBOLS="-g1" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
525 |
CXXFLAGS_DEBUG_SYMBOLS="-g1" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
526 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
527 |
CFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
528 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
529 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
530 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
531 |
CFLAGS_DEBUG_SYMBOLS="-g" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
532 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
533 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
534 |
CFLAGS_DEBUG_SYMBOLS="-g -xs" |
35032 | 535 |
# -g0 enables debug symbols without disabling inlining. |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
536 |
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
537 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
538 |
CFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
539 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
36531
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
540 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
541 |
CFLAGS_DEBUG_SYMBOLS="-Zi" |
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
542 |
CXXFLAGS_DEBUG_SYMBOLS="-Zi" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
543 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
544 |
AC_SUBST(CFLAGS_DEBUG_SYMBOLS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
545 |
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
546 |
|
37402 | 547 |
# Debug symbols for JVM_CFLAGS |
548 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
549 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs" |
|
550 |
if test "x$DEBUG_LEVEL" = xslowdebug; then |
|
551 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
552 |
else |
|
553 |
# -g0 does not disable inlining, which -g does. |
|
554 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0" |
|
555 |
fi |
|
556 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
557 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+" |
|
558 |
else |
|
559 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" |
|
560 |
fi |
|
561 |
AC_SUBST(JVM_CFLAGS_SYMBOLS) |
|
562 |
||
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
563 |
# bounds, memory and behavior checking options |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
564 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
565 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
566 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
567 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
568 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
569 |
fastdebug ) |
26123
44827e1a7a7b
8047952: Remove FORTIFY_SOURCE from fastdebug and slowdebug builds
mduigou
parents:
25459
diff
changeset
|
570 |
# no adjustment |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
571 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
572 |
slowdebug ) |
37402 | 573 |
# FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it |
35747 | 574 |
# get's added conditionally on whether we produce debug symbols or not. |
575 |
# This is most likely not really correct. |
|
576 |
||
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
577 |
# Add runtime stack smashing and undefined behavior checks. |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
578 |
# Not all versions of gcc support -fstack-protector |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
579 |
STACK_PROTECTOR_CFLAG="-fstack-protector-all" |
35451
d0b71f2375d0
8129395: Configure should verify that -fstack-protector is valid - take 2
ihse
parents:
35450
diff
changeset
|
580 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) |
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
581 |
|
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
582 |
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
583 |
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
37402 | 584 |
if test "x$STACK_PROTECTOR_CFLAG" != x; then |
585 |
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
|
586 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
587 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
588 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
589 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
590 |
|
37402 | 591 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
592 |
if test "x$DEBUG_LEVEL" != xrelease; then |
|
593 |
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
|
594 |
JVM_CFLAGS="$JVM_CFLAGS -homeparams" |
|
595 |
fi |
|
596 |
fi |
|
597 |
fi |
|
598 |
||
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
599 |
# Optimization levels |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
600 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
601 |
CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
602 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
603 |
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
604 |
# FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global? |
37402 | 605 |
C_O_FLAG_HIGHEST_JVM="-xO4" |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
606 |
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
607 |
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
608 |
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
609 |
C_O_FLAG_DEBUG="-xregs=no%frameptr" |
37402 | 610 |
C_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
611 |
C_O_FLAG_NONE="-xregs=no%frameptr" |
37402 | 612 |
CXX_O_FLAG_HIGHEST_JVM="-xO4" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
613 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
614 |
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
615 |
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
616 |
CXX_O_FLAG_DEBUG="-xregs=no%frameptr" |
37402 | 617 |
CXX_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
618 |
CXX_O_FLAG_NONE="-xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
619 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
620 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
621 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
622 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
623 |
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
37402 | 624 |
C_O_FLAG_HIGHEST_JVM="-xO4" |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
625 |
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
626 |
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
627 |
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
628 |
C_O_FLAG_DEBUG="" |
37402 | 629 |
C_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
630 |
C_O_FLAG_NONE="" |
37402 | 631 |
CXX_O_FLAG_HIGHEST_JVM="-xO4" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
632 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
633 |
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
634 |
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
35747 | 635 |
CXX_O_FLAG_DEBUG="" |
37402 | 636 |
CXX_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
637 |
CXX_O_FLAG_NONE="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
638 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
639 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
640 |
# The remaining toolchains share opt flags between CC and CXX; |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
641 |
# setup for C and duplicate afterwards. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
642 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
643 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
644 |
# On MacOSX we optimize for size, something |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
645 |
# we should do for all platforms? |
37402 | 646 |
C_O_FLAG_HIGHEST_JVM="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
647 |
C_O_FLAG_HIGHEST="-Os" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
648 |
C_O_FLAG_HI="-Os" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
649 |
C_O_FLAG_NORM="-Os" |
37402 | 650 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
651 |
else |
37402 | 652 |
C_O_FLAG_HIGHEST_JVM="-O3" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
653 |
C_O_FLAG_HIGHEST="-O3" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
654 |
C_O_FLAG_HI="-O3" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
655 |
C_O_FLAG_NORM="-O2" |
37402 | 656 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
657 |
fi |
25459 | 658 |
C_O_FLAG_DEBUG="-O0" |
37402 | 659 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
660 |
C_O_FLAG_DEBUG_JVM="" |
|
661 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
662 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
663 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
664 |
C_O_FLAG_NONE="-O0" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
665 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
666 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
667 |
# On MacOSX we optimize for size, something |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
668 |
# we should do for all platforms? |
37402 | 669 |
C_O_FLAG_HIGHEST_JVM="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
670 |
C_O_FLAG_HIGHEST="-Os" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
671 |
C_O_FLAG_HI="-Os" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
672 |
C_O_FLAG_NORM="-Os" |
37402 | 673 |
C_O_FLAG_SIZE="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
674 |
else |
37402 | 675 |
C_O_FLAG_HIGHEST_JVM="-O3" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
676 |
C_O_FLAG_HIGHEST="-O3" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
677 |
C_O_FLAG_HI="-O3" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
678 |
C_O_FLAG_NORM="-O2" |
37402 | 679 |
C_O_FLAG_SIZE="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
680 |
fi |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
681 |
C_O_FLAG_DEBUG="-O0" |
37402 | 682 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
683 |
C_O_FLAG_DEBUG_JVM="" |
|
684 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
685 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
686 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
687 |
C_O_FLAG_NONE="-O0" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
688 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
39191 | 689 |
C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue" |
690 |
C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue" |
|
691 |
C_O_FLAG_HI="-O3 -qinline -qinlglue" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
692 |
C_O_FLAG_NORM="-O2" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
693 |
C_O_FLAG_DEBUG="-qnoopt" |
37402 | 694 |
# FIXME: Value below not verified. |
695 |
C_O_FLAG_DEBUG_JVM="" |
|
35020
8a7f717c3bc2
8145427: [aix] xlc: wrong flag used to switch off optimization
stuefe
parents:
34120
diff
changeset
|
696 |
C_O_FLAG_NONE="-qnoopt" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
697 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
37402 | 698 |
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-" |
20363 | 699 |
C_O_FLAG_HIGHEST="-O2" |
700 |
C_O_FLAG_HI="-O1" |
|
701 |
C_O_FLAG_NORM="-O1" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
702 |
C_O_FLAG_DEBUG="-Od" |
37402 | 703 |
C_O_FLAG_DEBUG_JVM="" |
20363 | 704 |
C_O_FLAG_NONE="-Od" |
37402 | 705 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
706 |
fi |
37402 | 707 |
CXX_O_FLAG_HIGHEST_JVM="$C_O_FLAG_HIGHEST_JVM" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
708 |
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
709 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
710 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
711 |
CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG" |
37402 | 712 |
CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
713 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
37402 | 714 |
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE" |
20363 | 715 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
716 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
717 |
# Adjust optimization flags according to debug level. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
718 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
719 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
720 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
721 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
722 |
fastdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
723 |
# Not quite so much optimization |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
724 |
C_O_FLAG_HI="$C_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
725 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
726 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
727 |
slowdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
728 |
# Disable optimization |
37402 | 729 |
C_O_FLAG_HIGHEST_JVM="$C_O_FLAG_DEBUG_JVM" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
730 |
C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
731 |
C_O_FLAG_HI="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
732 |
C_O_FLAG_NORM="$C_O_FLAG_DEBUG" |
37402 | 733 |
C_O_FLAG_SIZE="$C_O_FLAG_DEBUG" |
734 |
CXX_O_FLAG_HIGHEST_JVM="$CXX_O_FLAG_DEBUG_JVM" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
735 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
736 |
CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
737 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG" |
37402 | 738 |
CXX_O_FLAG_SIZE="$CXX_O_FLAG_DEBUG" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
739 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
740 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
741 |
|
37402 | 742 |
AC_SUBST(C_O_FLAG_HIGHEST_JVM) |
20363 | 743 |
AC_SUBST(C_O_FLAG_HIGHEST) |
744 |
AC_SUBST(C_O_FLAG_HI) |
|
745 |
AC_SUBST(C_O_FLAG_NORM) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
746 |
AC_SUBST(C_O_FLAG_DEBUG) |
20363 | 747 |
AC_SUBST(C_O_FLAG_NONE) |
37402 | 748 |
AC_SUBST(C_O_FLAG_SIZE) |
749 |
AC_SUBST(CXX_O_FLAG_HIGHEST_JVM) |
|
20363 | 750 |
AC_SUBST(CXX_O_FLAG_HIGHEST) |
751 |
AC_SUBST(CXX_O_FLAG_HI) |
|
752 |
AC_SUBST(CXX_O_FLAG_NORM) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
753 |
AC_SUBST(CXX_O_FLAG_DEBUG) |
20363 | 754 |
AC_SUBST(CXX_O_FLAG_NONE) |
37402 | 755 |
AC_SUBST(CXX_O_FLAG_SIZE) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
756 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
757 |
|
37402 | 758 |
|
759 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], |
|
760 |
[ |
|
761 |
||
42538 | 762 |
FLAGS_SETUP_ABI_PROFILE |
37402 | 763 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET]) |
764 |
FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_]) |
|
765 |
||
766 |
# Tests are only ever compiled for TARGET |
|
767 |
# Flags for compiling test libraries |
|
768 |
CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" |
|
769 |
CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA" |
|
770 |
||
771 |
# Flags for compiling test executables |
|
772 |
CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" |
|
773 |
CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" |
|
774 |
||
775 |
AC_SUBST(CFLAGS_TESTLIB) |
|
776 |
AC_SUBST(CFLAGS_TESTEXE) |
|
777 |
AC_SUBST(CXXFLAGS_TESTLIB) |
|
778 |
AC_SUBST(CXXFLAGS_TESTEXE) |
|
779 |
||
780 |
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" |
|
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
781 |
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS" |
37402 | 782 |
|
783 |
AC_SUBST(LDFLAGS_TESTLIB) |
|
784 |
AC_SUBST(LDFLAGS_TESTEXE) |
|
785 |
||
786 |
]) |
|
787 |
||
788 |
################################################################################ |
|
789 |
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check |
|
790 |
# conditionals against. |
|
791 |
# $2 - Optional prefix for each variable defined. |
|
792 |
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
793 |
[ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
794 |
# Special extras... |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
795 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
37402 | 796 |
if test "x$OPENJDK_$1_CPU_ARCH" = "xsparc"; then |
797 |
$2CFLAGS_JDKLIB_EXTRA="${$2CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
|
798 |
$2CXXFLAGS_JDKLIB_EXTRA="${$2CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
799 |
fi |
37402 | 800 |
$2CFLAGS_JDKLIB_EXTRA="${$2CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" |
801 |
$2CXXFLAGS_JDKLIB_EXTRA="${$2CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
802 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
37402 | 803 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" |
804 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" |
|
805 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
806 |
$2CXXSTD_CXXFLAG="-std=gnu++98" |
|
807 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror], |
|
808 |
IF_FALSE: [$2CXXSTD_CXXFLAG=""]) |
|
809 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}" |
|
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
810 |
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}" |
37402 | 811 |
AC_SUBST([$2CXXSTD_CXXFLAG]) |
812 |
fi |
|
813 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
|
814 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__" |
|
815 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
816 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
817 |
|
37402 | 818 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}" |
819 |
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2EXTRA_CXXFLAGS}" |
|
820 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$2EXTRA_LDFLAGS}" |
|
13697 | 821 |
|
20363 | 822 |
############################################################################### |
823 |
# |
|
824 |
# Now setup the CFLAGS and LDFLAGS for the JDK build. |
|
825 |
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. |
|
826 |
# |
|
827 |
||
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
828 |
# Setup compiler/platform specific flags into |
37402 | 829 |
# $2CFLAGS_JDK - C Compiler flags |
830 |
# $2CXXFLAGS_JDK - C++ Compiler flags |
|
831 |
# $2COMMON_CCXXFLAGS_JDK - common to C and C++ |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
832 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
37402 | 833 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE" |
834 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT" |
|
835 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new" |
|
836 |
if test "x$OPENJDK_$1_CPU" = xx86; then |
|
30418
aa3cd6848aa0
8039426: gcc can target wrong instruction set when building JDK native code
erikj
parents:
30415
diff
changeset
|
837 |
# Force compatibility with i586 on 32 bit intel platforms. |
37402 | 838 |
$2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586" |
839 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586" |
|
30418
aa3cd6848aa0
8039426: gcc can target wrong instruction set when building JDK native code
erikj
parents:
30415
diff
changeset
|
840 |
fi |
37402 | 841 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
842 |
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
37402 | 843 |
case $OPENJDK_$1_CPU_ARCH in |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
844 |
arm ) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
845 |
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing |
37402 | 846 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
42538 | 847 |
$2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
848 |
;; |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
849 |
ppc ) |
23981 | 850 |
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing |
37402 | 851 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
852 |
;; |
41646
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
853 |
s390 ) |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
854 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10" |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
855 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
856 |
;; |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
857 |
* ) |
37402 | 858 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
859 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
860 |
;; |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
861 |
esac |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
862 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2)) |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
863 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
37402 | 864 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE" |
865 |
||
866 |
# Restrict the debug information created by Clang to avoid |
|
867 |
# too big object files and speed the build up a little bit |
|
868 |
# (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
|
869 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -flimit-debug-info" |
|
870 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
871 |
if test "x$OPENJDK_$1_CPU" = xx86; then |
|
35444 | 872 |
# Force compatibility with i586 on 32 bit intel platforms. |
37402 | 873 |
$2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586" |
874 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586" |
|
35444 | 875 |
fi |
37402 | 876 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-sometimes-uninitialized" |
877 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ |
|
35444 | 878 |
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
37402 | 879 |
case $OPENJDK_$1_CPU_ARCH in |
35444 | 880 |
ppc ) |
881 |
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing |
|
37402 | 882 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
35444 | 883 |
;; |
884 |
* ) |
|
37402 | 885 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" |
886 |
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" |
|
35444 | 887 |
;; |
888 |
esac |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
889 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
890 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
37402 | 891 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSPARC_WORKS" |
892 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
|
893 |
if test "x$OPENJDK_$1_CPU_ARCH" = xx86; then |
|
894 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_$1_CPU_LEGACY_LIB" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
895 |
fi |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
896 |
|
37402 | 897 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" |
898 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
899 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
37402 | 900 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT -D__STDC_FORMAT_MACROS" |
901 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" |
|
902 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
903 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
37402 | 904 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \ |
36531
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
905 |
-MD -Zc:wchar_t- -W3 -wd4800 \ |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
906 |
-DWIN32_LEAN_AND_MEAN \ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
907 |
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ |
30740
754229ce9d68
8080983: libdt_socket: Build failed with VS2013 SP4
erikj
parents:
30418
diff
changeset
|
908 |
-D_WINSOCK_DEPRECATED_NO_WARNINGS \ |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
909 |
-DWIN32 -DIAL" |
37402 | 910 |
if test "x$OPENJDK_$1_CPU" = xx86_64; then |
911 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
912 |
else |
37402 | 913 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
914 |
fi |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
915 |
# If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
916 |
# avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
917 |
# studio. |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
918 |
if test "x$TOOLCHAIN_VERSION" = "x2010"; then |
35747 | 919 |
STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB" |
37402 | 920 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS" |
921 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS $STATIC_CPPLIB_FLAGS" |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27602
diff
changeset
|
922 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
923 |
fi |
20363 | 924 |
|
925 |
############################################################################### |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
926 |
|
20363 | 927 |
# Adjust flags according to debug level. |
928 |
case $DEBUG_LEVEL in |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
929 |
fastdebug | slowdebug ) |
37402 | 930 |
$2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" |
931 |
$2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS" |
|
20363 | 932 |
;; |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
933 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
934 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
935 |
* ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
936 |
AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL]) |
20363 | 937 |
;; |
938 |
esac |
|
18020
eade0d9836bf
8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents:
17664
diff
changeset
|
939 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
940 |
# Set some common defines. These works for all compilers, but assume |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
941 |
# -D is universally accepted. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
942 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
943 |
# Setup endianness |
37402 | 944 |
if test "x$OPENJDK_$1_CPU_ENDIAN" = xlittle; then |
13697 | 945 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
946 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
947 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
948 |
# Note: -Dmacro is the same as #define macro 1 |
|
20363 | 949 |
# -Dmacro= is the same as #define macro |
37402 | 950 |
if test "x$OPENJDK_$1_OS" = xsolaris; then |
951 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" |
|
13697 | 952 |
else |
37402 | 953 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" |
13697 | 954 |
fi |
20363 | 955 |
else |
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23423
diff
changeset
|
956 |
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23423
diff
changeset
|
957 |
# are defined in the system? |
37402 | 958 |
if test "x$OPENJDK_$1_OS" = xsolaris; then |
959 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN=" |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23423
diff
changeset
|
960 |
else |
37402 | 961 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" |
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23423
diff
changeset
|
962 |
fi |
20363 | 963 |
fi |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
964 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
965 |
# Setup target OS define. Use OS target name but in upper case. |
37402 | 966 |
OPENJDK_$1_OS_UPPERCASE=`$ECHO $OPENJDK_$1_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` |
967 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D$OPENJDK_$1_OS_UPPERCASE" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
968 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
969 |
# Setup target CPU |
37402 | 970 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
971 |
$OPENJDK_$1_ADD_LP64 \ |
|
972 |
-DARCH='\"$OPENJDK_$1_CPU_LEGACY\"' -D$OPENJDK_$1_CPU_LEGACY" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
973 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
974 |
# Setup debug/release defines |
20363 | 975 |
if test "x$DEBUG_LEVEL" = xrelease; then |
37402 | 976 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DNDEBUG" |
977 |
if test "x$OPENJDK_$1_OS" = xsolaris; then |
|
978 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DTRIMMED" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
979 |
fi |
20363 | 980 |
else |
37402 | 981 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DDEBUG" |
20363 | 982 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
983 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
984 |
# Set some additional per-OS defines. |
37402 | 985 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
986 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DLINUX" |
|
42141 | 987 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \ |
37402 | 988 |
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" |
989 |
elif test "x$OPENJDK_$1_OS" = xsolaris; then |
|
990 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSOLARIS" |
|
991 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -template=no%extdef -features=no%split_init \ |
|
42141 | 992 |
-D_Crun_inline_placement -library=%none $PICFLAG -mt -features=no%except" |
37402 | 993 |
elif test "x$OPENJDK_$1_OS" = xmacosx; then |
994 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" |
|
995 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_ALLBSD_SOURCE" |
|
996 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" |
|
997 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \ |
|
998 |
-mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \ |
|
999 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=1070 -mmacosx-version-min=10.7.0 \ |
|
1000 |
-fno-omit-frame-pointer" |
|
1001 |
elif test "x$OPENJDK_$1_OS" = xaix; then |
|
1002 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DAIX" |
|
1003 |
# We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. |
|
39191 | 1004 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \ |
1005 |
-qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ |
|
37402 | 1006 |
-qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" |
1007 |
elif test "x$OPENJDK_$1_OS" = xbsd; then |
|
1008 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" |
|
1009 |
elif test "x$OPENJDK_$1_OS" = xwindows; then |
|
1010 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" |
|
1011 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -nologo -W3 -MD -MP" |
|
1012 |
fi |
|
1013 |
||
1014 |
# Set some additional per-CPU defines. |
|
1015 |
if test "x$OPENJDK_$1_OS-$OPENJDK_$1_CPU" = xwindows-x86; then |
|
1016 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -arch:IA32" |
|
1017 |
elif test "x$OPENJDK_$1_CPU" = xsparcv9; then |
|
1018 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -xarch=sparc" |
|
1019 |
elif test "x$OPENJDK_$1_CPU" = xppc64; then |
|
1020 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
1021 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" |
|
37404
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1022 |
# fixes `relocation truncated to fit' error for gcc 4.1. |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1023 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mminimal-toc" |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1024 |
# Use ppc64 instructions, but schedule for power5 |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1025 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=powerpc64 -mtune=power5" |
37402 | 1026 |
elif test "x$OPENJDK_$1_OS" = xaix; then |
1027 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -qarch=ppc64" |
|
37404
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1028 |
fi |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1029 |
elif test "x$OPENJDK_$1_CPU" = xppc64le; then |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1030 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1031 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1032 |
# Little endian machine uses ELFv2 ABI. |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1033 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DABI_ELFv2" |
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1034 |
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. |
41948
fd44a71c1be4
8169630: Fix wrong cpu build flag for Linux/ppc64le build
simonis
parents:
41875
diff
changeset
|
1035 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=power8 -mtune=power8" |
37404
1ab1c5c6cd5a
8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents:
37402
diff
changeset
|
1036 |
fi |
41646
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
1037 |
elif test "x$OPENJDK_$1_CPU" = xs390x; then |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
1038 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
1039 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -mbackchain -march=z10" |
0342650c5a78
8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents:
41040
diff
changeset
|
1040 |
fi |
37402 | 1041 |
fi |
1042 |
||
1043 |
if test "x$OPENJDK_$1_CPU_ENDIAN" = xlittle; then |
|
1044 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DVM_LITTLE_ENDIAN" |
|
1045 |
fi |
|
1046 |
||
1047 |
if test "x$OPENJDK_$1_CPU_BITS" = x64; then |
|
1048 |
if test "x$OPENJDK_$1_OS" != xsolaris && test "x$OPENJDK_$1_OS" != xaix; then |
|
1049 |
# Solaris does not have _LP64=1 in the old build. |
|
1050 |
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. |
|
1051 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_LP64=1" |
|
1052 |
fi |
|
1053 |
fi |
|
1054 |
||
1055 |
# Set $2JVM_CFLAGS warning handling |
|
1056 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
1057 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wpointer-arith -Wsign-compare -Wunused-function \ |
|
1058 |
-Wunused-value -Woverloaded-virtual" |
|
1059 |
||
1060 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1061 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2, |
37402 | 1062 |
IF_AT_LEAST: [ |
1063 |
# These flags either do not work or give spurious warnings prior to gcc 4.8. |
|
1064 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized" |
|
1065 |
] |
|
1066 |
) |
|
1067 |
fi |
|
1068 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero) && ! HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then |
|
1069 |
# Non-zero builds have stricter warnings |
|
1070 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wreturn-type -Wundef -Wformat=2" |
|
1071 |
else |
|
1072 |
if test "x$TOOLCHAIN_TYPE" = xclang; then |
|
1073 |
# Some versions of llvm do not like -Wundef |
|
1074 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-undef" |
|
1075 |
fi |
|
1076 |
fi |
|
1077 |
elif test "x$OPENJDK_$1_OS" = xmacosx; then |
|
1078 |
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-deprecated -Wpointer-arith \ |
|
1079 |
-Wsign-compare -Wundef -Wunused-function -Wformat=2" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1080 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1081 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1082 |
# Additional macosx handling |
37402 | 1083 |
if test "x$OPENJDK_$1_OS" = xmacosx; then |
25034
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1084 |
# Setting these parameters makes it an error to link to macosx APIs that are |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1085 |
# newer than the given OS version and makes the linked binaries compatible |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1086 |
# even if built on a newer version of the OS. |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1087 |
# The expected format is X.Y.Z |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1088 |
MACOSX_VERSION_MIN=10.7.0 |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1089 |
AC_SUBST(MACOSX_VERSION_MIN) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1090 |
|
25034
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1091 |
# The macro takes the version with no dots, ex: 1070 |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1092 |
# Let the flags variables get resolved in make for easier override on make |
d9ca34c227b8
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
24911
diff
changeset
|
1093 |
# command line. |
37402 | 1094 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
1095 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1096 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1097 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1098 |
# Setup some hard coded includes |
37402 | 1099 |
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ |
41662
97e8b9b653f9
8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents:
41650
diff
changeset
|
1100 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
25854 | 1101 |
-I${JDK_TOPDIR}/src/java.base/share/native/include \ |
37402 | 1102 |
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_$1_OS/native/include \ |
1103 |
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/include \ |
|
34923 | 1104 |
-I${JDK_TOPDIR}/src/java.base/share/native/libjava \ |
37402 | 1105 |
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/libjava" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1106 |
|
20363 | 1107 |
# The shared libraries are compiled using the picflag. |
37402 | 1108 |
$2CFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
1109 |
[$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK $PICFLAG [$]$2CFLAGS_JDKLIB_EXTRA" |
|
1110 |
$2CXXFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \ |
|
1111 |
[$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK $PICFLAG [$]$2CXXFLAGS_JDKLIB_EXTRA" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1112 |
|
20363 | 1113 |
# Executable flags |
37402 | 1114 |
$2CFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK" |
1115 |
$2CXXFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1116 |
|
37402 | 1117 |
AC_SUBST($2CFLAGS_JDKLIB) |
1118 |
AC_SUBST($2CFLAGS_JDKEXE) |
|
1119 |
AC_SUBST($2CXXFLAGS_JDKLIB) |
|
1120 |
AC_SUBST($2CXXFLAGS_JDKEXE) |
|
29305
4ddc6faf7842
8073021: add native code coverage target into makefiles
erikj
parents:
29304
diff
changeset
|
1121 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1122 |
# Setup LDFLAGS et al. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1123 |
# |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1124 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1125 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
35747 | 1126 |
LDFLAGS_MICROSOFT="-nologo -opt:ref" |
37402 | 1127 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no" |
1128 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_MICROSOFT -opt:icf,8 -subsystem:windows -base:0x8000000" |
|
1129 |
if test "x$OPENJDK_$1_CPU_BITS" = "x32"; then |
|
35747 | 1130 |
LDFLAGS_SAFESH="-safeseh" |
37402 | 1131 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SAFESH" |
1132 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SAFESH" |
|
1133 |
# NOTE: Old build added -machine. Probably not needed. |
|
1134 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -machine:I386" |
|
1135 |
else |
|
1136 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -machine:AMD64" |
|
1137 |
fi |
|
1138 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
1139 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16 -stdlib=libstdc++ -fPIC" |
|
1140 |
if test "x$OPENJDK_$1_OS" = xmacosx; then |
|
1141 |
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead. |
|
1142 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1143 |
fi |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1144 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1145 |
# If this is a --hash-style=gnu system, use --hash-style=both, why? |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1146 |
# We have previously set HAS_GNU_HASH if this is the case |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1147 |
if test -n "$HAS_GNU_HASH"; then |
37402 | 1148 |
$2LDFLAGS_HASH_STYLE="-Wl,--hash-style=both" |
1149 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} [$]$2LDFLAGS_HASH_STYLE" |
|
1150 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS [$]$2LDFLAGS_HASH_STYLE" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1151 |
fi |
37402 | 1152 |
if test "x$OPENJDK_$1_OS" = xmacosx; then |
1153 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." |
|
1154 |
fi |
|
1155 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1156 |
# And since we now know that the linker is gnu, then add -z defs, to forbid |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1157 |
# undefined symbols in object files. |
35747 | 1158 |
LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs" |
37402 | 1159 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM" |
1160 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_NO_UNDEF_SYM" |
|
1161 |
LDFLAGS_NO_EXEC_STACK="-Wl,-z,noexecstack" |
|
1162 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_NO_EXEC_STACK" |
|
1163 |
if test "x$OPENJDK_$1_CPU" = xx86; then |
|
1164 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -march=i586" |
|
1165 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1166 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1167 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1168 |
# tell linker to optimize libraries. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1169 |
# Should this be supplied to the OSS linker as well? |
35747 | 1170 |
LDFLAGS_DEBUGLEVEL_release="-Wl,-O1" |
37402 | 1171 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release" |
1172 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_DEBUGLEVEL_release" |
|
1173 |
if test "x$HAS_LINKER_RELRO" = "xtrue"; then |
|
1174 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG" |
|
1175 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1176 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1177 |
slowdebug ) |
37402 | 1178 |
# Hotspot always let the linker optimize |
1179 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-O1" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1180 |
if test "x$HAS_LINKER_NOW" = "xtrue"; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1181 |
# do relocations at load |
37402 | 1182 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_NOW_FLAG" |
1183 |
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_NOW_FLAG" |
|
1184 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_NOW_FLAG" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1185 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1186 |
if test "x$HAS_LINKER_RELRO" = "xtrue"; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1187 |
# mark relocations read only |
37402 | 1188 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_RELRO_FLAG" |
1189 |
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" |
|
1190 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1191 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1192 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1193 |
fastdebug ) |
37402 | 1194 |
# Hotspot always let the linker optimize |
1195 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-O1" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1196 |
if test "x$HAS_LINKER_RELRO" = "xtrue"; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1197 |
# mark relocations read only |
37402 | 1198 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_RELRO_FLAG" |
1199 |
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" |
|
1200 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1201 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1202 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1203 |
* ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1204 |
AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1205 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1206 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1207 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1208 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
35747 | 1209 |
LDFLAGS_SOLSTUDIO="-Wl,-z,defs" |
39940
fa7ee03739d6
8161057: Solaris: deprecated/obsolete compiler flags should be removed
dcubed
parents:
39938
diff
changeset
|
1210 |
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext" |
35747 | 1211 |
LDFLAGS_CXX_SOLSTUDIO="-norunpath" |
37402 | 1212 |
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" |
1213 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" |
|
1214 |
if test "x$OPENJDK_$1_CPU_ARCH" = "xsparc"; then |
|
1215 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -xarch=sparc" |
|
1216 |
fi |
|
29451
443fdcba9598
8075515: AIX: cleanup xlc options and use -bernotok to detect missing symbols at build time
simonis
parents:
29305
diff
changeset
|
1217 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
36051 | 1218 |
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" |
37402 | 1219 |
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_XLC" |
1220 |
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_XLC" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1221 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1222 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1223 |
# Customize LDFLAGS for executables |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1224 |
|
37402 | 1225 |
$2LDFLAGS_JDKEXE="${$2LDFLAGS_JDK}" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1226 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1227 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
37402 | 1228 |
if test "x$OPENJDK_$1_CPU_BITS" = "x64"; then |
20363 | 1229 |
LDFLAGS_STACK_SIZE=1048576 |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1230 |
else |
20363 | 1231 |
LDFLAGS_STACK_SIZE=327680 |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1232 |
fi |
37402 | 1233 |
$2LDFLAGS_JDKEXE="${$2LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE" |
1234 |
elif test "x$OPENJDK_$1_OS" = xlinux; then |
|
1235 |
$2LDFLAGS_JDKEXE="[$]$2LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1236 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1237 |
|
37402 | 1238 |
$2LDFLAGS_JDKEXE="${$2LDFLAGS_JDKEXE} ${$2EXTRA_LDFLAGS_JDK}" |
36506 | 1239 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1240 |
# Customize LDFLAGS for libs |
37402 | 1241 |
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDK}" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1242 |
|
37402 | 1243 |
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1244 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
1245 |
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \ |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
1246 |
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base" |
37402 | 1247 |
$2JDKLIB_LIBS="" |
20363 | 1248 |
else |
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
1249 |
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \ |
42528
125bc97e7569
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
42510
diff
changeset
|
1250 |
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base" |
13697 | 1251 |
|
37402 | 1252 |
if test "x$1" = "xTARGET"; then |
42510
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1253 |
# On some platforms (mac) the linker warns about non existing -L dirs. |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1254 |
# For any of the variants server, client or minimal, the dir matches the |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1255 |
# variant name. The "main" variant should be used for linking. For the |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1256 |
# rest, the dir is just server. |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1257 |
if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \ |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1258 |
|| HOTSPOT_CHECK_JVM_VARIANT(minimal); then |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1259 |
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \ |
42528
125bc97e7569
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
42510
diff
changeset
|
1260 |
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN" |
42510
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1261 |
else |
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1262 |
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \ |
42528
125bc97e7569
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
42510
diff
changeset
|
1263 |
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" |
42510
406dfb60de57
8170284: Move fine granular hotspot make targets to top level
erikj
parents:
41875
diff
changeset
|
1264 |
fi |
37402 | 1265 |
elif test "x$1" = "xBUILD"; then |
1266 |
# When building a buildjdk, it's always only the server variant |
|
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
1267 |
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \ |
42528
125bc97e7569
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
42510
diff
changeset
|
1268 |
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" |
14465 | 1269 |
fi |
1270 |
||
37402 | 1271 |
$2JDKLIB_LIBS="-ljava -ljvm" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1272 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
37402 | 1273 |
$2JDKLIB_LIBS="[$]$2JDKLIB_LIBS -lc" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1274 |
fi |
36506 | 1275 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1276 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1277 |
|
39938
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
1278 |
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}" |
8d5f6d6b8a24
8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents:
39936
diff
changeset
|
1279 |
|
37402 | 1280 |
# Set $2JVM_LIBS (per os) |
1281 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
1282 |
$2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread" |
|
1283 |
elif test "x$OPENJDK_$1_OS" = xsolaris; then |
|
1284 |
# FIXME: This hard-coded path is not really proper. |
|
1285 |
if test "x$OPENJDK_$1_CPU" = xx86_64; then |
|
1286 |
$2SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1" |
|
1287 |
elif test "x$OPENJDK_$1_CPU" = xsparcv9; then |
|
1288 |
$2SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1" |
|
1289 |
fi |
|
1290 |
$2JVM_LIBS="[$]$2JVM_LIBS -lsocket -lsched -ldl $SOLARIS_LIBM_LIBS -lCrun \ |
|
1291 |
-lthread -ldoor -lc -ldemangle -lnsl -lkstat -lrt" |
|
1292 |
elif test "x$OPENJDK_$1_OS" = xmacosx; then |
|
1293 |
$2JVM_LIBS="[$]$2JVM_LIBS -lm" |
|
1294 |
elif test "x$OPENJDK_$1_OS" = xaix; then |
|
1295 |
$2JVM_LIBS="[$]$2JVM_LIBS -Wl,-lC_r -lm -ldl -lpthread" |
|
1296 |
elif test "x$OPENJDK_$1_OS" = xbsd; then |
|
1297 |
$2JVM_LIBS="[$]$2JVM_LIBS -lm" |
|
1298 |
elif test "x$OPENJDK_$1_OS" = xwindows; then |
|
1299 |
$2JVM_LIBS="[$]$2JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \ |
|
1300 |
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \ |
|
1301 |
wsock32.lib winmm.lib version.lib psapi.lib" |
|
1302 |
fi |
|
36506 | 1303 |
|
37402 | 1304 |
# Set $2JVM_ASFLAGS |
1305 |
if test "x$OPENJDK_$1_OS" = xlinux; then |
|
1306 |
if test "x$OPENJDK_$1_CPU" = xx86; then |
|
1307 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586" |
|
1308 |
fi |
|
1309 |
elif test "x$OPENJDK_$1_OS" = xmacosx; then |
|
1310 |
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
|
1311 |
fi |
|
1312 |
||
1313 |
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2EXTRA_LDFLAGS_JDK}" |
|
29305
4ddc6faf7842
8073021: add native code coverage target into makefiles
erikj
parents:
29304
diff
changeset
|
1314 |
|
37402 | 1315 |
AC_SUBST($2LDFLAGS_JDKLIB) |
1316 |
AC_SUBST($2LDFLAGS_JDKEXE) |
|
1317 |
AC_SUBST($2JDKLIB_LIBS) |
|
1318 |
AC_SUBST($2JDKEXE_LIBS) |
|
1319 |
AC_SUBST($2LDFLAGS_CXX_JDK) |
|
1320 |
AC_SUBST($2LDFLAGS_HASH_STYLE) |
|
29305
4ddc6faf7842
8073021: add native code coverage target into makefiles
erikj
parents:
29304
diff
changeset
|
1321 |
|
37402 | 1322 |
AC_SUBST($2JVM_CFLAGS) |
1323 |
AC_SUBST($2JVM_LDFLAGS) |
|
1324 |
AC_SUBST($2JVM_ASFLAGS) |
|
1325 |
AC_SUBST($2JVM_LIBS) |
|
1326 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1327 |
]) |
16987 | 1328 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1329 |
# 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
|
1330 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 1331 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1332 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1333 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
34923 | 1334 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
16987 | 1335 |
[ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1336 |
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) |
16987 | 1337 |
supports=yes |
1338 |
||
1339 |
saved_cflags="$CFLAGS" |
|
34923 | 1340 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
16987 | 1341 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1342 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 1343 |
[supports=no]) |
16987 | 1344 |
AC_LANG_POP([C]) |
1345 |
CFLAGS="$saved_cflags" |
|
1346 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1347 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1348 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1349 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1350 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1351 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1352 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1353 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1354 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1355 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1356 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1357 |
# 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
|
1358 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1359 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1360 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1361 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1362 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1363 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1364 |
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
|
1365 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1366 |
|
16987 | 1367 |
saved_cxxflags="$CXXFLAGS" |
34923 | 1368 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
16987 | 1369 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1370 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 1371 |
[supports=no]) |
16987 | 1372 |
AC_LANG_POP([C++]) |
1373 |
CXXFLAGS="$saved_cxxflags" |
|
1374 |
||
1375 |
AC_MSG_RESULT([$supports]) |
|
1376 |
if test "x$supports" = "xyes" ; then |
|
34923 | 1377 |
: |
1378 |
ARG_IF_TRUE |
|
16987 | 1379 |
else |
34923 | 1380 |
: |
1381 |
ARG_IF_FALSE |
|
16987 | 1382 |
fi |
1383 |
]) |
|
1384 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1385 |
# 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
|
1386 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1387 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1388 |
# 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
|
1389 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1390 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1391 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1392 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1393 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1394 |
IF_FALSE: [C_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1395 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1396 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1397 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1398 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1399 |
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
|
1400 |
supports=no |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1401 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi |
42141 | 1402 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1403 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1404 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1405 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1406 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1407 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1408 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1409 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1410 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1411 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1412 |
|
34923 | 1413 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
1414 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1415 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1416 |
# Check that the linker support an argument |
34923 | 1417 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
1418 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1419 |
[ |
34923 | 1420 |
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
|
1421 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1422 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1423 |
saved_ldflags="$LDFLAGS" |
34923 | 1424 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1425 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1426 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1427 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1428 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1429 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1430 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1431 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1432 |
if test "x$supports" = "xyes" ; then |
34923 | 1433 |
: |
1434 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1435 |
else |
34923 | 1436 |
: |
1437 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1438 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1439 |
]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
1440 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
1441 |
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC], |
16987 | 1442 |
[ |
1443 |
# Some Zero and Shark settings. |
|
1444 |
# ZERO_ARCHFLAG tells the compiler which mode to build for |
|
1445 |
case "${OPENJDK_TARGET_CPU}" in |
|
1446 |
s390) |
|
22466 | 1447 |
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31" |
16987 | 1448 |
;; |
1449 |
*) |
|
22466 | 1450 |
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
16987 | 1451 |
esac |
34923 | 1452 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$ZERO_ARCHFLAG], IF_FALSE: [ZERO_ARCHFLAG=""]) |
16987 | 1453 |
AC_SUBST(ZERO_ARCHFLAG) |
1454 |
||
22466 | 1455 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
16987 | 1456 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
34923 | 1457 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
1458 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
|
1459 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
16987 | 1460 |
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
|
1461 |
|
30415 | 1462 |
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors], |
1463 |
[do not consider native warnings to be an error @<:@enabled@:>@])]) |
|
1464 |
||
1465 |
AC_MSG_CHECKING([if native warnings are errors]) |
|
1466 |
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
|
1467 |
AC_MSG_RESULT([yes (explicitly set)]) |
30415 | 1468 |
WARNINGS_AS_ERRORS=true |
1469 |
elif test "x$enable_warnings_as_errors" = "xno"; then |
|
1470 |
AC_MSG_RESULT([no]) |
|
1471 |
WARNINGS_AS_ERRORS=false |
|
1472 |
elif test "x$enable_warnings_as_errors" = "x"; then |
|
1473 |
AC_MSG_RESULT([yes (default)]) |
|
1474 |
WARNINGS_AS_ERRORS=true |
|
1475 |
else |
|
1476 |
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument]) |
|
1477 |
fi |
|
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1478 |
|
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1479 |
if test "x$WARNINGS_AS_ERRORS" = "xfalse"; then |
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1480 |
# Set legacy hotspot variable |
33445
9131d6736fd0
8141574: recent change for 8141543 breaks all builds
erikj
parents:
33443
diff
changeset
|
1481 |
HOTSPOT_SET_WARNINGS_AS_ERRORS="WARNINGS_ARE_ERRORS=" |
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1482 |
else |
33445
9131d6736fd0
8141574: recent change for 8141543 breaks all builds
erikj
parents:
33443
diff
changeset
|
1483 |
HOTSPOT_SET_WARNINGS_AS_ERRORS="" |
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1484 |
fi |
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1485 |
|
30415 | 1486 |
AC_SUBST(WARNINGS_AS_ERRORS) |
33443
ea274e904321
8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents:
33440
diff
changeset
|
1487 |
AC_SUBST(HOTSPOT_SET_WARNINGS_AS_ERRORS) |
30415 | 1488 |
|
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1489 |
case "${TOOLCHAIN_TYPE}" in |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1490 |
microsoft) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1491 |
DISABLE_WARNING_PREFIX="-wd" |
25882 | 1492 |
CFLAGS_WARNINGS_ARE_ERRORS="-WX" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1493 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1494 |
solstudio) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1495 |
DISABLE_WARNING_PREFIX="-erroff=" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1496 |
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
|
1497 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1498 |
gcc) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1499 |
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error |
34923 | 1500 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
1501 |
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true], |
|
1502 |
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
|
1503 |
) |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1504 |
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
|
1505 |
DISABLE_WARNING_PREFIX="-Wno-" |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1506 |
else |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1507 |
DISABLE_WARNING_PREFIX= |
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1508 |
fi |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1509 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1510 |
# 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
|
1511 |
# 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
|
1512 |
# build compiler |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1513 |
CC_OLD="$CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1514 |
CXX_OLD="$CXX" |
34102
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1515 |
CC="$BUILD_CC" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1516 |
CXX="$BUILD_CXX" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1517 |
CFLAGS_OLD="$CFLAGS" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1518 |
CFLAGS="" |
34923 | 1519 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
1520 |
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true], |
|
1521 |
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
|
1522 |
) |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1523 |
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
|
1524 |
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-" |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1525 |
else |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1526 |
BUILD_CC_DISABLE_WARNING_PREFIX= |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1527 |
fi |
c0a98357f847
8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents:
33571
diff
changeset
|
1528 |
CC="$CC_OLD" |
37864
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1529 |
CXX="$CXX_OLD" |
5284b5a9fdc7
8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents:
37404
diff
changeset
|
1530 |
CFLAGS="$CFLAGS_OLD" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1531 |
;; |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1532 |
clang) |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1533 |
DISABLE_WARNING_PREFIX="-Wno-" |
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1534 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1535 |
;; |
35747 | 1536 |
xlc) |
1537 |
DISABLE_WARNING_PREFIX="-qsuppress=" |
|
1538 |
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" |
|
1539 |
;; |
|
23423
153d4b6b1124
8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents:
23161
diff
changeset
|
1540 |
esac |
29304
81a723f8d33c
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
28907
diff
changeset
|
1541 |
AC_SUBST(DISABLE_WARNING_PREFIX) |
36506 | 1542 |
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
|
1543 |
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) |
16987 | 1544 |
]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1545 |
|
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1546 |
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1547 |
# Arguments: |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1548 |
# $1 - Optional prefix for each variable defined. |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1549 |
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1550 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1551 |
# 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
|
1552 |
# 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
|
1553 |
# 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
|
1554 |
# member functions is non-null. |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1555 |
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
|
1556 |
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
|
1557 |
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
|
1558 |
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
|
1559 |
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
|
1560 |
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
|
1561 |
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
|
1562 |
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1563 |
AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1564 |
$1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
1565 |
$1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
1566 |
]) |