comparison gcc/configure.ac @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children 351920fa3827
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 # configure.ac for GCC 1 # configure.ac for GCC
2 # Process this file with autoconf to generate a configuration script. 2 # Process this file with autoconf to generate a configuration script.
3 3
4 # Copyright (C) 1997-2018 Free Software Foundation, Inc. 4 # Copyright (C) 1997-2020 Free Software Foundation, Inc.
5 5
6 #This file is part of GCC. 6 #This file is part of GCC.
7 7
8 #GCC is free software; you can redistribute it and/or modify it under 8 #GCC is free software; you can redistribute it and/or modify it under
9 #the terms of the GNU General Public License as published by the Free 9 #the terms of the GNU General Public License as published by the Free
21 21
22 # -------------------------------- 22 # --------------------------------
23 # Initialization and sanity checks 23 # Initialization and sanity checks
24 # -------------------------------- 24 # --------------------------------
25 25
26 AC_PREREQ(2.64)
27 AC_INIT 26 AC_INIT
28 AC_CONFIG_SRCDIR(tree.c) 27 AC_CONFIG_SRCDIR(tree.c)
29 AC_CONFIG_HEADER(auto-host.h:config.in) 28 AC_CONFIG_HEADER(auto-host.h:config.in)
30 29
31 gcc_version=`cat $srcdir/BASE-VER` 30 gcc_version=`cat $srcdir/BASE-VER`
448 447
449 # The following test compilation will succeed if and only if $CXX accepts 448 # The following test compilation will succeed if and only if $CXX accepts
450 # -fno-strict-aliasing *and* is older than GCC 4.3. 449 # -fno-strict-aliasing *and* is older than GCC 4.3.
451 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" 450 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
452 AC_MSG_CHECKING([whether $CXX is affected by placement new aliasing bug]) 451 AC_MSG_CHECKING([whether $CXX is affected by placement new aliasing bug])
453 AC_COMPILE_IFELSE([ 452 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
454 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 453 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
455 #error compiler not affected by placement new aliasing bug 454 #error compiler not affected by placement new aliasing bug
456 #endif 455 #endif
457 ], 456 ])],
458 [AC_MSG_RESULT([yes]); aliasing_flags='-fno-strict-aliasing'], 457 [AC_MSG_RESULT([yes]); aliasing_flags='-fno-strict-aliasing'],
459 [AC_MSG_RESULT([no])]) 458 [AC_MSG_RESULT([no])])
460 459
461 CXXFLAGS="$saved_CXXFLAGS" 460 CXXFLAGS="$saved_CXXFLAGS"
462 fi 461 fi
482 [],[enable_build_format_warnings=yes]) 481 [],[enable_build_format_warnings=yes])
483 AS_IF([test $enable_build_format_warnings = no], 482 AS_IF([test $enable_build_format_warnings = no],
484 [wf_opt=-Wno-format],[wf_opt=]) 483 [wf_opt=-Wno-format],[wf_opt=])
485 ACX_PROG_CXX_WARNING_OPTS( 484 ACX_PROG_CXX_WARNING_OPTS(
486 m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ], 485 m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],
487 [-Wcast-qual $wf_opt])), [loose_warn]) 486 [-Wcast-qual -Wno-error=format-diag $wf_opt])),
487 [loose_warn])
488 ACX_PROG_CC_WARNING_OPTS( 488 ACX_PROG_CC_WARNING_OPTS(
489 m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), 489 m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes ],
490 [c_loose_warn]) 490 [-Wno-error=format-diag])), [c_loose_warn])
491 ACX_PROG_CXX_WARNING_OPTS( 491 ACX_PROG_CXX_WARNING_OPTS(
492 m4_quote(m4_do([-Wmissing-format-attribute ], 492 m4_quote(m4_do([-Wmissing-format-attribute ],
493 [-Woverloaded-virtual])), [strict_warn]) 493 [-Woverloaded-virtual])), [strict_warn])
494 ACX_PROG_CC_WARNING_OPTS( 494 ACX_PROG_CC_WARNING_OPTS(
495 m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) 495 m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn])
907 [enable_vtable_verify=no]) 907 [enable_vtable_verify=no])
908 vtable_verify=`if test x$enable_vtable_verify = xyes; then echo 1; else echo 0; fi` 908 vtable_verify=`if test x$enable_vtable_verify = xyes; then echo 1; else echo 0; fi`
909 AC_DEFINE_UNQUOTED(ENABLE_VTABLE_VERIFY, $vtable_verify, 909 AC_DEFINE_UNQUOTED(ENABLE_VTABLE_VERIFY, $vtable_verify,
910 [Define 0/1 if vtable verification feature is enabled.]) 910 [Define 0/1 if vtable verification feature is enabled.])
911 911
912 AC_ARG_ENABLE(analyzer,
913 [AS_HELP_STRING([--disable-analyzer],
914 [disable -fanalyzer static analyzer])],
915 if test x$enable_analyzer = xno; then
916 analyzer=0
917 else
918 analyzer=1
919 fi,
920 analyzer=1)
921 AC_DEFINE_UNQUOTED(ENABLE_ANALYZER, $analyzer,
922 [Define 0/1 if static analyzer feature is enabled.])
923
912 AC_ARG_ENABLE(objc-gc, 924 AC_ARG_ENABLE(objc-gc,
913 [AS_HELP_STRING([--enable-objc-gc], 925 [AS_HELP_STRING([--enable-objc-gc],
914 [enable the use of Boehm's garbage collector with 926 [enable the use of Boehm's garbage collector with
915 the GNU Objective-C runtime])], 927 the GNU Objective-C runtime])],
916 if test x$enable_objc_gc = xno; then 928 if test x$enable_objc_gc = xno; then
957 ) 969 )
958 AC_SUBST(CONFIGURE_SPECS) 970 AC_SUBST(CONFIGURE_SPECS)
959 971
960 ACX_PKGVERSION([GCC]) 972 ACX_PKGVERSION([GCC])
961 ACX_BUGURL([https://gcc.gnu.org/bugs/]) 973 ACX_BUGURL([https://gcc.gnu.org/bugs/])
974
975 # Allow overriding the default URL for documentation
976 AC_ARG_WITH(documentation-root-url,
977 AS_HELP_STRING([--with-documentation-root-url=URL],
978 [Root for documentation URLs]),
979 [case "$withval" in
980 yes) AC_MSG_ERROR([documentation root URL not specified]) ;;
981 no) AC_MSG_ERROR([documentation root URL not specified]) ;;
982 *) DOCUMENTATION_ROOT_URL="$withval"
983 ;;
984 esac],
985 DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/gcc/"
986 )
987 AC_SUBST(DOCUMENTATION_ROOT_URL)
962 988
963 # Sanity check enable_languages in case someone does not run the toplevel 989 # Sanity check enable_languages in case someone does not run the toplevel
964 # configure # script. 990 # configure # script.
965 AC_ARG_ENABLE(languages, 991 AC_ARG_ENABLE(languages,
966 [AS_HELP_STRING([--enable-languages=LIST], [specify which front-ends to build])], 992 [AS_HELP_STRING([--enable-languages=LIST], [specify which front-ends to build])],
980 enable_languages=c,${enable_languages} 1006 enable_languages=c,${enable_languages}
981 ;; 1007 ;;
982 esac], 1008 esac],
983 [enable_languages=c]) 1009 [enable_languages=c])
984 1010
1011 # If top-level libada has been disabled, then wire in install-gnatlib
1012 # invocation with `make install', so that one can build and install
1013 # the library manually with `make -C gcc all gnatlib gnattools install'.
1014 if test x"$enable_libada" = xno; then
1015 gnat_install_lib=gnat-install-lib
1016 else
1017 gnat_install_lib=
1018 fi
1019 AC_SUBST(gnat_install_lib)
1020
985 if test x"$enable_as_accelerator_for" != x; then 1021 if test x"$enable_as_accelerator_for" != x; then
986 AC_DEFINE(ACCEL_COMPILER, 1, 1022 AC_DEFINE(ACCEL_COMPILER, 1,
987 [Define if this compiler should be built as the offload target compiler.]) 1023 [Define if this compiler should be built as the offload target compiler.])
988 enable_as_accelerator=yes 1024 enable_as_accelerator=yes
989 case "${target}" in 1025 case "${target}" in
1006 1042
1007 if echo "$tgt" | grep "^hsa" > /dev/null ; then 1043 if echo "$tgt" | grep "^hsa" > /dev/null ; then
1008 enable_hsa=1 1044 enable_hsa=1
1009 else 1045 else
1010 enable_offloading=1 1046 enable_offloading=1
1047 case "$tgt" in
1048 *-intelmicemul-*)
1049 omp_device_property=omp-device-properties-i386
1050 omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/i386/t-omp-device"
1051 ;;
1052 gcn*-*)
1053 omp_device_property=omp-device-properties-gcn
1054 omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/gcn/t-omp-device"
1055 ;;
1056 nvptx*-*)
1057 omp_device_property=omp-device-properties-nvptx
1058 omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/nvptx/t-omp-device"
1059 ;;
1060 esac
1061 omp_device_properties="${omp_device_properties} ${tgt}=${omp_device_property}"
1062 omp_device_property_deps="${omp_device_property_deps} ${omp_device_property}"
1011 fi 1063 fi
1012 1064
1013 if test x"$offload_targets" = x; then 1065 if test x"$offload_targets" = x; then
1014 offload_targets=$tgt 1066 offload_targets=$tgt
1015 else 1067 else
1016 offload_targets="$offload_targets,$tgt" 1068 offload_targets="$offload_targets,$tgt"
1017 fi 1069 fi
1018 done 1070 done
1071 AC_SUBST(omp_device_properties)
1072 AC_SUBST(omp_device_property_deps)
1073
1019 AC_DEFINE_UNQUOTED(OFFLOAD_TARGETS, "$offload_targets", 1074 AC_DEFINE_UNQUOTED(OFFLOAD_TARGETS, "$offload_targets",
1020 [Define to offload targets, separated by commas.]) 1075 [Define to offload targets, separated by commas.])
1021 if test x"$enable_offloading" != x; then 1076 if test x"$enable_offloading" != x; then
1022 AC_DEFINE(ENABLE_OFFLOADING, 1, 1077 AC_DEFINE(ENABLE_OFFLOADING, 1,
1023 [Define this to enable support for offloading.]) 1078 [Define this to enable support for offloading.])
1169 # -------- 1224 # --------
1170 1225
1171 ZW_CREATE_DEPDIR 1226 ZW_CREATE_DEPDIR
1172 AC_CONFIG_COMMANDS([gccdepdir],[ 1227 AC_CONFIG_COMMANDS([gccdepdir],[
1173 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs build/$DEPDIR 1228 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs build/$DEPDIR
1174 for lang in $subdirs c-family common 1229 for lang in $subdirs c-family common analyzer
1175 do 1230 do
1176 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs $lang/$DEPDIR 1231 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs $lang/$DEPDIR
1177 done], [subdirs="$subdirs" ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR]) 1232 done], [subdirs="$subdirs" ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR])
1178 1233
1179 ZW_PROG_COMPILER_DEPENDENCIES([CXX]) 1234 ZW_PROG_COMPILER_DEPENDENCIES([CXX])
1227 AC_SEARCH_LIBS(ldexp, m) 1282 AC_SEARCH_LIBS(ldexp, m)
1228 LDEXP_LIB="$LIBS" 1283 LDEXP_LIB="$LIBS"
1229 LIBS="$save_LIBS" 1284 LIBS="$save_LIBS"
1230 AC_SUBST(LDEXP_LIB) 1285 AC_SUBST(LDEXP_LIB)
1231 1286
1287 # Some systems need dlopen
1288 save_LIBS="$LIBS"
1289 LIBS=
1290 AC_SEARCH_LIBS(dlopen, dl)
1291 DL_LIB="$LIBS"
1292 LIBS="$save_LIBS"
1293 AC_SUBST(DL_LIB)
1294
1232 # Use <inttypes.h> only if it exists, 1295 # Use <inttypes.h> only if it exists,
1233 # doesn't clash with <sys/types.h>, declares intmax_t and defines 1296 # doesn't clash with <sys/types.h>, declares intmax_t and defines
1234 # PRId64 1297 # PRId64
1235 AC_MSG_CHECKING(for inttypes.h) 1298 AC_MSG_CHECKING(for inttypes.h)
1236 AC_CACHE_VAL(gcc_cv_header_inttypes_h, 1299 AC_CACHE_VAL(gcc_cv_header_inttypes_h,
1248 if test $gcc_cv_header_inttypes_h = yes; then 1311 if test $gcc_cv_header_inttypes_h = yes; then
1249 AC_DEFINE(HAVE_INTTYPES_H, 1, 1312 AC_DEFINE(HAVE_INTTYPES_H, 1,
1250 [Define if you have a working <inttypes.h> header file.]) 1313 [Define if you have a working <inttypes.h> header file.])
1251 fi 1314 fi
1252 1315
1316 # Look for the ZSTD package.
1317 ZSTD_INCLUDE=
1318 ZSTD_LIB=
1319 AC_SUBST(ZSTD_INCLUDE)
1320 AC_SUBST(ZSTD_LIB)
1321 ZSTD_CPPFLAGS=
1322 ZSTD_LDFLAGS=
1323 AC_ARG_WITH(zstd,
1324 [AS_HELP_STRING([--with-zstd=PATH],
1325 [specify prefix directory for installed zstd library.
1326 Equivalent to --with-zstd-include=PATH/include
1327 plus --with-zstd-lib=PATH/lib])])
1328 AC_ARG_WITH(zstd-include,
1329 [AS_HELP_STRING([--with-zstd-include=PATH],
1330 [specify directory for installed zstd include files])])
1331 AC_ARG_WITH(zstd-lib,
1332 [AS_HELP_STRING([--with-zstd-lib=PATH],
1333 [specify directory for the installed zstd library])])
1334 case "x$with_zstd" in
1335 x) ;;
1336 xno)
1337 ZSTD_INCLUDE=no
1338 ZSTD_LIB=no
1339 ;;
1340 *) ZSTD_INCLUDE=$with_zstd/include
1341 ZSTD_LIB=$with_zstd/lib
1342 ;;
1343 esac
1344 if test "x$with_zstd_include" != x; then
1345 ZSTD_INCLUDE=$with_zstd_include
1346 fi
1347 if test "x$with_zstd_lib" != x; then
1348 ZSTD_LIB=$with_zstd_lib
1349 fi
1350 if test "x$ZSTD_INCLUDE" != x \
1351 && test "x$ZSTD_INCLUDE" != xno; then
1352 ZSTD_CPPFLAGS=-I$ZSTD_INCLUDE
1353 fi
1354 if test "x$ZSTD_LIB" != x \
1355 && test "x$ZSTD_LIB" != xno; then
1356 ZSTD_LDFLAGS=-L$ZSTD_LIB
1357 fi
1358
1359 CXXFLAGS="$CXXFLAGS $ZSTD_CPPFLAGS"
1360 LDFLAGS="$LDFLAGS $ZSTD_LDFLAGS"
1361
1362 AC_MSG_CHECKING(for zstd.h)
1363 AC_CACHE_VAL(gcc_cv_header_zstd_h,
1364 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1365 [[#include <zstd.h>]])],
1366 [gcc_cv_header_zstd_h=yes],
1367 [gcc_cv_header_zstd_h=no])])
1368 AC_MSG_RESULT($gcc_cv_header_zstd_h)
1369 if test $gcc_cv_header_zstd_h = yes; then
1370 AC_DEFINE(HAVE_ZSTD_H, 1,
1371 [Define if you have a working <zstd.h> header file.])
1372 fi
1373
1374 # LTO can use zstd compression algorithm
1375 save_LIBS="$LIBS"
1376 LIBS=
1377 AC_SEARCH_LIBS(ZSTD_compress, zstd)
1378 ZSTD_LIB="$LIBS"
1379 LIBS="$save_LIBS"
1380 AC_SUBST(ZSTD_LIB)
1381
1253 dnl Disabled until we have a complete test for buggy enum bitfields. 1382 dnl Disabled until we have a complete test for buggy enum bitfields.
1254 dnl gcc_AC_C_ENUM_BF_UNSIGNED 1383 dnl gcc_AC_C_ENUM_BF_UNSIGNED
1255 1384
1256 define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl 1385 define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
1257 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl 1386 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
1259 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl 1388 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
1260 putchar_unlocked putc_unlocked) 1389 putchar_unlocked putc_unlocked)
1261 AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \ 1390 AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \
1262 popen sysconf strsignal getrusage nl_langinfo \ 1391 popen sysconf strsignal getrusage nl_langinfo \
1263 gettimeofday mbstowcs wcswidth mmap setlocale \ 1392 gettimeofday mbstowcs wcswidth mmap setlocale \
1264 gcc_UNLOCKED_FUNCS madvise) 1393 gcc_UNLOCKED_FUNCS madvise mallinfo)
1265 1394
1266 if test x$ac_cv_func_mbstowcs = xyes; then 1395 if test x$ac_cv_func_mbstowcs = xyes; then
1267 AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, 1396 AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
1268 [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h> 1397 [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
1269 int main() 1398 int main()
1336 gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[ 1465 gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
1337 #include "ansidecl.h" 1466 #include "ansidecl.h"
1338 #include "system.h" 1467 #include "system.h"
1339 #ifdef HAVE_SYS_RESOURCE_H 1468 #ifdef HAVE_SYS_RESOURCE_H
1340 #include <sys/resource.h> 1469 #include <sys/resource.h>
1470 #endif
1471 ])
1472
1473 gcc_AC_CHECK_DECLS(mallinfo, , ,[
1474 #include "ansidecl.h"
1475 #include "system.h"
1476 #ifdef HAVE_MALLOC_H
1477 #include <malloc.h>
1341 #endif 1478 #endif
1342 ]) 1479 ])
1343 1480
1344 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1481 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1345 #include "ansidecl.h" 1482 #include "ansidecl.h"
1609 1746
1610 case ${host} in 1747 case ${host} in
1611 powerpc*-*-darwin*) 1748 powerpc*-*-darwin*)
1612 AC_CACHE_CHECK([whether mcontext_t fields have underscores], 1749 AC_CACHE_CHECK([whether mcontext_t fields have underscores],
1613 gcc_cv_mcontext_underscores, 1750 gcc_cv_mcontext_underscores,
1614 AC_COMPILE_IFELSE([ 1751 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1615 #include <sys/cdefs.h> 1752 #include <sys/cdefs.h>
1616 #include <sys/signal.h> 1753 #include <sys/signal.h>
1617 #include <ucontext.h> 1754 #include <ucontext.h>
1618 int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; } 1755 int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; }
1619 ], 1756 ])],
1620 gcc_cv_mcontext_underscores=no, gcc_cv_mcontext_underscores=yes)) 1757 gcc_cv_mcontext_underscores=no, gcc_cv_mcontext_underscores=yes))
1621 if test $gcc_cv_mcontext_underscores = yes; then 1758 if test $gcc_cv_mcontext_underscores = yes; then
1622 AC_DEFINE(HAS_MCONTEXT_T_UNDERSCORES,,dnl 1759 AC_DEFINE(HAS_MCONTEXT_T_UNDERSCORES,,dnl
1623 [mcontext_t fields start with __]) 1760 [mcontext_t fields start with __])
1624 fi 1761 fi
1715 # as well. If host!=build, we are in error and need to do more 1852 # as well. If host!=build, we are in error and need to do more
1716 # work to find out the build config parameters. 1853 # work to find out the build config parameters.
1717 if test x$host = x$build 1854 if test x$host = x$build
1718 then 1855 then
1719 build_auto=auto-host.h 1856 build_auto=auto-host.h
1857 HAVE_AUTO_BUILD='# '
1720 else 1858 else
1721 # We create a subdir, then run autoconf in the subdir. 1859 # We create a subdir, then run autoconf in the subdir.
1722 # To prevent recursion we set host and build for the new 1860 # To prevent recursion we set host and build for the new
1723 # invocation of configure to the build for this invocation 1861 # invocation of configure to the build for this invocation
1724 # of configure. 1862 # of configure.
1737 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ 1875 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
1738 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ 1876 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
1739 GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ 1877 GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
1740 ${realsrcdir}/configure \ 1878 ${realsrcdir}/configure \
1741 --enable-languages=${enable_languages-all} \ 1879 --enable-languages=${enable_languages-all} \
1742 --target=$target_alias --host=$build_alias --build=$build_alias 1880 ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \
1881 ${enable_option_checking+--enable-option-checking="$enable_option_checking"} \
1882 --target=$target_alias --host=$build_alias \
1883 --build=$build_alias || exit # retaining $tempdir
1743 1884
1744 # We just finished tests for the build machine, so rename 1885 # We just finished tests for the build machine, so rename
1745 # the file auto-build.h in the gcc directory. 1886 # the file auto-build.h in the gcc directory.
1746 mv auto-host.h ../auto-build.h 1887 mv auto-host.h ../auto-build.h
1747 cd .. 1888 cd ..
1748 rm -rf $tempdir 1889 rm -rf $tempdir
1749 build_auto=auto-build.h 1890 build_auto=auto-build.h
1891 HAVE_AUTO_BUILD=
1750 fi 1892 fi
1751 AC_SUBST(build_subdir) 1893 AC_SUBST(build_subdir)
1894 AC_SUBST(HAVE_AUTO_BUILD)
1752 1895
1753 tm_file="${tm_file} defaults.h" 1896 tm_file="${tm_file} defaults.h"
1754 tm_p_file="${tm_p_file} tm-preds.h" 1897 tm_p_file="${tm_p_file} tm-preds.h"
1898 tm_d_file="${tm_d_file} defaults.h"
1755 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" 1899 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
1756 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" 1900 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
1757 # We don't want ansidecl.h in target files, write code there in ISO/GNU C. 1901 # We don't want ansidecl.h in target files, write code there in ISO/GNU C.
1758 # put this back in temporarily. 1902 # put this back in temporarily.
1759 xm_file="auto-host.h ansidecl.h ${xm_file}" 1903 xm_file="auto-host.h ansidecl.h ${xm_file}"
1871 [AS_HELP_STRING([--enable-cld], [enable -mcld by default for 32bit x86])], [], 2015 [AS_HELP_STRING([--enable-cld], [enable -mcld by default for 32bit x86])], [],
1872 [enable_cld=no]) 2016 [enable_cld=no])
1873 2017
1874 AC_ARG_ENABLE(frame-pointer, 2018 AC_ARG_ENABLE(frame-pointer,
1875 [AS_HELP_STRING([--enable-frame-pointer], 2019 [AS_HELP_STRING([--enable-frame-pointer],
1876 [enable -fno-omit-frame-pointer by default for 32bit x86])], [], 2020 [enable -fno-omit-frame-pointer by default for x86])], [],
1877 [ 2021 [
1878 case $target_os in 2022 case $target_os in
1879 linux* | darwin[[8912]]*) 2023 linux* | gnu* | darwin[[8912]]* | cygwin* | mingw*)
1880 # Enable -fomit-frame-pointer by default for Linux and Darwin with 2024 # Enable -fomit-frame-pointer by default for these systems with DWARF2.
1881 # DWARF2.
1882 enable_frame_pointer=no 2025 enable_frame_pointer=no
1883 ;; 2026 ;;
1884 *) 2027 *)
1885 enable_frame_pointer=yes 2028 enable_frame_pointer=yes
1886 ;; 2029 ;;
1887 esac 2030 esac
1888 ]) 2031 ])
2032
2033 case $target in
2034 i[[34567]]86-*-* | x86_64-*-*)
2035 if test "x$enable_cld" = xyes; then
2036 tm_defines="${tm_defines} USE_IX86_CLD=1"
2037 fi
2038 if test "x$enable_frame_pointer" = xyes; then
2039 tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
2040 fi
2041 ;;
2042 esac
1889 2043
1890 # Windows32 Registry support for specifying GCC installation paths. 2044 # Windows32 Registry support for specifying GCC installation paths.
1891 AC_ARG_ENABLE(win32-registry, 2045 AC_ARG_ENABLE(win32-registry,
1892 [AS_HELP_STRING([--disable-win32-registry], 2046 [AS_HELP_STRING([--disable-win32-registry],
1893 [disable lookup of installation paths in the 2047 [disable lookup of installation paths in the
1943 if test -f ${srcdir}/config/$f 2097 if test -f ${srcdir}/config/$f
1944 then 2098 then
1945 tmake_file_="${tmake_file_} \$(srcdir)/config/$f" 2099 tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
1946 fi 2100 fi
1947 done 2101 done
1948 tmake_file="${tmake_file_}" 2102 tmake_file="${tmake_file_}${omp_device_property_tmake_file}"
1949 2103
1950 out_object_file=`basename $out_file .c`.o 2104 out_object_file=`basename $out_file .c`.o
1951 common_out_object_file=`basename $common_out_file .c`.o 2105 common_out_object_file=`basename $common_out_file .c`.o
1952 2106
1953 tm_file_list="options.h" 2107 tm_file_list="options.h"
1979 tm_p_include_list="${tm_p_include_list} $f" 2133 tm_p_include_list="${tm_p_include_list} $f"
1980 ;; 2134 ;;
1981 * ) 2135 * )
1982 tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" 2136 tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
1983 tm_p_include_list="${tm_p_include_list} config/$f" 2137 tm_p_include_list="${tm_p_include_list} config/$f"
2138 esac
2139 done
2140
2141 tm_d_file_list=
2142 tm_d_include_list="options.h insn-constants.h"
2143 for f in $tm_d_file; do
2144 case $f in
2145 defaults.h )
2146 tm_d_file_list="${tm_d_file_list} \$(srcdir)/$f"
2147 tm_d_include_list="${tm_d_include_list} $f"
2148 ;;
2149 * )
2150 tm_d_file_list="${tm_d_file_list} \$(srcdir)/config/$f"
2151 tm_d_include_list="${tm_d_include_list} config/$f"
2152 ;;
1984 esac 2153 esac
1985 done 2154 done
1986 2155
1987 xm_file_list= 2156 xm_file_list=
1988 xm_include_list= 2157 xm_include_list=
2497 AC_MSG_RESULT(not found) 2666 AC_MSG_RESULT(not found)
2498 else 2667 else
2499 AC_MSG_RESULT($gcc_cv_readelf) 2668 AC_MSG_RESULT($gcc_cv_readelf)
2500 fi 2669 fi
2501 2670
2671 # Figure out what otool we will be using.
2672 AS_VAR_SET_IF(gcc_cv_otool,, [
2673 if test -x otool$build_exeext; then
2674 gcc_cv_otool=./otool$build_exeext
2675 elif ( set dummy $OTOOL_FOR_TARGET; test -x $[2] ); then
2676 gcc_cv_otool="$OTOOL_FOR_TARGET"
2677 else
2678 AC_PATH_PROG(gcc_cv_otool, $OTOOL_FOR_TARGET)
2679 fi])
2680
2681 AC_MSG_CHECKING(what otool to use)
2682 if test x$gcc_cv_otool = x; then
2683 AC_MSG_RESULT(not found)
2684 else
2685 AC_MSG_RESULT($gcc_cv_otool)
2686 fi
2687
2502 # Figure out what assembler alignment features are present. 2688 # Figure out what assembler alignment features are present.
2503 gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align, 2689 gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,
2504 [2,6,0],, 2690 [2,6,0],,
2505 [.balign 4 2691 [.balign 4
2506 .p2align 2],, 2692 .p2align 2],,
2631 # 2817 #
2632 # but test versions add stuff at the end: 2818 # but test versions add stuff at the end:
2633 # 2819 #
2634 # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10 2820 # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
2635 # 2821 #
2636 # In Solaris 11.4, this was changed to
2637 #
2638 # ld: Solaris ELF Utilities: 11.4-1.3123
2639 #
2640 # ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version 2822 # ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version
2641 # numbers can be used in ld.so.1 feature checks even if a different 2823 # numbers can be used in ld.so.1 feature checks even if a different
2642 # linker is configured. 2824 # linker is configured.
2643 ld_ver=`$gcc_cv_ld -V 2>&1` 2825 ld_ver=`$gcc_cv_ld -V 2>&1`
2644 if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then 2826 if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
2645 ld_vers=`echo $ld_ver | sed -n \ 2827 ld_vers=`echo $ld_ver | sed -n \
2646 -e 's,^.*: \(5\|1[0-9]\)\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\2,p'` 2828 -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
2647 ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` 2829 ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
2648 ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` 2830 ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
2649 fi 2831 fi
2650 ;; 2832 ;;
2651 esac 2833 esac
2699 gcc_cv_ld_hidden=yes 2881 gcc_cv_ld_hidden=yes
2700 ;; 2882 ;;
2701 hppa64*-*-hpux* | ia64*-*-hpux*) 2883 hppa64*-*-hpux* | ia64*-*-hpux*)
2702 gcc_cv_ld_hidden=yes 2884 gcc_cv_ld_hidden=yes
2703 ;; 2885 ;;
2704 *-*-solaris2.1[0-9]*) 2886 *-*-solaris2*)
2705 # Support for .hidden in Sun ld appeared in Solaris 9 FCS, but 2887 # Support for .hidden in Sun ld appeared in Solaris 9 FCS, but
2706 # .symbolic was only added in Solaris 9 12/02. 2888 # .symbolic was only added in Solaris 9 12/02.
2707 gcc_cv_ld_hidden=yes 2889 gcc_cv_ld_hidden=yes
2708 ;; 2890 ;;
2709 *) 2891 *)
2886 [ .text 3068 [ .text
2887 .cfi_startproc 3069 .cfi_startproc
2888 .cfi_personality 0, symbol 3070 .cfi_personality 0, symbol
2889 .cfi_endproc]) 3071 .cfi_endproc])
2890 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE, 3072 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE,
2891 [`if test $gcc_cv_as_cfi_personality_directive = yes; 3073 [`if test $gcc_cv_as_cfi_personality_directive = yes; then echo 1; else echo 0; fi`],
2892 then echo 1; else echo 0; fi`],
2893 [Define 0/1 if your assembler supports .cfi_personality.]) 3074 [Define 0/1 if your assembler supports .cfi_personality.])
2894 3075
2895 gcc_GAS_CHECK_FEATURE([cfi sections directive], 3076 gcc_GAS_CHECK_FEATURE([cfi sections directive],
2896 gcc_cv_as_cfi_sections_directive, ,, 3077 gcc_cv_as_cfi_sections_directive, ,,
2897 [ .text 3078 [ .text
2914 gcc_cv_as_cfi_sections_directive=yes 3095 gcc_cv_as_cfi_sections_directive=yes
2915 ;; 3096 ;;
2916 esac]) 3097 esac])
2917 GCC_TARGET_TEMPLATE(HAVE_GAS_CFI_SECTIONS_DIRECTIVE) 3098 GCC_TARGET_TEMPLATE(HAVE_GAS_CFI_SECTIONS_DIRECTIVE)
2918 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE, 3099 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE,
2919 [`if test $gcc_cv_as_cfi_sections_directive = yes; 3100 [`if test $gcc_cv_as_cfi_sections_directive = yes; then echo 1; else echo 0; fi`],
2920 then echo 1; else echo 0; fi`],
2921 [Define 0/1 if your assembler supports .cfi_sections.]) 3101 [Define 0/1 if your assembler supports .cfi_sections.])
2922 3102
2923 # GAS versions up to and including 2.11.0 may mis-optimize 3103 # GAS versions up to and including 2.11.0 may mis-optimize
2924 # .eh_frame data. 3104 # .eh_frame data.
2925 gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame, 3105 gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,
3025 if test $gcc_cv_as_shf_merge = no; then 3205 if test $gcc_cv_as_shf_merge = no; then
3026 gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge, 3206 gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
3027 [elf,2,12,0], [--fatal-warnings], 3207 [elf,2,12,0], [--fatal-warnings],
3028 [.section .rodata.str, "aMS", %progbits, 1]) 3208 [.section .rodata.str, "aMS", %progbits, 1])
3029 fi 3209 fi
3030 case "$target" in
3031 i?86-*-solaris2.10* | x86_64-*-solaris2.10*)
3032 # SHF_MERGE support in Solaris 10/x86 ld is broken.
3033 if test x"$gnu_ld" = xno; then
3034 gcc_cv_as_shf_merge=no
3035 fi
3036 ;;
3037 esac
3038 AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE, 3210 AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
3039 [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`], 3211 [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
3040 [Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.]) 3212 [Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
3041 3213
3042 gcc_cv_ld_aligned_shf_merge=yes 3214 gcc_cv_ld_aligned_shf_merge=yes
3043 case "$target" in 3215 case "$target" in
3044 # While Solaris 10/SPARC ld isn't affected, disable to avoid problems
3045 # relinking on Solaris 11 < 11.4.
3046 sparc*-*-solaris2.10*)
3047 if test x"$gnu_ld" = xno; then
3048 gcc_cv_ld_aligned_shf_merge=no
3049 fi
3050 ;;
3051 # SHF_MERGE support is broken in Solaris ld up to Solaris 11.3/SPARC for 3216 # SHF_MERGE support is broken in Solaris ld up to Solaris 11.3/SPARC for
3052 # alignment > 1. 3217 # alignment > 1.
3053 sparc*-*-solaris2.11*) 3218 sparc*-*-solaris2.11*)
3054 if test x"$gnu_ld" = xno \ 3219 if test x"$gnu_ld" = xno \
3055 && test "$ld_vers_major" -lt 2 && test "$ld_vers_minor" -lt 3159; then 3220 && test "$ld_vers_major" -lt 2 && test "$ld_vers_minor" -lt 3159; then
3091 .section ".text%foo", #alloc,#execinstr,#progbits 3256 .section ".text%foo", #alloc,#execinstr,#progbits
3092 .globl foo 3257 .globl foo
3093 foo: 3258 foo:
3094 ' 3259 '
3095 ;; 3260 ;;
3096 i?86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*) 3261 i?86-*-solaris2* | x86_64-*-solaris2*)
3097 conftest_s=' 3262 conftest_s='
3098 .group foo,.text%foo,#comdat 3263 .group foo,.text%foo,#comdat
3099 .section .text%foo, "ax", @progbits 3264 .section .text%foo, "ax", @progbits
3100 .globl foo 3265 .globl foo
3101 foo: 3266 foo:
3213 [ .text 3378 [ .text
3214 .file 1 "conf.c" 3379 .file 1 "conf.c"
3215 .loc 1 1 0 discriminator 1],, 3380 .loc 1 1 0 discriminator 1],,
3216 [AC_DEFINE(HAVE_GAS_DISCRIMINATOR, 1, 3381 [AC_DEFINE(HAVE_GAS_DISCRIMINATOR, 1,
3217 [Define if your assembler supports the .loc discriminator sub-directive.])]) 3382 [Define if your assembler supports the .loc discriminator sub-directive.])])
3383
3384 # Catch the newlib flag of the same name so we can gate GCC features on it.
3385 AC_ARG_ENABLE(newlib-nano-formatted-io,
3386 [AS_HELP_STRING([--enable-newlib-nano-formatted-io], [Use nano version
3387 formatted IO])],
3388 [case "${enableval}" in
3389 yes|no)
3390 ;;
3391 *)
3392 AC_MSG_ERROR([unknown newlib-nano-formatted-io setting $enableval])
3393 ;;
3394 esac], [])
3218 3395
3219 # Thread-local storage - the check is heavily parameterized. 3396 # Thread-local storage - the check is heavily parameterized.
3220 conftest_s= 3397 conftest_s=
3221 tls_first_major= 3398 tls_first_major=
3222 tls_first_minor= 3399 tls_first_minor=
3314 tls_first_major=2 3491 tls_first_major=2
3315 tls_first_minor=17 3492 tls_first_minor=17
3316 ;; 3493 ;;
3317 i[34567]86-*-* | x86_64-*-*) 3494 i[34567]86-*-* | x86_64-*-*)
3318 case "$target" in 3495 case "$target" in
3319 i[34567]86-*-solaris2.* | x86_64-*-solaris2.1[0-9]*) 3496 i[34567]86-*-solaris2.* | x86_64-*-solaris2.*)
3320 on_solaris=yes 3497 on_solaris=yes
3321 ;; 3498 ;;
3322 *) 3499 *)
3323 on_solaris=no 3500 on_solaris=no
3324 ;; 3501 ;;
3458 nop' 3635 nop'
3459 tls_first_major=2 3636 tls_first_major=2
3460 tls_first_minor=20 3637 tls_first_minor=20
3461 tls_as_opt='--fatal-warnings' 3638 tls_as_opt='--fatal-warnings'
3462 ;; 3639 ;;
3640 or1k*-*-*)
3641 conftest_s='
3642 .section ".tdata","awT",@progbits
3643 foo: .long 25
3644 .text
3645 l.movhi r3, tpoffha(foo)
3646 l.add r3, r3, r10
3647 l.lwz r4, tpofflo(foo)(r3)'
3648 tls_first_major=2
3649 tls_first_minor=30
3650 tls_as_opt=--fatal-warnings
3651 ;;
3463 powerpc-ibm-aix*) 3652 powerpc-ibm-aix*)
3464 conftest_s=' 3653 conftest_s='
3465 .extern __get_tpointer 3654 .extern __get_tpointer
3466 .toc 3655 .toc
3467 LC..1: 3656 LC..1:
3918 [ 4107 [
3919 .text 4108 .text
3920 ldr x0, [[x2, #:gotpage_lo15:globalsym]] 4109 ldr x0, [[x2, #:gotpage_lo15:globalsym]]
3921 ],,[AC_DEFINE(HAVE_AS_SMALL_PIC_RELOCS, 1, 4110 ],,[AC_DEFINE(HAVE_AS_SMALL_PIC_RELOCS, 1,
3922 [Define if your assembler supports relocs needed by -fpic.])]) 4111 [Define if your assembler supports relocs needed by -fpic.])])
4112 # Enable Branch Target Identification Mechanism and Return Address
4113 # Signing by default.
4114 AC_ARG_ENABLE(standard-branch-protection,
4115 [
4116 AS_HELP_STRING([--enable-standard-branch-protection],
4117 [enable Branch Target Identification Mechanism and Return Address Signing by default for AArch64])
4118 AS_HELP_STRING([--disable-standard-branch-protection],
4119 [disable Branch Target Identification Mechanism and Return Address Signing by default for AArch64])
4120 ],
4121 [
4122 case $enableval in
4123 yes)
4124 tm_defines="${tm_defines} TARGET_ENABLE_BTI=1 TARGET_ENABLE_PAC_RET=1"
4125 ;;
4126 no)
4127 ;;
4128 *)
4129 AC_MSG_ERROR(['$enableval' is an invalid value for --enable-standard-branch-protection.\
4130 Valid choices are 'yes' and 'no'.])
4131 ;;
4132 esac
4133 ],
4134 [])
3923 # Enable default workaround for AArch64 Cortex-A53 erratum 835769. 4135 # Enable default workaround for AArch64 Cortex-A53 erratum 835769.
3924 AC_ARG_ENABLE(fix-cortex-a53-835769, 4136 AC_ARG_ENABLE(fix-cortex-a53-835769,
3925 [ 4137 [
3926 AS_HELP_STRING([--enable-fix-cortex-a53-835769], 4138 AS_HELP_STRING([--enable-fix-cortex-a53-835769],
3927 [enable workaround for AArch64 Cortex-A53 erratum 835769 by default]) 4139 [enable workaround for AArch64 Cortex-A53 erratum 835769 by default])
4062 [AC_DEFINE(HAVE_AS_NO_MUL_BUG_ABORT_OPTION, 1, 4274 [AC_DEFINE(HAVE_AS_NO_MUL_BUG_ABORT_OPTION, 1,
4063 [Define if your assembler supports the -no-mul-bug-abort option.])]) 4275 [Define if your assembler supports the -no-mul-bug-abort option.])])
4064 ;; 4276 ;;
4065 4277
4066 sparc*-*-*) 4278 sparc*-*-*)
4067 gcc_GAS_CHECK_FEATURE([.register], gcc_cv_as_sparc_register_op,,,
4068 [.register %g2, #scratch],,
4069 [AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
4070 [Define if your assembler supports .register.])])
4071
4072 gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,, 4279 gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,,
4073 [-relax], [.text],, 4280 [-relax], [.text],,
4074 [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1, 4281 [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
4075 [Define if your assembler supports -relax option.])]) 4282 [Define if your assembler supports -relax option.])])
4076 4283
4535 gcc_GAS_CHECK_FEATURE([ltoffx and ldxmov relocs], 4742 gcc_GAS_CHECK_FEATURE([ltoffx and ldxmov relocs],
4536 gcc_cv_as_ia64_ltoffx_ldxmov_relocs, [2,14,0],, 4743 gcc_cv_as_ia64_ltoffx_ldxmov_relocs, [2,14,0],,
4537 [ .text 4744 [ .text
4538 addl r15 = @ltoffx(x#), gp 4745 addl r15 = @ltoffx(x#), gp
4539 ;; 4746 ;;
4540 ld8.mov r16 = [[r15]], x#],, 4747 ld8.mov r16 = [[r15]], x#
4748 ],,
4541 [AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1, 4749 [AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1,
4542 [Define if your assembler supports ltoffx and ldxmov relocations.])]) 4750 [Define if your assembler supports ltoffx and ldxmov relocations.])])
4543 4751
4544 ;; 4752 ;;
4545 4753
4550 gcc_GAS_CHECK_FEATURE([.machine directive support], 4758 gcc_GAS_CHECK_FEATURE([.machine directive support],
4551 gcc_cv_as_machine_directive,,, 4759 gcc_cv_as_machine_directive,,,
4552 [ .machine ppc7400]) 4760 [ .machine ppc7400])
4553 if test x$gcc_cv_as_machine_directive != xyes; then 4761 if test x$gcc_cv_as_machine_directive != xyes; then
4554 echo "*** This target requires an assembler supporting \".machine\"" >&2 4762 echo "*** This target requires an assembler supporting \".machine\"" >&2
4555 echo you can get it from: ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg >&2 4763 echo you can get it from: https://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg >&2
4556 test x$build = x$target && exit 1 4764 test x$build = x$target && exit 1
4557 fi 4765 fi
4558 ;; 4766 ;;
4559 esac 4767 esac
4560 4768
4613 gcc_cv_as_powerpc_gnu_attribute, [2,18,0],, 4821 gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
4614 [.gnu_attribute 4,1],, 4822 [.gnu_attribute 4,1],,
4615 [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1, 4823 [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
4616 [Define if your assembler supports .gnu_attribute.])]) 4824 [Define if your assembler supports .gnu_attribute.])])
4617 4825
4618 gcc_GAS_CHECK_FEATURE([tls marker support],
4619 gcc_cv_as_powerpc_tls_markers, [2,20,0],,
4620 [ bl __tls_get_addr(x@tlsgd)],,
4621 [AC_DEFINE(HAVE_AS_TLS_MARKERS, 1,
4622 [Define if your assembler supports arg info for __tls_get_addr.])])
4623
4624 gcc_GAS_CHECK_FEATURE([prologue entry point marker support], 4826 gcc_GAS_CHECK_FEATURE([prologue entry point marker support],
4625 gcc_cv_as_powerpc_entry_markers, [2,26,0],-a64 --fatal-warnings, 4827 gcc_cv_as_powerpc_entry_markers, [2,26,0],-a64 --fatal-warnings,
4626 [ .reloc .,R_PPC64_ENTRY; nop],, 4828 [ .reloc .,R_PPC64_ENTRY; nop],,
4627 [AC_DEFINE(HAVE_AS_ENTRY_MARKERS, 1, 4829 [AC_DEFINE(HAVE_AS_ENTRY_MARKERS, 1,
4628 [Define if your assembler supports the R_PPC64_ENTRY relocation.])]) 4830 [Define if your assembler supports the R_PPC64_ENTRY relocation.])])
4831
4832 gcc_GAS_CHECK_FEATURE([plt sequence marker support],
4833 gcc_cv_as_powerpc_pltseq_markers, [2,31,0],-a32 --fatal-warnings,
4834 [ .reloc .,R_PPC_PLTSEQ; nop],,
4835 [AC_DEFINE(HAVE_AS_PLTSEQ, 1,
4836 [Define if your assembler supports R_PPC*_PLTSEQ relocations.])])
4629 4837
4630 case $target in 4838 case $target in
4631 *-*-aix*) 4839 *-*-aix*)
4632 gcc_GAS_CHECK_FEATURE([AIX .ref support], 4840 gcc_GAS_CHECK_FEATURE([AIX .ref support],
4633 gcc_cv_as_aix_ref, [2,21,0],, 4841 gcc_cv_as_aix_ref, [2,21,0],,
4804 && test x$with_nan != x; then 5012 && test x$with_nan != x; then
4805 AC_MSG_ERROR( 5013 AC_MSG_ERROR(
4806 [Requesting --with-nan= requires assembler support for -mnan=]) 5014 [Requesting --with-nan= requires assembler support for -mnan=])
4807 fi 5015 fi
4808 ;; 5016 ;;
5017 msp430-*-*)
5018 # Earlier GAS versions generically support .gnu_attribute, but the
5019 # msp430 assembler will not do anything with it.
5020 gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
5021 gcc_cv_as_msp430_gnu_attribute, [2,33,50],,
5022 [.gnu_attribute 4,1],,
5023 [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
5024 [Define if your assembler supports .gnu_attribute.])])
5025 gcc_GAS_CHECK_FEATURE([.mspabi_attribute support],
5026 gcc_cv_as_msp430_mspabi_attribute, [2,33,50],,
5027 [.mspabi_attribute 4,1],,
5028 [AC_DEFINE(HAVE_AS_MSPABI_ATTRIBUTE, 1,
5029 [Define if your assembler supports .mspabi_attribute.])])
5030 if test x$enable_newlib_nano_formatted_io = xyes; then
5031 AC_DEFINE(HAVE_NEWLIB_NANO_FORMATTED_IO, 1, [Define if GCC has been
5032 configured with --enable-newlib-nano-formatted-io.])
5033 fi
5034 ;;
5035 nios2-*-*)
5036 # Versions 2.33 and earlier lacked support for the %gotoff relocation
5037 # syntax that is documented in the ABI specification.
5038 gcc_GAS_CHECK_FEATURE([support for %gotoff relocations in constant data],
5039 gcc_cv_as_nios2_gotoff_relocation,,,
5040 [ .extern foo
5041 .data
5042 .long %gotoff(foo)],,
5043 [AC_DEFINE(HAVE_AS_NIOS2_GOTOFF_RELOCATION, 1,
5044 [Define if your assembler supports %gotoff relocation syntax.])])
5045 ;;
5046 riscv*-*-*)
5047 gcc_GAS_CHECK_FEATURE([.attribute support],
5048 gcc_cv_as_riscv_attribute, [2,32,0],,
5049 [.attribute stack_align,4],,
5050 [AC_DEFINE(HAVE_AS_RISCV_ATTRIBUTE, 1,
5051 [Define if your assembler supports .attribute.])])
5052 ;;
4809 s390*-*-*) 5053 s390*-*-*)
4810 gcc_GAS_CHECK_FEATURE([.gnu_attribute support], 5054 gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
4811 gcc_cv_as_s390_gnu_attribute, [2,18,0],, 5055 gcc_cv_as_s390_gnu_attribute, [2,18,0],,
4812 [.gnu_attribute 8,1],, 5056 [.gnu_attribute 8,1],,
4813 [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1, 5057 [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
4823 gcc_GAS_CHECK_FEATURE([architecture modifiers support], 5067 gcc_GAS_CHECK_FEATURE([architecture modifiers support],
4824 gcc_cv_as_s390_architecture_modifiers, [2,26,0],, 5068 gcc_cv_as_s390_architecture_modifiers, [2,26,0],,
4825 [ .machine z13+vx ],, 5069 [ .machine z13+vx ],,
4826 [AC_DEFINE(HAVE_AS_ARCHITECTURE_MODIFIERS, 1, 5070 [AC_DEFINE(HAVE_AS_ARCHITECTURE_MODIFIERS, 1,
4827 [Define if your assembler supports architecture modifiers.])]) 5071 [Define if your assembler supports architecture modifiers.])])
5072 gcc_GAS_CHECK_FEATURE([vector load/store alignment hints],
5073 gcc_cv_as_s390_vector_loadstore_alignment_hints, [2,31,0],,
5074 [ vl %v24,0(%r15),3 ],,
5075 [AC_DEFINE(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS, 1,
5076 [Define if your assembler supports vl/vst/vlm/vstm with an optional alignment hint argument.])])
5077
4828 ;; 5078 ;;
4829 esac 5079 esac
4830 5080
4831 # Mips and HP-UX need the GNU assembler. 5081 # Mips and HP-UX need the GNU assembler.
4832 # Linux on IA64 might be able to use the Intel assembler. 5082 # Linux on IA64 might be able to use the Intel assembler.
4851 # add some instruction here to (also) show we expect this might work. 5101 # add some instruction here to (also) show we expect this might work.
4852 # ??? Once 2.11 is released, probably need to add first known working 5102 # ??? Once 2.11 is released, probably need to add first known working
4853 # version to the per-target configury. 5103 # version to the per-target configury.
4854 case "$cpu_type" in 5104 case "$cpu_type" in
4855 aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | m32c | m68k \ 5105 aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | m32c | m68k \
4856 | microblaze | mips | nios2 | pa | riscv | rs6000 | score | sparc | spu \ 5106 | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
4857 | tilegx | tilepro | visium | xstormy16 | xtensa) 5107 | tilegx | tilepro | visium | xstormy16 | xtensa)
4858 insn="nop" 5108 insn="nop"
4859 ;; 5109 ;;
4860 ia64 | s390) 5110 ia64 | s390)
4861 insn="nop 0" 5111 insn="nop 0"
4872 gcc_GAS_CHECK_FEATURE([dwarf2 debug_line support], 5122 gcc_GAS_CHECK_FEATURE([dwarf2 debug_line support],
4873 gcc_cv_as_dwarf2_debug_line, 5123 gcc_cv_as_dwarf2_debug_line,
4874 [elf,2,11,0],, [$conftest_s], 5124 [elf,2,11,0],, [$conftest_s],
4875 [if test x$gcc_cv_objdump != x \ 5125 [if test x$gcc_cv_objdump != x \
4876 && $gcc_cv_objdump -h conftest.o 2> /dev/null \ 5126 && $gcc_cv_objdump -h conftest.o 2> /dev/null \
5127 | grep debug_line > /dev/null 2>&1; then
5128 gcc_cv_as_dwarf2_debug_line=yes
5129 elif test x$gcc_cv_otool != x \
5130 && $gcc_cv_otool -l conftest.o 2> /dev/null \
4877 | grep debug_line > /dev/null 2>&1; then 5131 | grep debug_line > /dev/null 2>&1; then
4878 gcc_cv_as_dwarf2_debug_line=yes 5132 gcc_cv_as_dwarf2_debug_line=yes
4879 fi]) 5133 fi])
4880 5134
4881 # The .debug_line file table must be in the exact order that 5135 # The .debug_line file table must be in the exact order that
5519 5773
5520 AC_MSG_CHECKING(linker mapfile support for clearing hardware capabilities) 5774 AC_MSG_CHECKING(linker mapfile support for clearing hardware capabilities)
5521 saved_LDFLAGS="$LDFLAGS" 5775 saved_LDFLAGS="$LDFLAGS"
5522 for clearcap_map in sol2-clearcapv2.map sol2-clearcap.map; do 5776 for clearcap_map in sol2-clearcapv2.map sol2-clearcap.map; do
5523 LDFLAGS="$saved_LDFLAGS -Wl,-M,${srcdir}/config/$clearcap_map" 5777 LDFLAGS="$saved_LDFLAGS -Wl,-M,${srcdir}/config/$clearcap_map"
5524 AC_LINK_IFELSE([int main(void) {return 0;}], 5778 AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
5525 [gcc_cv_ld_clearcap=yes; break], [gcc_cv_ld_clearcap=no]) 5779 [gcc_cv_ld_clearcap=yes; break], [gcc_cv_ld_clearcap=no])
5526 done 5780 done
5527 LDFLAGS="$saved_LDFLAGS" 5781 LDFLAGS="$saved_LDFLAGS"
5528 if test "x$gcc_cv_ld_clearcap" = xyes; then 5782 if test "x$gcc_cv_ld_clearcap" = xyes; then
5529 AC_DEFINE([HAVE_LD_CLEARCAP], 1, 5783 AC_DEFINE([HAVE_LD_CLEARCAP], 1,
5926 s390*-*-linux* | \ 6180 s390*-*-linux* | \
5927 alpha*-*-linux*) 6181 alpha*-*-linux*)
5928 AC_ARG_WITH(long-double-128, 6182 AC_ARG_WITH(long-double-128,
5929 [AS_HELP_STRING([--with-long-double-128], 6183 [AS_HELP_STRING([--with-long-double-128],
5930 [use 128-bit long double by default])], 6184 [use 128-bit long double by default])],
5931 gcc_cv_target_ldbl128="$with_long_double_128", 6185 gcc_cv_target_ldbl128="$with_long_double_128", [
6186 case "$target" in
6187 s390*-*-linux-musl*)
6188 gcc_cv_target_ldbl128=yes
6189 ;;
6190 powerpc*-*-linux-musl*)
6191 gcc_cv_target_ldbl128=no
6192 ;;
6193 *)]
5932 [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [ 6194 [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
5933 [gcc_cv_target_ldbl128=no 6195 [gcc_cv_target_ldbl128=no
5934 grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ 6196 grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
5935 $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \ 6197 $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
5936 && gcc_cv_target_ldbl128=yes 6198 && gcc_cv_target_ldbl128=yes
5937 ]])]) 6199 ]])]
6200 [
6201 ;;
6202 esac
6203 ])
5938 ;; 6204 ;;
5939 esac 6205 esac
5940 if test x$gcc_cv_target_ldbl128 = xyes; then 6206 if test x$gcc_cv_target_ldbl128 = xyes; then
5941 AC_DEFINE(TARGET_DEFAULT_LONG_DOUBLE_128, 1, 6207 AC_DEFINE(TARGET_DEFAULT_LONG_DOUBLE_128, 1,
5942 [Define if TFmode long double should be the default]) 6208 [Define if TFmode long double should be the default])
5990 if test x$gcc_cv_libc_provides_hwcap_in_tcb = xyes; then 6256 if test x$gcc_cv_libc_provides_hwcap_in_tcb = xyes; then
5991 AC_DEFINE(TARGET_LIBC_PROVIDES_HWCAP_IN_TCB, 1, 6257 AC_DEFINE(TARGET_LIBC_PROVIDES_HWCAP_IN_TCB, 1,
5992 [Define if your target C Library provides the AT_HWCAP value in the TCB]) 6258 [Define if your target C Library provides the AT_HWCAP value in the TCB])
5993 fi 6259 fi
5994 6260
6261 # Check if the target LIBC handles PT_GNU_STACK.
6262 gcc_cv_libc_gnustack=unknown
6263 case "$target" in
6264 mips*-*-linux*)
6265 GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
6266 ;;
6267 esac
6268 if test x$gcc_cv_libc_gnustack = xyes; then
6269 AC_DEFINE(TARGET_LIBC_GNUSTACK, 1,
6270 [Define if your target C Library properly handles PT_GNU_STACK])
6271 fi
6272
5995 AC_MSG_CHECKING(dl_iterate_phdr in target C library) 6273 AC_MSG_CHECKING(dl_iterate_phdr in target C library)
5996 gcc_cv_target_dl_iterate_phdr=unknown 6274 gcc_cv_target_dl_iterate_phdr=unknown
5997 case "$target" in 6275 case "$target" in
5998 # Restrict to Solaris 11+. While most of the Solaris 11 linker changes 6276 *-*-solaris2*)
5999 # were backported to Solaris 10 Update 10, dl_iterate_phdr only lives in
6000 # libdl there, both complicating its use and breaking compatibility
6001 # between Solaris 10 updates.
6002 *-*-solaris2.1[[1-9]]*)
6003 # <link.h> needs both a dl_iterate_phdr declaration and support for 6277 # <link.h> needs both a dl_iterate_phdr declaration and support for
6004 # compilation with largefile support. 6278 # compilation with largefile support.
6005 if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \ 6279 if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \
6006 && grep 'large file capable' $target_header_dir/link.h > /dev/null 2>&1; then 6280 && grep 'large file capable' $target_header_dir/link.h > /dev/null 2>&1; then
6007 gcc_cv_target_dl_iterate_phdr=yes 6281 gcc_cv_target_dl_iterate_phdr=yes
6098 # These (without "all_") are set in each config-lang.in. 6372 # These (without "all_") are set in each config-lang.in.
6099 # `language' must be a single word so is spelled singularly. 6373 # `language' must be a single word so is spelled singularly.
6100 all_languages= 6374 all_languages=
6101 all_compilers= 6375 all_compilers=
6102 all_outputs='Makefile' 6376 all_outputs='Makefile'
6103 # List of language makefile fragments. 6377 # List of language configure and makefile fragments.
6378 all_lang_configurefrags=
6104 all_lang_makefrags= 6379 all_lang_makefrags=
6105 # Additional files for gengtype 6380 # Additional files for gengtype
6106 all_gtfiles="$target_gtfiles" 6381 all_gtfiles="$target_gtfiles"
6107 6382
6108 # These are the languages that are set in --enable-languages, 6383 # These are the languages that are set in --enable-languages,
6186 done 6461 done
6187 ;; 6462 ;;
6188 esac 6463 esac
6189 $ok || continue 6464 $ok || continue
6190 6465
6466 all_lang_configurefrags="$all_lang_configurefrags \$(srcdir)/$gcc_subdir/config-lang.in"
6191 all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in" 6467 all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in"
6192 if test -f $srcdir/$gcc_subdir/lang.opt; then 6468 if test -f $srcdir/$gcc_subdir/lang.opt; then
6193 lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt" 6469 lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt"
6194 all_opt_files="$all_opt_files $srcdir/$gcc_subdir/lang.opt" 6470 all_opt_files="$all_opt_files $srcdir/$gcc_subdir/lang.opt"
6195 fi 6471 fi
6293 # Substitute configuration variables 6569 # Substitute configuration variables
6294 AC_SUBST(subdirs) 6570 AC_SUBST(subdirs)
6295 AC_SUBST(srcdir) 6571 AC_SUBST(srcdir)
6296 AC_SUBST(all_compilers) 6572 AC_SUBST(all_compilers)
6297 AC_SUBST(all_gtfiles) 6573 AC_SUBST(all_gtfiles)
6574 AC_SUBST(all_lang_configurefrags)
6298 AC_SUBST(all_lang_makefrags) 6575 AC_SUBST(all_lang_makefrags)
6299 AC_SUBST(all_languages) 6576 AC_SUBST(all_languages)
6300 AC_SUBST(all_selected_languages) 6577 AC_SUBST(all_selected_languages)
6301 AC_SUBST(build_exeext) 6578 AC_SUBST(build_exeext)
6302 AC_SUBST(build_install_headers_dir) 6579 AC_SUBST(build_install_headers_dir)
6341 AC_SUBST(tm_file_list) 6618 AC_SUBST(tm_file_list)
6342 AC_SUBST(tm_include_list) 6619 AC_SUBST(tm_include_list)
6343 AC_SUBST(tm_defines) 6620 AC_SUBST(tm_defines)
6344 AC_SUBST(tm_p_file_list) 6621 AC_SUBST(tm_p_file_list)
6345 AC_SUBST(tm_p_include_list) 6622 AC_SUBST(tm_p_include_list)
6623 AC_SUBST(tm_d_file_list)
6624 AC_SUBST(tm_d_include_list)
6346 AC_SUBST(xm_file_list) 6625 AC_SUBST(xm_file_list)
6347 AC_SUBST(xm_include_list) 6626 AC_SUBST(xm_include_list)
6348 AC_SUBST(xm_defines) 6627 AC_SUBST(xm_defines)
6349 AC_SUBST(use_gcc_stdint) 6628 AC_SUBST(use_gcc_stdint)
6350 AC_SUBST(c_target_objs) 6629 AC_SUBST(c_target_objs)
6351 AC_SUBST(cxx_target_objs) 6630 AC_SUBST(cxx_target_objs)
6352 AC_SUBST(fortran_target_objs) 6631 AC_SUBST(fortran_target_objs)
6632 AC_SUBST(d_target_objs)
6353 AC_SUBST(target_cpu_default) 6633 AC_SUBST(target_cpu_default)
6354 6634
6355 AC_SUBST_FILE(language_hooks) 6635 AC_SUBST_FILE(language_hooks)
6356 6636
6357 # Echo link setup. 6637 # Echo link setup.
6484 # Check if -fno-PIE works. 6764 # Check if -fno-PIE works.
6485 AC_CACHE_CHECK([for -fno-PIE option], 6765 AC_CACHE_CHECK([for -fno-PIE option],
6486 [gcc_cv_c_no_fpie], 6766 [gcc_cv_c_no_fpie],
6487 [saved_CXXFLAGS="$CXXFLAGS" 6767 [saved_CXXFLAGS="$CXXFLAGS"
6488 CXXFLAGS="$CXXFLAGS -fno-PIE" 6768 CXXFLAGS="$CXXFLAGS -fno-PIE"
6489 AC_COMPILE_IFELSE([int main(void) {return 0;}], 6769 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
6490 [gcc_cv_c_no_fpie=yes], 6770 [gcc_cv_c_no_fpie=yes],
6491 [gcc_cv_c_no_fpie=no]) 6771 [gcc_cv_c_no_fpie=no])
6492 CXXFLAGS="$saved_CXXFLAGS"]) 6772 CXXFLAGS="$saved_CXXFLAGS"])
6493 if test "$gcc_cv_c_no_fpie" = "yes"; then 6773 if test "$gcc_cv_c_no_fpie" = "yes"; then
6494 NO_PIE_CFLAGS="-fno-PIE" 6774 NO_PIE_CFLAGS="-fno-PIE"
6498 # Check if -no-pie works. 6778 # Check if -no-pie works.
6499 AC_CACHE_CHECK([for -no-pie option], 6779 AC_CACHE_CHECK([for -no-pie option],
6500 [gcc_cv_no_pie], 6780 [gcc_cv_no_pie],
6501 [saved_LDFLAGS="$LDFLAGS" 6781 [saved_LDFLAGS="$LDFLAGS"
6502 LDFLAGS="$LDFLAGS -no-pie" 6782 LDFLAGS="$LDFLAGS -no-pie"
6503 AC_LINK_IFELSE([int main(void) {return 0;}], 6783 AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
6504 [gcc_cv_no_pie=yes], 6784 [gcc_cv_no_pie=yes],
6505 [gcc_cv_no_pie=no]) 6785 [gcc_cv_no_pie=no])
6506 LDFLAGS="$saved_LDFLAGS"]) 6786 LDFLAGS="$saved_LDFLAGS"])
6507 if test "$gcc_cv_no_pie" = "yes"; then 6787 if test "$gcc_cv_no_pie" = "yes"; then
6508 NO_PIE_FLAG="-no-pie" 6788 NO_PIE_FLAG="-no-pie"