X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgcc.git;a=blobdiff_plain;f=configure;h=abd93a990a947f9e7f07d530d14f0ab8720ffa4c;hp=58979d6e3b119c426277139fca963f136440cef2;hb=HEAD;hpb=84401ce5fb4ecab55decb472b168100e7593e01f diff --git a/configure b/configure index 58979d6e3b11..3b0abeb8b2e4 100755 --- a/configure +++ b/configure @@ -613,12 +613,17 @@ DSYMUTIL_FOR_TARGET DLLTOOL_FOR_TARGET AS_FOR_TARGET AR_FOR_TARGET +GM2_FOR_TARGET GDC_FOR_TARGET GOC_FOR_TARGET GFORTRAN_FOR_TARGET GCC_FOR_TARGET CXX_FOR_TARGET CC_FOR_TARGET +RANLIB_PLUGIN_OPTION +AR_PLUGIN_OPTION +PKG_CONFIG_PATH +GDCFLAGS READELF OTOOL OBJDUMP @@ -684,7 +689,11 @@ get_gcc_base_ver extra_host_zlib_configure_flags extra_host_libiberty_configure_flags stage1_languages +host_libs_picflag +PICFLAG host_shared +gcc_host_pie +host_pie extra_linker_plugin_flags extra_linker_plugin_configure_flags islinc @@ -699,9 +708,14 @@ extra_mpc_gmp_configure_flags extra_mpfr_configure_flags gmpinc gmplibs +PGO_BUILD_LTO_CFLAGS +PGO_BUILD_USE_CFLAGS +PGO_BUILD_GEN_CFLAGS HAVE_CXX11_FOR_BUILD HAVE_CXX11 do_compare +CARGO +GDC GNATMAKE GNATBIND ac_ct_CXX @@ -714,7 +728,6 @@ CPPFLAGS LDFLAGS CFLAGS CC -extra_liboffloadmic_configure_flags target_subdir host_subdir build_subdir @@ -789,27 +802,30 @@ ac_user_opts=' enable_option_checking with_build_libsubdir with_system_zlib +with_zstd enable_as_accelerator_for enable_offload_targets enable_offload_defaulted enable_gold enable_ld +enable_gprofng enable_compressed_debug_sections +enable_default_compressed_debug_sections_algorithm +enable_year2038 enable_libquadmath enable_libquadmath_support enable_libada +enable_libgm2 enable_libssp enable_libstdcxx -enable_liboffloadmic enable_bootstrap +enable_pgo_build with_mpc with_mpc_include with_mpc_lib -with_mpfr_dir with_mpfr with_mpfr_include with_mpfr_lib -with_gmp_dir with_gmp with_gmp_include with_gmp_lib @@ -825,6 +841,7 @@ enable_isl_version_check enable_lto enable_linker_plugin_configure_flags enable_linker_plugin_flags +enable_host_pie enable_host_shared enable_stage1_languages enable_objc_gc @@ -877,6 +894,7 @@ GCC_FOR_TARGET GFORTRAN_FOR_TARGET GOC_FOR_TARGET GDC_FOR_TARGET +GM2_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET @@ -1530,18 +1548,24 @@ Optional Features: --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-ld[=ARG] build ld [ARG={default,yes,no}] + --enable-gprofng[=ARG] build gprofng [ARG={yes,no}] --enable-compressed-debug-sections={all,gas,gold,ld,none} Enable compressed debug sections for gas, gold or ld by default + --enable-default-compressed-debug-sections-algorithm={zlib,zstd} + Default compression algorithm for + --enable-compressed-debug-sections. + --enable-year2038 enable support for timestamps past the year 2038 --disable-libquadmath do not build libquadmath directory --disable-libquadmath-support disable libquadmath support for Fortran --enable-libada build libada directory + --enable-libgm2 build libgm2 directory --enable-libssp build libssp directory --disable-libstdcxx do not build libstdc++-v3 directory - --enable-liboffloadmic=ARG - build liboffloadmic [ARG={no,host,target}] --enable-bootstrap enable bootstrapping [yes if native build] + --enable-pgo-build[=lto] + enable the PGO build --disable-isl-version-check disable check for isl version --enable-lto enable link time optimization support @@ -1551,6 +1575,7 @@ Optional Features: --enable-linker-plugin-flags=FLAGS additional flags for configuring and building linker plugins [none] + --enable-host-pie build position independent host executables --enable-host-shared build host code as shared libraries --enable-stage1-languages[=all] choose additional languages to build during stage1. @@ -1575,19 +1600,19 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-libsubdir=DIR Directory where to find libraries for build system --with-system-zlib use installed libz + --with-zstd Support zstd compressed debug sections + (default=auto) --with-mpc=PATH specify prefix directory for installed MPC package. Equivalent to --with-mpc-include=PATH/include plus --with-mpc-lib=PATH/lib --with-mpc-include=PATH specify directory for installed MPC include files --with-mpc-lib=PATH specify directory for the installed MPC library - --with-mpfr-dir=PATH this option has been REMOVED --with-mpfr=PATH specify prefix directory for installed MPFR package. Equivalent to --with-mpfr-include=PATH/include plus --with-mpfr-lib=PATH/lib --with-mpfr-include=PATH specify directory for installed MPFR include files --with-mpfr-lib=PATH specify directory for the installed MPFR library - --with-gmp-dir=PATH this option has been REMOVED --with-gmp=PATH specify prefix directory for the installed GMP package. Equivalent to --with-gmp-include=PATH/include plus @@ -1673,6 +1698,8 @@ Some influential environment variables: GOC for the target GDC_FOR_TARGET GDC for the target + GM2_FOR_TARGET + GM2 for the target AR_FOR_TARGET AR for the target AS_FOR_TARGET @@ -2803,7 +2830,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes" # these libraries are used by various programs built for the host environment #f -host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libelf libiconv libctf" +host_libs="gettext libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe libgrust " # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -2811,7 +2838,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. # If --enable-gold is used, "gold" may replace "ld". -host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools c++tools" +host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gm2tools gotools c++tools" # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) @@ -2821,7 +2848,6 @@ target_libraries="target-libgcc \ target-libgloss \ target-newlib \ target-libgomp \ - target-liboffloadmic \ target-libatomic \ target-libitm \ target-libstdc++-v3 \ @@ -2833,7 +2859,9 @@ target_libraries="target-libgcc \ target-libffi \ target-libobjc \ target-libada \ + target-libgm2 \ target-libgo \ + target-libgrust \ target-libphobos \ target-zlib" @@ -2942,6 +2970,19 @@ if test x$with_system_zlib = xyes ; then noconfigdirs="$noconfigdirs zlib" fi +# Don't compile the bundled readline/libreadline.a if --with-system-readline +# is provided. +if test x$with_system_readline = xyes ; then + noconfigdirs="$noconfigdirs readline" +fi + + +# Check whether --with-zstd was given. +if test "${with_zstd+set}" = set; then : + withval=$with_zstd; +fi + + # some tools are so dependent upon X11 that if we're not building with X, # it's not even worth trying to configure, much less build, that tool. @@ -3038,7 +3079,7 @@ case "${ENABLE_GOLD}" in *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-nto* | *-*-nacl*) + | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-haiku*) case "${target}" in *-*-linux*aout* | *-*-linux*oldld*) ;; @@ -3097,6 +3138,22 @@ $as_echo "$as_me: WARNING: neither ld nor gold are enabled" >&2;} ;; esac +# Check whether --enable-gprofng was given. +if test "${enable_gprofng+set}" = set; then : + enableval=$enable_gprofng; enable_gprofng=$enableval +else + enable_gprofng=yes +fi + +if test "$enable_gprofng" = "yes"; then + case "${target}" in + x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*) + configdirs="$configdirs gprofng" + ;; + esac +fi + + # PR gas/19109 # Decide the default method for compressing debug sections. # Provide a configure time option to override our default. @@ -3112,6 +3169,15 @@ else fi +# Select default compression algorithm. +# Check whether --enable-default_compressed_debug_sections_algorithm was given. +if test "${enable_default_compressed_debug_sections_algorithm+set}" = set; then : + enableval=$enable_default_compressed_debug_sections_algorithm; +else + default_compressed_debug_sections_algorithm= +fi + + # Configure extra directories which are host specific case "${host}" in @@ -3133,6 +3199,20 @@ case "${host}" in ;; esac +# Default to --disable-year2038 until we can handle differences between +# projects that use gnulib (which understands year 2038) and projects that +# do not (like BFD). +# Check whether --enable-year2038 was given. +if test "${enable_year2038+set}" = set; then : + enableval=$enable_year2038; ENABLE_YEAR2038=$enableval +else + ENABLE_YEAR2038=no +fi + +enable_year2038= +if test "${ENABLE_YEAR2038}" = "no" ; then + enable_year2038=no +fi # Check whether --enable-libquadmath was given. if test "${enable_libquadmath+set}" = set; then : @@ -3170,6 +3250,17 @@ if test "${ENABLE_LIBADA}" != "yes" ; then noconfigdirs="$noconfigdirs gnattools" fi +# Check whether --enable-libgm2 was given. +if test "${enable_libgm2+set}" = set; then : + enableval=$enable_libgm2; ENABLE_LIBGM2=$enableval +else + ENABLE_LIBGM2=no +fi + +if test "${ENABLE_LIBGM2}" != "yes" ; then + noconfigdirs="$noconfigdirs gm2tools" +fi + # Check whether --enable-libssp was given. if test "${enable_libssp+set}" = set; then : enableval=$enable_libssp; ENABLE_LIBSSP=$enableval @@ -3189,44 +3280,6 @@ if test "${ENABLE_LIBSTDCXX}" = "no" ; then noconfigdirs="$noconfigdirs target-libstdc++-v3" fi -# If this is accelerator compiler and its target is intelmic we enable -# target liboffloadmic by default. If this is compiler with offloading -# for intelmic we enable host liboffloadmic by default. Otherwise -# liboffloadmic is disabled by default. -# Check whether --enable-liboffloadmic was given. -if test "${enable_liboffloadmic+set}" = set; then : - enableval=$enable_liboffloadmic; case "$enableval" in - no | host | target) - enable_liboffloadmic=$enableval ;; - *) - as_fn_error $? "--enable-liboffloadmic=no/host/target" "$LINENO" 5 ;; -esac -else - if test x"$enable_as_accelerator_for" != x; then - case "${target}" in - *-intelmic-* | *-intelmicemul-*) - enable_liboffloadmic=target - extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target" - ;; - *) - enable_liboffloadmic=no - ;; - esac -else - case "${enable_offload_targets}" in - *-intelmic-* | *-intelmicemul-*) - enable_liboffloadmic=host - extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host" - ;; - *) - enable_liboffloadmic=no - ;; - esac -fi -fi - - - # Enable libgomp by default on hosted POSIX systems, and a few others. if test x$enable_libgomp = x ; then case "${target}" in @@ -3265,25 +3318,6 @@ $as_echo "yes" >&6; } fi fi -# Disable liboffloadmic on unsupported systems. -if test -d ${srcdir}/liboffloadmic; then - if test x$enable_liboffloadmic != xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liboffloadmic support" >&5 -$as_echo_n "checking for liboffloadmic support... " >&6; } - if (srcdir=${srcdir}/liboffloadmic; \ - . ${srcdir}/configure.tgt; \ - test -n "$UNSUPPORTED") - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - noconfigdirs="$noconfigdirs target-liboffloadmic" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - fi -fi - # Disable libitm on unsupported systems. if test -d ${srcdir}/libitm; then if test x$enable_libitm = x; then @@ -3382,7 +3416,7 @@ case "${target}" in esac # Disable libstdc++-v3 for some systems. -# Allow user to override this if they pass --enable-libstdc++-v3 +# Allow user to override this if they pass --enable-libstdcxx if test "${ENABLE_LIBSTDCXX}" = "default" ; then case "${target}" in *-*-vxworks*) @@ -3638,6 +3672,9 @@ case "${target}" in i[3456789]86-*-*) libgloss_dir=i386 ;; + loongarch*-*-*) + libgloss_dir=loongarch + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) libgloss_dir=m68hc11 ;; @@ -3760,7 +3797,7 @@ case "${target}" in *-*-dragonfly*) ;; *-*-freebsd*) - if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \ + if test "x$with_gmp" = x \ && ! test -d ${srcdir}/gmp \ && test -f /usr/local/include/gmp.h; then with_gmp=/usr/local @@ -4022,6 +4059,11 @@ case "${target}" in wasm32-*-*) noconfigdirs="$noconfigdirs ld" ;; + loongarch*-*-linux*) + ;; + loongarch*-*-*) + noconfigdirs="$noconfigdirs gprof" + ;; esac # If we aren't building newlib, then don't build libgloss, since libgloss @@ -4067,9 +4109,6 @@ fi alpha*-linux*) host_makefile_frag="config/mh-alpha-linux" ;; - hppa*-hp-hpux10*) - host_makefile_frag="config/mh-pa-hpux10" - ;; hppa*-hp-hpux*) host_makefile_frag="config/mh-pa" ;; @@ -4092,7 +4131,7 @@ if test "${build}" != "${host}" ; then AR_FOR_BUILD=${AR_FOR_BUILD-ar} AS_FOR_BUILD=${AS_FOR_BUILD-as} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CPP)}" + CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil} GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} @@ -5593,12 +5632,16 @@ else GNATMAKE="$ac_cv_prog_GNATMAKE" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada" >&5 -$as_echo_n "checking whether compiler driver understands Ada... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada and is recent enough" >&5 +$as_echo_n "checking whether compiler driver understands Ada and is recent enough... " >&6; } if ${acx_cv_cc_gcc_supports_ada+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.adb <&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GDC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GDC"; then + ac_cv_prog_GDC="$GDC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GDC="${ac_tool_prefix}gdc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GDC=$ac_cv_prog_GDC +if test -n "$GDC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDC" >&5 +$as_echo "$GDC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_GDC"; then + ac_ct_GDC=$GDC + # Extract the first word of "gdc", so it can be a program name with args. +set dummy gdc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_GDC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_GDC"; then + ac_cv_prog_ac_ct_GDC="$ac_ct_GDC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GDC="gdc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_GDC=$ac_cv_prog_ac_ct_GDC +if test -n "$ac_ct_GDC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GDC" >&5 +$as_echo "$ac_ct_GDC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_GDC" = x; then + GDC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GDC=$ac_ct_GDC + fi +else + GDC="$ac_cv_prog_GDC" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5 +$as_echo_n "checking whether the D compiler works... " >&6; } +if ${acx_cv_d_compiler_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.d <&1 || echo failure` + if test x"$errors" = x && test -f conftest.$ac_objext; then + acx_cv_d_compiler_works=yes + fi + rm -f conftest.* +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5 +$as_echo "$acx_cv_d_compiler_works" >&6; } +if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then + have_gdc=yes +else + have_gdc=no +fi + +for ac_prog in cargo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CARGO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CARGO"; then + ac_cv_prog_CARGO="$CARGO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CARGO="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CARGO=$ac_cv_prog_CARGO +if test -n "$CARGO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CARGO" >&5 +$as_echo "$CARGO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CARGO" && break +done +test -n "$CARGO" || CARGO="no" + +if test "x$CARGO" != xno; then + have_cargo=yes +else + have_cargo=no +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to compare bootstrapped objects" >&5 $as_echo_n "checking how to compare bootstrapped objects... " >&6; } if ${gcc_cv_prog_cmp_skip+:} false; then : @@ -7708,6 +7918,91 @@ $as_echo "#define HAVE_CXX11_FOR_BUILD 1" >>confdefs.h fi fi +# Check whether --enable-pgo-build was given. +if test "${enable_pgo_build+set}" = set; then : + enableval=$enable_pgo_build; enable_pgo_build=$enableval +else + enable_pgo_build=no +fi + + +# Issue errors and warnings for invalid/strange PGO build combinations. +case "$have_compiler:$host:$target:$enable_pgo_build" in + *:*:*:no) ;; + + # Allow the PGO build only if we aren't building a compiler and + # we are in a native configuration. + no:$build:$build:yes | no:$build:$build:lto) ;; + + # Disallow the PGO bootstrap if we are building a compiler. + yes:*:*:yes | yes:*:*:lto) + as_fn_error $? "cannot perform the PGO bootstrap when building a compiler" "$LINENO" 5 ;; + + *) + as_fn_error $? "invalid option for --enable-pgo-build" "$LINENO" 5 + ;; +esac + +if test "$enable_pgo_build" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fprofile-generate" >&5 +$as_echo_n "checking whether the compiler supports -fprofile-generate... " >&6; } + old_CFLAGS="$CFLAGS" + PGO_BUILD_GEN_CFLAGS="-fprofile-generate" + CFLAGS="$CFLAGS $PGO_BUILD_CFLAGS" + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + PGO_BUILD_GEN_CFLAGS= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$old_CFLAGS" + if test -n "$PGO_BUILD_GEN_CFLAGS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + PGO_BUILD_USE_CFLAGS="-fprofile-use" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "cannot perform the PGO build without -fprofile-generate" "$LINENO" 5 + fi + + if test "$enable_pgo_build" = "lto"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -flto=jobserver -ffat-lto-objects" >&5 +$as_echo_n "checking whether the compiler supports -flto=jobserver -ffat-lto-objects... " >&6; } + old_CFLAGS="$CFLAGS" + PGO_BUILD_LTO_CFLAGS="-flto=jobserver -ffat-lto-objects" + CFLAGS="$CFLAGS $PGO_BUILD_LTO_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + PGO_BUILD_LTO_CFLAGS= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$old_CFLAGS" + if test -n "$PGO_BUILD_LTO_CFLAGS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LTO is disabled for the PGO build" >&5 +$as_echo "$as_me: WARNING: LTO is disabled for the PGO build" >&2;} + fi + fi +fi + + + + # Used for setting $lt_cv_objdir { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } @@ -7739,7 +8034,22 @@ _ACEOF # Check for GMP, MPFR and MPC -gmplibs="-lmpc -lmpfr -lgmp" +require_gmp=no +require_mpc=no +if test -d ${srcdir}/gcc ; then + require_gmp=yes + require_mpc=yes +fi +if test -d ${srcdir}/gdb ; then + if test "x$enable_gdb" != xno; then + require_gmp=yes + fi +fi + +gmplibs="-lmpfr -lgmp" +if test x"$require_mpc" = "xyes" ; then + gmplibs="-lmpc $gmplibs" +fi gmpinc= have_gmp=no @@ -7787,14 +8097,6 @@ fi # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. -# Check whether --with-mpfr-dir was given. -if test "${with_mpfr_dir+set}" = set; then : - withval=$with_mpfr_dir; as_fn_error $? "The --with-mpfr-dir=PATH option has been removed. -Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" "$LINENO" 5 -fi - - - # Check whether --with-mpfr was given. if test "${with_mpfr+set}" = set; then : withval=$with_mpfr; @@ -7840,14 +8142,6 @@ fi # Specify a location for gmp -# Check whether --with-gmp-dir was given. -if test "${with_gmp_dir+set}" = set; then : - withval=$with_gmp_dir; as_fn_error $? "The --with-gmp-dir=PATH option has been removed. -Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" "$LINENO" 5 -fi - - - # Check whether --with-gmp was given. if test "${with_gmp+set}" = set; then : withval=$with_gmp; @@ -7890,15 +8184,14 @@ if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; have_gmp=yes fi -if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then +if test "x$require_gmp" = xyes && test "x$have_gmp" = xno; then have_gmp=yes saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $gmpinc" # Check for the recommended and required versions of GMP. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of gmp.h" >&5 $as_echo_n "checking for the correct version of gmp.h... " >&6; } - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "gmp.h" int @@ -8001,7 +8294,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # Check for the MPC header version. - if test x"$have_gmp" = xyes ; then + if test "x$require_mpc" = xyes && test x"$have_gmp" = xyes ; then # Check for the recommended and required versions of MPC. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of mpc.h" >&5 $as_echo_n "checking for the correct version of mpc.h... " >&6; } @@ -8055,18 +8348,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x"$have_gmp" = xyes; then saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the gmp/mpfr/mpc libraries" >&5 -$as_echo_n "checking for the correct version of the gmp/mpfr/mpc libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the gmp/mpfr libraries" >&5 +$as_echo_n "checking for the correct version of the gmp/mpfr libraries... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { mpfr_t n; mpfr_t x; - mpc_t c; int t; mpfr_init (n); mpfr_init (x); @@ -8075,6 +8367,37 @@ main () mpfr_subnormalize (x, t, MPFR_RNDN); mpfr_clear(n); mpfr_clear(x); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; have_gmp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$saved_LIBS" + fi + + # Now check the MPC library + if test "x$require_mpc" = xyes && test x"$have_gmp" = xyes; then + saved_LIBS="$LIBS" + LIBS="$LIBS $gmplibs" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the mpc libraries" >&5 +$as_echo_n "checking for the correct version of the mpc libraries... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + mpc_t c; mpc_init2 (c, 53); mpc_set_ui_ui (c, 1, 1, MPC_RNDNN); mpc_cosh (c, c, MPC_RNDNN); @@ -8103,7 +8426,8 @@ rm -f core conftest.err conftest.$ac_objext \ # The library versions listed in the error message below should match # the HARD-minimums enforced above. if test x$have_gmp != xyes; then - as_fn_error $? "Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+. + if test -d ${srcdir}/gcc ; then + as_fn_error $? "Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+. Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify their locations. Source code for these libraries can be found at their respective hosting sites as well as at @@ -8112,6 +8436,13 @@ http://gcc.gnu.org/install/prerequisites.html for additional info. If you obtained GMP, MPFR and/or MPC from a vendor distribution package, make sure that you have installed both the libraries and the header files. They may be located in separate packages." "$LINENO" 5 + else + as_fn_error $? "Building GDB requires GMP 4.2+, and MPFR 3.1.0+. +Try the --with-gmp and/or --with-mpfr options to specify +their locations. If you obtained GMP and/or MPFR from a vendor +distribution package, make sure that you have installed both the libraries +and the header files. They may be located in separate packages." "$LINENO" 5 + fi fi fi @@ -8211,6 +8542,20 @@ else fi fi +case $target in + *-darwin2* | *-darwin1[56789]*) + # For these versions, we default to using embedded rpaths. + if test "x$enable_darwin_at_rpath" != "xno"; then + poststage1_ldflags="$poststage1_ldflags -nodefaultrpaths" + fi + ;; + *-darwin*) + # For these versions, we only use embedded rpaths on demand. + if test "x$enable_darwin_at_rpath" = "xyes"; then + poststage1_ldflags="$poststage1_ldflags -nodefaultrpaths" + fi + ;; +esac # GCC GRAPHITE dependency isl. @@ -8442,17 +8787,103 @@ fi +# Handle --enable-host-pie +# If host PIE executables are the default (or must be forced on) for some host, +# we must pass that configuration to the gcc directory. +gcc_host_pie= +# Check whether --enable-host-pie was given. +if test "${enable_host_pie+set}" = set; then : + enableval=$enable_host_pie; host_pie=$enableval + case $host in + *-*-darwin2*) + if test x$host_pie != xyes ; then + # for Darwin20+ this is required. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PIE executables are required for the configured host, host-pie setting ignored." >&5 +$as_echo "$as_me: WARNING: PIE executables are required for the configured host, host-pie setting ignored." >&2;} + host_pie=yes + gcc_host_pie=--enable-host-pie + fi ;; + *) ;; + esac +else + case $host in + *-*-darwin2*) + # Default to PIE (mandatory for aarch64). + host_pie=yes + gcc_host_pie=--enable-host-pie + ;; + *) host_pie=no ;; + esac +fi + + + + + # Enable --enable-host-shared. # Checked early to determine whether jit is an 'all' language # Check whether --enable-host-shared was given. if test "${enable_host_shared+set}" = set; then : enableval=$enable_host_shared; host_shared=$enableval + case $host in + x86_64-*-darwin* | aarch64-*-darwin*) + if test x$host_shared != xyes ; then + # PIC is the default, and actually cannot be switched off. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PIC code is required for the configured host; host-shared setting ignored." >&5 +$as_echo "$as_me: WARNING: PIC code is required for the configured host; host-shared setting ignored." >&2;} + host_shared=yes + fi ;; + *-*-darwin*) + if test x$host_pie = xyes -a x$host_shared != xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PIC code is required for PIE host executables host-shared setting ignored." >&5 +$as_echo "$as_me: WARNING: PIC code is required for PIE host executables host-shared setting ignored." >&2;} + host_shared=yes + fi ;; + *) ;; + esac +else + case $host in + # 64B x86_64 and Aarch64 Darwin default to PIC. + x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;; + # 32B and powerpc64 Darwin must use PIC to link PIE exes. + *-*-darwin*) host_shared=$host_pie ;; + *) host_shared=no;; + esac +fi + + + + +if test x$host_shared = xyes; then + case $host in + *-*-darwin*) + # Since host shared is the default for 64b Darwin, and also enabled for + # host_pie, ensure that we present the PIE flag when host_pie is active. + if test x$host_pie = xyes; then + PICFLAG=-fPIE + fi + ;; + *) + PICFLAG=-fPIC + ;; + esac +elif test x$host_pie = xyes; then + PICFLAG=-fPIE else - host_shared=no + PICFLAG= fi +# If we are building PIC/PIE host executables, and we are building dependent +# libs (e.g. GMP) in-tree those libs need to be configured to generate PIC +# code. +host_libs_picflag= +if test "$host_shared" = "yes" -o "$host_pie" = "yes"; then +host_libs_picflag='--with-pic' +fi + + # By default, C and C++ are the only stage 1 languages. stage1_languages=,c, @@ -8667,6 +9098,23 @@ $as_echo "$as_me: WARNING: GNAT is required to build $language" >&2;} ;; esac + # Disable D if no preexisting GDC is available. + case ${add_this_lang}:${language}:${have_gdc} in + yes:d:no) + # Specifically requested language; tell them. + as_fn_error $? "GDC is required to build $language" "$LINENO" 5 + ;; + all:d:no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GDC is required to build $language" >&5 +$as_echo "$as_me: WARNING: GDC is required to build $language" >&2;} + add_this_lang=unsupported + ;; + *:d:no) + # Silently disable. + add_this_lang=unsupported + ;; + esac + # Disable jit if -enable-host-shared not specified # but not if building for Mingw. All code in Windows # is position independent code (PIC). @@ -8700,6 +9148,37 @@ $as_echo "$as_me: WARNING: --enable-host-shared required to build $language" >&2 ;; esac + # Pre-conditions to consider whether cargo being supported. + if test x"$have_cargo" = xyes \ + && test x"$build" != x"$host"; then + # Until + # "'cargo' should build for the host system" is resolved: + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: use of cargo not yet supported here in Canadian cross configurations" >&5 +$as_echo "$as_me: WARNING: use of cargo not yet supported here in Canadian cross configurations" >&2;} + have_cargo=no + else + # Assume that cargo-produced object files are compatible with what + # we're going to build here. + : + fi + # Disable Rust if cargo is unavailable. + case ${add_this_lang}:${language}:${have_cargo} in + yes:rust:no) + # Specifically requested language; tell them. + as_fn_error $? "cargo is required to build $language" "$LINENO" 5 + ;; + all:rust:no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cargo is required to build $language" >&5 +$as_echo "$as_me: WARNING: cargo is required to build $language" >&2;} + add_this_lang=unsupported + ;; + *:rust:no) + # Silently disable. + add_this_lang=unsupported + ;; + esac + + # Disable a language that is unsupported by the target. case "${add_this_lang}: $unsupported_languages " in no:*) ;; @@ -8736,7 +9215,7 @@ $as_echo "$as_me: WARNING: ${language} not supported for this target" >&2;} *) stage1_languages="${stage1_languages}${language}," ;; esac # We need to bootstrap any supporting libraries. - bootstrap_target_libs="${bootstrap_target_libs}${target_libs}," + bootstrap_target_libs=`echo "${bootstrap_target_libs}${target_libs}," | sed "s/ /,/g"` ;; esac ;; @@ -8861,7 +9340,7 @@ $as_echo "using paths configured with --with-target-bdw-gc options" >&6; } fi esac -# Disable libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++ +# Disable libitm, libsanitizer, libvtv if we're not building C++ case ,${enable_languages}, in *,c++,*) # Disable libitm, libsanitizer if we're not building libstdc++ @@ -8873,7 +9352,18 @@ case ,${enable_languages}, in esac ;; *) - noconfigdirs="$noconfigdirs target-liboffloadmic target-libitm target-libsanitizer target-libvtv" + noconfigdirs="$noconfigdirs target-libitm target-libsanitizer target-libvtv" + ;; +esac + +case ,${enable_languages}, in + *,rust,*) + case " ${noconfigdirs} " in + *\ target-libstdc++-v3\ *) + # Disable target libgrust if we're not building target libstdc++. + noconfigdirs="$noconfigdirs target-libgrust" + ;; + esac ;; esac @@ -8972,13 +9462,18 @@ fi # Sometimes we have special requirements for the host libiberty. extra_host_libiberty_configure_flags= -extra_host_zlib_configure_flags= case " $configdirs " in - *" lto-plugin "* | *" libcc1 "*) + *" lto-plugin "* | *" libcc1 "* | *" gdbserver "*) # When these are to be built as shared libraries, the same applies to # libiberty. extra_host_libiberty_configure_flags=--enable-shared ;; +esac + + +# Sometimes we have special requirements for the host zlib. +extra_host_zlib_configure_flags= +case " $configdirs " in *" bfd "*) # When bfd is to be built as a shared library, the same applies to # zlib. @@ -8989,7 +9484,6 @@ case " $configdirs " in esac - # Produce a warning message for the subdirs we can't configure. # This isn't especially interesting in the Cygnus tree, but in the individual # FSF releases, it's important to let people know when their machine isn't @@ -9295,6 +9789,12 @@ case "${target}" in spu-*-*) target_makefile_frag="config/mt-spu" ;; + loongarch*-*linux* | loongarch*-*gnu*) + target_makefile_frag="config/mt-loongarch-gnu" + ;; + loongarch*-*elf*) + target_makefile_frag="config/mt-loongarch-elf" + ;; mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) target_makefile_frag="config/mt-sde" ;; @@ -9505,6 +10005,16 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 && bootstrap_target_libs=${bootstrap_target_libs}target-libvtv, fi +# If we are building libatomic and the list of enabled languages includes the +# D frontend, bootstrap it. +if echo " ${target_configdirs} " | grep " libatomic " > /dev/null 2>&1; then + case ,${enable_languages}, in + *,d,*) + bootstrap_target_libs=${bootstrap_target_libs}target-libatomic, + ;; + esac +fi + # Determine whether gdb needs tk/tcl or not. # Use 'maybe' since enable_gdbtk might be true even if tk isn't available # and in that case we want gdb to be built without tk. Ugh! @@ -9637,6 +10147,12 @@ extrasub_target="$extrasub_target /^@unless /d /^@endunless /d" +if test "$enable_pgo_build" != "no"; then + extrasub_build="$extrasub_build +/^@if pgo-build\$/d +/^@endif pgo-build\$/d" +fi + # Create the serialization dependencies. This uses a temporary file. # Check whether --enable-serial-configure was given. @@ -9656,7 +10172,9 @@ esac # These force 'configure's to be done one at a time, to avoid problems # with contention over a shared config.cache. rm -f serdep.tmp +if test "x${enable_serial_build_configure}" = xyes || test "x${enable_serial_host_configure}" = xyes || test "x${enable_serial_target_configure}" = xyes; then echo '# serdep.tmp' > serdep.tmp +fi olditem= test "x${enable_serial_build_configure}" = xyes && for item in ${build_configdirs} ; do @@ -9694,7 +10212,8 @@ serialization_dependencies=serdep.tmp # files altogether, and which should be passed on to subconfigures. # Also strip program-prefix, program-suffix, and program-transform-name, # so that we can pass down a consistent program-transform-name. -baseargs= +hbaseargs= +bbaseargs= tbaseargs= keep_next=no skip_next=no @@ -9710,7 +10229,8 @@ do *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - baseargs="$baseargs '$ac_arg'" + hbaseargs="$hbaseargs '$ac_arg'" + bbaseargs="$bbaseargs '$ac_arg'" tbaseargs="$tbaseargs '$ac_arg'" keep_next=no continue @@ -9734,6 +10254,7 @@ do esac skip_targ=no + skip_barg=no case $ac_arg in --with-* | --without-*) @@ -9746,6 +10267,12 @@ do *[-_]lib) lib=`echo "$libopt" | sed 's,[-_]lib$,,'` ;; + *[-_]prefix) + lib=`echo "$libopt" | sed 's,[-_]prefix$,,'` + ;; + *[-_]type) + lib=`echo "$libopt" | sed 's,[-_]type$,,'` + ;; *) lib=$libopt ;; @@ -9762,6 +10289,11 @@ do skip_targ=yes fi ;; + libintl | libiconv) + # We don't want libintl (and co.) in anything but the host arguments. + skip_targ=yes + skip_barg=yes + ;; esac ;; esac @@ -9770,7 +10302,8 @@ do --cache-file=/dev/null | \ -cache-file=/dev/null ) # Handled here to avoid the test to skip args below. - baseargs="$baseargs '$ac_arg'" + hbaseargs="$hbaseargs '$ac_arg'" + bbaseargs="$bbaseargs '$ac_arg'" tbaseargs="$tbaseargs '$ac_arg'" # Assert: $separate_arg should always be no. keep_next=$separate_arg @@ -9801,7 +10334,10 @@ do *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - baseargs="$baseargs '$ac_arg'" + hbaseargs="$hbaseargs '$ac_arg'" + if test X"$skip_barg" = Xno; then + bbaseargs="$bbaseargs '$ac_arg'" + fi if test X"$skip_targ" = Xno; then tbaseargs="$tbaseargs '$ac_arg'" fi @@ -9816,7 +10352,8 @@ do done # Remove the initial space we just introduced and, as these will be # expanded by make, quote '$'. -baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` +hbaseargs=`echo "x$hbaseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` +bbaseargs=`echo "x$bbaseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # Add in --program-transform-name, after --program-prefix and # --program-suffix have been applied to it. Autoconf has already @@ -9830,15 +10367,24 @@ ${program_transform_name} EOF_SED gcc_transform_name=`cat conftestsed.out` rm -f conftestsed.out -baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" +hbaseargs="$hbaseargs --program-transform-name='${gcc_transform_name}'" +bbaseargs="$bbaseargs --program-transform-name='${gcc_transform_name}'" tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'" if test "$silent" = yes; then - baseargs="$baseargs --silent" + bbaseargs="$bbaseargs --silent" + hbaseargs="$hbaseargs --silent" tbaseargs="$tbaseargs --silent" fi -baseargs="$baseargs --disable-option-checking" + +bbaseargs="$bbaseargs --disable-option-checking" +hbaseargs="$hbaseargs --disable-option-checking" tbaseargs="$tbaseargs --disable-option-checking" +if test "$enable_year2038" = no; then + baseargs="$baseargs --disable-year2038" + tbaseargs="$tbaseargs --disable-year2038" +fi + # Record and document user additions to sub configure arguments. @@ -9849,7 +10395,7 @@ tbaseargs="$tbaseargs --disable-option-checking" # desired. We can't even use the same cache file for all build-side # libraries, as they're compiled differently; some with C, some with # C++ or with different feature-enabling options. -build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}" +build_configargs="$build_configargs --cache-file=./config.cache ${bbaseargs}" # For host modules, accept cache file option, or specification as blank. case "${cache_file}" in @@ -9863,7 +10409,7 @@ esac # Host dirs don't like to share a cache file either, horribly enough. # This seems to be due to autoconf 2.5x stupidity. -host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}" +host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${hbaseargs}" target_configargs="$target_configargs ${tbaseargs}" @@ -10027,6 +10573,17 @@ case "${target}" in mep*) FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary" ;; + # The VxWorks support for shared libraries is getting in + # incrementally. Make sure it doesn't get activated implicitly: + *vxworks*) + if test "${enable_shared-unset}" = unset ; then + enable_shared=no + # So the build of libraries knows ... + target_configargs="${target_configargs} --disable-shared" + # So gcc knows ... + host_configargs="${host_configargs} --disable-shared" + fi + ;; esac # Makefile fragments. @@ -10083,6 +10640,8 @@ done + + # Generate default definitions for YACC, M4, LEX and other programs that run # on the build machine. These are used if the Makefile can't locate these # programs in objdir. @@ -12600,6 +13159,150 @@ fi + +GDCFLAGS=${GDCFLAGS-${CFLAGS}} + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +$as_echo_n "checking for -plugin option... " >&6; } + +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +plugin_option= +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 +fi +touch conftest.c +${AR} $plugin_option rc conftest.a conftest.c +if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_option= +fi +rm -f conftest.* +if test -n "$plugin_option"; then + PLUGIN_OPTION="$plugin_option" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +$as_echo "$plugin_option" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +AR_PLUGIN_OPTION= +RANLIB_PLUGIN_OPTION= +if test -n "$PLUGIN_OPTION"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR_PLUGIN_OPTION="$PLUGIN_OPTION" + fi + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" + fi +fi + + + # Target tools. # Check whether --with-build-time-tools was given. @@ -13580,6 +14283,167 @@ fi +if test -n "$GM2_FOR_TARGET"; then + ac_cv_prog_GM2_FOR_TARGET=$GM2_FOR_TARGET +elif test -n "$ac_cv_prog_GM2_FOR_TARGET"; then + GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GM2_FOR_TARGET"; then + for ncn_progname in gm2; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GM2_FOR_TARGET"; then + ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GM2_FOR_TARGET="${ncn_progname}" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET +if test -n "$GM2_FOR_TARGET"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5 +$as_echo "$GM2_FOR_TARGET" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + done +fi + +if test -z "$ac_cv_prog_GM2_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gm2; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ncn_progname} in $with_build_time_tools" >&5 +$as_echo_n "checking for ${ncn_progname} in $with_build_time_tools... " >&6; } + if test -x $with_build_time_tools/${ncn_progname}; then + ac_cv_prog_GM2_FOR_TARGET=$with_build_time_tools/${ncn_progname} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + break + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + done +fi + +if test -z "$ac_cv_prog_GM2_FOR_TARGET"; then + for ncn_progname in gm2; do + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GM2_FOR_TARGET"; then + ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GM2_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET +if test -n "$GM2_FOR_TARGET"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5 +$as_echo "$GM2_FOR_TARGET" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + if test -z "$ac_cv_prog_GM2_FOR_TARGET" && test $build = $target ; then + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GM2_FOR_TARGET"; then + ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GM2_FOR_TARGET="${ncn_progname}" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET +if test -n "$GM2_FOR_TARGET"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5 +$as_echo "$GM2_FOR_TARGET" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + test -n "$ac_cv_prog_GM2_FOR_TARGET" && break + done +fi + +if test -z "$ac_cv_prog_GM2_FOR_TARGET" ; then + set dummy gm2 + if test $build = $target ; then + GM2_FOR_TARGET="$2" + else + GM2_FOR_TARGET="${ncn_target_tool_prefix}$2" + fi +else + GM2_FOR_TARGET="$ac_cv_prog_GM2_FOR_TARGET" +fi + + + cat > conftest.c << \EOF #ifdef __GNUC__ gcc_yay; @@ -17512,6 +18376,51 @@ $as_echo "pre-installed" >&6; } fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gm2" >&5 +$as_echo_n "checking where to find the target gm2... " >&6; } +if test "x${build}" != "x${host}" ; then + if expr "x$GM2_FOR_TARGET" : "x/" > /dev/null; then + # We already found the complete path + ac_dir=`dirname $GM2_FOR_TARGET` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 +$as_echo "pre-installed in $ac_dir" >&6; } + else + # Canadian cross, just use what we found + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 +$as_echo "pre-installed" >&6; } + fi +else + ok=yes + case " ${configdirs} " in + *" gcc "*) ;; + *) ok=no ;; + esac + case ,${enable_languages}, in + *,m2,*) ;; + *) ok=no ;; + esac + if test $ok = yes; then + # An in-tree tool is available and we can use it + GM2_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gm2 -B$$r/$(HOST_SUBDIR)/gcc/' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5 +$as_echo "just compiled" >&6; } + elif expr "x$GM2_FOR_TARGET" : "x/" > /dev/null; then + # We already found the complete path + ac_dir=`dirname $GM2_FOR_TARGET` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 +$as_echo "pre-installed in $ac_dir" >&6; } + elif test "x$target" = "x$host"; then + # We can use an host tool + GM2_FOR_TARGET='$(GM2)' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5 +$as_echo "host tool" >&6; } + else + # We need a cross tool + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 +$as_echo "pre-installed" >&6; } + fi +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ld" >&5 $as_echo_n "checking where to find the target ld... " >&6; } if test "x${build}" != "x${host}" ; then @@ -18073,9 +18982,11 @@ fi # Specify what files to not compare during bootstrap. compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*" +compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/M2Version*" +compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/SYSTEM*" +compare_exclusions="$compare_exclusions | gcc/m2/gm2version*" case "$target" in hppa*64*-*-hpux*) ;; - hppa*-*-hpux*) compare_exclusions="$compare_exclusions | */libgcc/lib2funcs* | gcc/function-tests.o" ;; powerpc*-ibm-aix*) compare_exclusions="$compare_exclusions | *libgomp*\$(objext)" ;; esac