6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
27 # corresponding configure arguments instead
28 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
29 [
30 if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
31 AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
32 fi
33
34 if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
35 AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
36 fi
37
38 if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
39 AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
40 fi
41
42 AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
43 [extra flags to be used when compiling jdk c-files])])
44
45 AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
289 C_FLAG_REORDER=''
290 CXX_FLAG_REORDER=''
291
292 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
293 # Linking is different on MacOSX
294 PICFLAG=''
295 SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
296 SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
297 SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
298 SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
299 SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
300
301 if test "x$STATIC_BUILD" = xfalse; then
302 JVM_CFLAGS="$JVM_CFLAGS -fPIC"
303 fi
304 else
305 # Default works for linux, might work on other platforms as well.
306 PICFLAG='-fPIC'
307 SHARED_LIBRARY_FLAGS='-shared'
308 SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
309 SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
310 SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
311 SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
312 fi
313 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
314 PICFLAG="-KPIC"
315 C_FLAG_REORDER='-xF'
316 CXX_FLAG_REORDER='-xF'
317 SHARED_LIBRARY_FLAGS="-G"
318 SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1'
319 SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
320 SET_SHARED_LIBRARY_NAME='-h [$]1'
321 SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
322 elif test "x$TOOLCHAIN_TYPE" = xxlc; then
323 # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
324 # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
325 # will have to patch this single instruction with a call to some out-of-order code which
326 # does the load from the TOC. This is of course slow. But in that case we also would have
327 # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'.
328 # With 'qpic=large' the compiler will by default generate a two-instruction sequence which
329 # can be patched directly by the linker and does not require a jump to out-of-order code.
330 # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc'
331 # instead. This creates a distinct TOC for every compilation unit (and thus requires two
648 AC_SUBST(C_O_FLAG_HIGHEST_JVM)
649 AC_SUBST(C_O_FLAG_HIGHEST)
650 AC_SUBST(C_O_FLAG_HI)
651 AC_SUBST(C_O_FLAG_NORM)
652 AC_SUBST(C_O_FLAG_DEBUG)
653 AC_SUBST(C_O_FLAG_NONE)
654 AC_SUBST(C_O_FLAG_SIZE)
655 AC_SUBST(CXX_O_FLAG_HIGHEST_JVM)
656 AC_SUBST(CXX_O_FLAG_HIGHEST)
657 AC_SUBST(CXX_O_FLAG_HI)
658 AC_SUBST(CXX_O_FLAG_NORM)
659 AC_SUBST(CXX_O_FLAG_DEBUG)
660 AC_SUBST(CXX_O_FLAG_NONE)
661 AC_SUBST(CXX_O_FLAG_SIZE)
662 ])
663
664
665 AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
666 [
667
668 FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET])
669 FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_])
670
671 # Tests are only ever compiled for TARGET
672 # Flags for compiling test libraries
673 CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
674 CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
675
676 # Flags for compiling test executables
677 CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
678 CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
679
680 AC_SUBST(CFLAGS_TESTLIB)
681 AC_SUBST(CFLAGS_TESTEXE)
682 AC_SUBST(CXXFLAGS_TESTLIB)
683 AC_SUBST(CXXFLAGS_TESTEXE)
684
685 LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
686 LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
687
737
738 # Setup compiler/platform specific flags into
739 # $2CFLAGS_JDK - C Compiler flags
740 # $2CXXFLAGS_JDK - C++ Compiler flags
741 # $2COMMON_CCXXFLAGS_JDK - common to C and C++
742 if test "x$TOOLCHAIN_TYPE" = xgcc; then
743 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
744 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT"
745 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new"
746 if test "x$OPENJDK_$1_CPU" = xx86; then
747 # Force compatibility with i586 on 32 bit intel platforms.
748 $2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586"
749 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586"
750 fi
751 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
752 -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
753 case $OPENJDK_$1_CPU_ARCH in
754 arm )
755 # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
756 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
757 ;;
758 ppc )
759 # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
760 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
761 ;;
762 s390 )
763 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10"
764 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
765 ;;
766 * )
767 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
768 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
769 ;;
770 esac
771 TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2))
772 elif test "x$TOOLCHAIN_TYPE" = xclang; then
773 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
774
775 # Restrict the debug information created by Clang to avoid
776 # too big object files and speed the build up a little bit
|
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 ################################################################################
27 #
28 # Setup ABI profile (for arm)
29 #
30 AC_DEFUN([FLAGS_SETUP_ABI_PROFILE],
31 [
32 AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile],
33 [specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])])
34
35 if test "x$with_abi_profile" != x; then
36 if test "x$OPENJDK_TARGET_CPU" != xarm && \
37 test "x$OPENJDK_TARGET_CPU" != xaarch64; then
38 AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64])
39 fi
40
41 OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile
42 AC_MSG_CHECKING([for ABI profle])
43 AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE])
44
45 if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
46 ARM_FLOAT_TYPE=vfp-sflt
47 ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
48 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
49 ARM_FLOAT_TYPE=vfp-hflt
50 ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
51 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
52 ARM_FLOAT_TYPE=sflt
53 ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
54 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
55 ARM_FLOAT_TYPE=vfp-sflt
56 ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
57 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
58 ARM_FLOAT_TYPE=vfp-hflt
59 ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
60 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
61 # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
62 ARM_FLOAT_TYPE=
63 ARM_ARCH_TYPE_FLAGS=
64 elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
65 # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
66 ARM_FLOAT_TYPE=
67 ARM_ARCH_TYPE_FLAGS=
68 else
69 AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"])
70 fi
71
72 if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
73 ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
74 elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
75 ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
76 elif test "x$ARM_FLOAT_TYPE" = xsflt; then
77 ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
78 fi
79 AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
80 AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
81
82 AC_MSG_CHECKING([for arch type flags])
83 AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
84
85 # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
86 # autoconf target triplet.
87 [ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ]
88 # Sanity check that it is a known ABI.
89 if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \
90 test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \
91 test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then
92 AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"])
93 fi
94 AC_MSG_CHECKING([for ABI property name])
95 AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME])
96 AC_SUBST(JDK_ARCH_ABI_PROP_NAME)
97
98 # Pass these on to the open part of configure as if they were set using
99 # --with-extra-c[xx]flags.
100 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
101 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
102 # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
103 # FIXME: This should not really be set using extra_cflags.
104 if test "x$OPENJDK_TARGET_CPU" = xarm; then
105 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi"
106 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi"
107 fi
108 # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS.
109 EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
110 # And pass the architecture flags to the linker as well
111 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
112 fi
113
114 # When building with an abi profile, the name of that profile is appended on the
115 # bundle platform, which is used in bundle names.
116 if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then
117 OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE"
118 fi
119 ])
120
121 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
122 # corresponding configure arguments instead
123 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
124 [
125 if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
126 AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
127 fi
128
129 if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
130 AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
131 fi
132
133 if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
134 AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
135 fi
136
137 AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
138 [extra flags to be used when compiling jdk c-files])])
139
140 AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
384 C_FLAG_REORDER=''
385 CXX_FLAG_REORDER=''
386
387 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
388 # Linking is different on MacOSX
389 PICFLAG=''
390 SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
391 SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
392 SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
393 SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
394 SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
395
396 if test "x$STATIC_BUILD" = xfalse; then
397 JVM_CFLAGS="$JVM_CFLAGS -fPIC"
398 fi
399 else
400 # Default works for linux, might work on other platforms as well.
401 PICFLAG='-fPIC'
402 SHARED_LIBRARY_FLAGS='-shared'
403 SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
404 SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
405 SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
406
407 # arm specific settings
408 if test "x$OPENJDK_TARGET_CPU_ARCH" = "xarm"; then
409 # '-Wl,-z,origin' isn't used on arm.
410 SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
411 else
412 SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
413 fi
414
415 fi
416 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
417 PICFLAG="-KPIC"
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
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 FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET])
773 FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_])
774
775 # Tests are only ever compiled for TARGET
776 # Flags for compiling test libraries
777 CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
778 CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
779
780 # Flags for compiling test executables
781 CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
782 CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
783
784 AC_SUBST(CFLAGS_TESTLIB)
785 AC_SUBST(CFLAGS_TESTEXE)
786 AC_SUBST(CXXFLAGS_TESTLIB)
787 AC_SUBST(CXXFLAGS_TESTEXE)
788
789 LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
790 LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
791
841
842 # Setup compiler/platform specific flags into
843 # $2CFLAGS_JDK - C Compiler flags
844 # $2CXXFLAGS_JDK - C++ Compiler flags
845 # $2COMMON_CCXXFLAGS_JDK - common to C and C++
846 if test "x$TOOLCHAIN_TYPE" = xgcc; then
847 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
848 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT"
849 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new"
850 if test "x$OPENJDK_$1_CPU" = xx86; then
851 # Force compatibility with i586 on 32 bit intel platforms.
852 $2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586"
853 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586"
854 fi
855 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
856 -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
857 case $OPENJDK_$1_CPU_ARCH in
858 arm )
859 # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
860 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
861 $2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char"
862 ;;
863 ppc )
864 # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
865 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
866 ;;
867 s390 )
868 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10"
869 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
870 ;;
871 * )
872 $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
873 $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
874 ;;
875 esac
876 TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2))
877 elif test "x$TOOLCHAIN_TYPE" = xclang; then
878 $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
879
880 # Restrict the debug information created by Clang to avoid
881 # too big object files and speed the build up a little bit
|