Move definition to the build system

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