diff options
Diffstat (limited to 'contrib/gcc/configure.in')
-rw-r--r-- | contrib/gcc/configure.in | 777 |
1 files changed, 555 insertions, 222 deletions
diff --git a/contrib/gcc/configure.in b/contrib/gcc/configure.in index d9a0d29..07a9b93 100644 --- a/contrib/gcc/configure.in +++ b/contrib/gcc/configure.in @@ -1,7 +1,8 @@ # configure.in for GCC # Process this file with autoconf to generate a configuration script. -# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. #This file is part of GCC. @@ -176,6 +177,88 @@ changequote([, ])dnl fi fi +# Determine the host, build, and target systems +AC_CANONICAL_SYSTEM + +# Set program_transform_name +AC_ARG_PROGRAM + +# Find the native compiler +AC_PROG_CC +AC_PROG_CC_C_O +# autoconf is lame and doesn't give us any substitution variable for this. +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then + NO_MINUS_C_MINUS_O=yes +else + OUTPUT_OPTION='-o $@' +fi +AC_SUBST(NO_MINUS_C_MINUS_O) +AC_SUBST(OUTPUT_OPTION) + +# See if GNAT has been installed +gcc_AC_PROG_GNAT + +AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long, +ac_cv_prog_cc_no_long_long, +[save_CFLAGS="$CFLAGS" +CFLAGS="-Wno-long-long" +AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes, + ac_cv_prog_cc_no_long_long=no) +CFLAGS="$save_CFLAGS"]) + +if test x$have_gnat != xno ; then +AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long, +ac_cv_prog_adac_no_long_long, +[cat >conftest.adb <<EOF +procedure conftest is begin null; end conftest; +EOF +if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then + ac_cv_prog_adac_no_long_long=yes +else + ac_cv_prog_adac_no_long_long=no +fi +rm -f conftest*]) +else + ac_cv_prog_adac_no_long_long=yes +fi + +strict1_warn= +if test $ac_cv_prog_cc_no_long_long = yes && \ + test $ac_cv_prog_adac_no_long_long = yes ; then + strict1_warn="-pedantic -Wno-long-long" +fi +AC_SUBST(strict1_warn) + +AC_PROG_CPP +AC_C_INLINE +gcc_AC_C_VOLATILE + +gcc_AC_C_LONG_DOUBLE +gcc_AC_C_LONG_LONG +gcc_AC_C__BOOL + +# sizeof(char) is 1 by definition. +gcc_AC_COMPILE_CHECK_SIZEOF(short) +gcc_AC_COMPILE_CHECK_SIZEOF(int) +gcc_AC_COMPILE_CHECK_SIZEOF(long) +if test $ac_cv_c_long_long = yes; then + gcc_AC_COMPILE_CHECK_SIZEOF(long long) +fi +if test $ac_cv_c___int64 = yes; then + gcc_AC_COMPILE_CHECK_SIZEOF(__int64) +fi + +gcc_AC_C_CHARSET + +# If the native compiler is GCC, we can enable warnings even in stage1. +# That's useful for people building cross-compilers, or just running a +# quick `make'. +warn_cflags= +if test "x$GCC" = "xyes"; then + warn_cflags='$(GCC_WARN_CFLAGS)' +fi +AC_SUBST(warn_cflags) + # Determine whether or not multilibs are enabled. AC_ARG_ENABLE(multilib, [ --enable-multilib enable library support for multiple ABIs], @@ -187,15 +270,17 @@ AC_ARG_ENABLE(checking, [ --enable-checking[=LIST] enable expensive run-time checks. With LIST, enable only specific categories of checks. - Categories are: misc,tree,rtl,gc,gcac; default - is misc,tree,gc], + Categories are: misc,tree,rtl,rtlflag,gc,gcac; + default is misc,tree,gc,rtlflag], [ac_checking= ac_tree_checking= ac_rtl_checking= +ac_rtlflag_checking= ac_gc_checking= ac_gc_always_collect= case "${enableval}" in -yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;; +yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ; + ac_rtlflag_checking=1 ;; no) ;; *) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," set fnord $enableval; shift @@ -205,9 +290,11 @@ no) ;; case $check in misc) ac_checking=1 ;; tree) ac_tree_checking=1 ;; + rtlflag) ac_rtlflag_checking=1 ;; rtl) ac_rtl_checking=1 ;; gc) ac_gc_checking=1 ;; gcac) ac_gc_always_collect=1 ;; + valgrind) ac_checking_valgrind=1 ;; *) AC_MSG_ERROR(unknown check category $check) ;; esac done @@ -215,11 +302,14 @@ no) ;; esac ], []) +nocommon_flag="" if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks.]) + nocommon_flag=-fno-common fi +AC_SUBST(nocommon_flag) if test x$ac_tree_checking != x ; then AC_DEFINE(ENABLE_TREE_CHECKING, 1, [Define if you want all operations on trees (the basic data @@ -232,6 +322,12 @@ if test x$ac_rtl_checking != x ; then of the optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive.]) fi +if test x$ac_rtlflag_checking != x ; then + AC_DEFINE(ENABLE_RTL_FLAG_CHECKING, 1, +[Define if you want RTL flag accesses to be checked against the RTL + codes that are supported for each access macro. This is relatively + cheap.]) +fi if test x$ac_gc_checking != x ; then AC_DEFINE(ENABLE_GC_CHECKING, 1, [Define if you want the garbage collector to do object poisoning and @@ -243,11 +339,47 @@ if test x$ac_gc_always_collect != x ; then paranoid mode, validating the entire heap and collecting garbage at every opportunity. This is extremely expensive.]) fi - - -AC_ARG_ENABLE(cpp, -[ --disable-cpp don't provide a user-visible C preprocessor], -[], [enable_cpp=yes]) +valgrind_path_defines= +valgrind_command= +if test x$ac_checking_valgrind != x ; then + # It is certainly possible that there's valgrind but no valgrind.h. + # GCC relies on making annotations so we must have both. + AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) + AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind, + [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1]) + if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then + AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h]) + fi + valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"' + valgrind_command="$valgrind_path -q" + AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1, +[Define if you want to run subprograms and generated programs + through valgrind (a memory checker). This is extremely expensive.]) +fi +AC_SUBST(valgrind_path_defines) +AC_SUBST(valgrind_command) + +# Enable code coverage collection +AC_ARG_ENABLE(coverage, +[ --enable-coverage[=LEVEL] + enable compiler\'s code coverage collection. + Use to measure compiler performance and locate + unused parts of the compiler. With LEVEL, specificy + optimization. Values are opt, noopt, + default is noopt], +[case "${enableval}" in +yes|noopt) + coverage_flags="-fprofile-arcs -ftest-coverage -O0" + ;; +opt) + coverage_flags="-fprofile-arcs -ftest-coverage -O2" + ;; +*) + AC_MSG_ERROR(unknown coverage setting $enableval) + ;; +esac], +[coverage_flags=""]) +AC_SUBST(coverage_flags) AC_ARG_WITH(cpp_install_dir, [ --with-cpp-install-dir=DIR @@ -343,88 +475,6 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) -# Determine the host, build, and target systems -AC_CANONICAL_SYSTEM - -# Set program_transform_name -AC_ARG_PROGRAM - -# Find the native compiler -AC_PROG_CC -AC_PROG_CC_C_O -# autoconf is lame and doesn't give us any substitution variable for this. -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then - NO_MINUS_C_MINUS_O=yes -else - OUTPUT_OPTION='-o $@' -fi -AC_SUBST(NO_MINUS_C_MINUS_O) -AC_SUBST(OUTPUT_OPTION) - -# See if GNAT has been installed -gcc_AC_PROG_GNAT - -AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long, -ac_cv_prog_cc_no_long_long, -[save_CFLAGS="$CFLAGS" -CFLAGS="-Wno-long-long" -AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes, - ac_cv_prog_cc_no_long_long=no) -CFLAGS="$save_CFLAGS"]) - -if test x$have_gnat != xno ; then -AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long, -ac_cv_prog_adac_no_long_long, -[cat >conftest.adb <<EOF -procedure conftest is begin null; end conftest; -EOF -if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then - ac_cv_prog_adac_no_long_long=yes -else - ac_cv_prog_adac_no_long_long=no -fi -rm -f conftest*]) -else - ac_cv_prog_adac_no_long_long=yes -fi - -strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes && \ - test $ac_cv_prog_adac_no_long_long = yes ; then - strict1_warn="-pedantic -Wno-long-long" -fi -AC_SUBST(strict1_warn) - -AC_PROG_CPP -AC_C_INLINE -gcc_AC_C_VOLATILE - -gcc_AC_C_LONG_DOUBLE -gcc_AC_C_LONG_LONG -gcc_AC_C__BOOL - -# sizeof(char) is 1 by definition. -gcc_AC_COMPILE_CHECK_SIZEOF(short) -gcc_AC_COMPILE_CHECK_SIZEOF(int) -gcc_AC_COMPILE_CHECK_SIZEOF(long) -if test $ac_cv_c_long_long = yes; then - gcc_AC_COMPILE_CHECK_SIZEOF(long long) -fi -if test $ac_cv_c___int64 = yes; then - gcc_AC_COMPILE_CHECK_SIZEOF(__int64) -fi - -gcc_AC_C_CHARSET - -# If the native compiler is GCC, we can enable warnings even in stage1. -# That's useful for people building cross-compilers, or just running a -# quick `make'. -warn_cflags= -if test "x$GCC" = "xyes"; then - warn_cflags='$(GCC_WARN_CFLAGS)' -fi -AC_SUBST(warn_cflags) - # Stage specific cflags for build. stage1_cflags= case $build in @@ -497,7 +547,7 @@ gcc_AC_HEADER_STDBOOL gcc_AC_HEADER_STRING AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \ - fcntl.h unistd.h sys/file.h sys/time.h \ + fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h \ direct.h malloc.h langinfo.h) @@ -523,7 +573,7 @@ else # that we can use it. gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, [GNU texinfo.* \([0-9][0-9.]*\)], - [4.[1-9]*]) + [4.[2-9]*]) fi if test $gcc_cv_prog_makeinfo_modern = no; then @@ -551,7 +601,7 @@ dnl LEXLIB is not useful in gcc. if test -f $srcdir/../flex/skel.c; then FLEX='$(objdir)/../flex/flex' else - AC_CHECK_PROG(FLEX, flex, flex, false) + AC_CHECK_PROG(FLEX, flex, flex, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex) fi # Bison? @@ -559,7 +609,7 @@ fi if test -f $srcdir/../bison/bison.simple; then BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/' else - AC_CHECK_PROG(BISON, bison, bison, false) + AC_CHECK_PROG(BISON, bison, bison, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison) fi # These libraries may be used by collect2. @@ -591,6 +641,15 @@ GNAT_LIBEXC="$LIBS" LIBS="$save_LIBS" AC_SUBST(GNAT_LIBEXC) +# Some systems put ldexp and frexp in libm instead of libc; assume +# they're both in the same place. jcf-dump needs them. +save_LIBS="$LIBS" +LIBS= +AC_SEARCH_LIBS(ldexp, m) +LDEXP_LIB="$LIBS" +LIBS="$save_LIBS" +AC_SUBST(LDEXP_LIB) + # See if the stage1 system preprocessor understands the ANSI C # preprocessor stringification operator. (Used by symcat.h.) AC_C_STRINGIZE @@ -616,7 +675,8 @@ dnl gcc_AC_C_ENUM_BF_UNSIGNED AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \ sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat) + fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \ + scandir alphasort gettimeofday mmap) AC_CHECK_TYPE(ssize_t, int) @@ -641,6 +701,7 @@ fi AC_SUBST(TARGET_GETGROUPS_T) gcc_AC_FUNC_PRINTF_PTR +gcc_AC_FUNC_MMAP_BLACKLIST case "${host}" in *-*-uwin*) @@ -656,8 +717,6 @@ case "${host}" in ;; esac AC_FUNC_VFORK -AC_FUNC_MMAP_ANYWHERE -AC_FUNC_MMAP_FILE AM_ICONV @@ -666,7 +725,7 @@ saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \ strsignal putc_unlocked fputs_unlocked fwrite_unlocked \ - fprintf_unlocked strstr errno \ + fprintf_unlocked strstr errno vasprintf \ malloc realloc calloc free basename getopt clock, , ,[ #include "ansidecl.h" #include "system.h"]) @@ -679,6 +738,15 @@ gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[ #endif ]) +AC_TRY_COMPILE([ +#include "ansidecl.h" +#include "system.h" +#ifdef HAVE_SYS_RESOURCE_H +#include <sys/resource.h> +#endif +],[rlim_t l = 0;],,[AC_DEFINE([rlim_t],[long], +[Define to \`long' if <sys/resource.h> doesn't define.])]) + gcc_AC_CHECK_DECLS(times, , ,[ #include "ansidecl.h" #include "system.h" @@ -713,6 +781,10 @@ if test $gcc_cv_type_clock_t = yes; then [Define if <time.h> defines clock_t.]) fi +AC_ARG_ENABLE(initfini-array, + [ --enable-initfini-array use .init_array/.fini_array sections], + gcc_cv_initfinit_array=$enableval, [gcc_AC_INITFINI_ARRAY]) + # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" @@ -725,6 +797,7 @@ objext='.o' AC_SUBST(manext) AC_SUBST(objext) +target_gtfiles= build_xm_file= build_xm_defines= build_install_headers_dir=install-headers-tar @@ -766,21 +839,6 @@ if test x"$dwarf2" = xyes then tm_file="$tm_file tm-dwarf2.h" fi -if test x$float_format = x -then float_format=i64 -fi - -if test $float_format = none -then float_h_file=Makefile.in -else float_h_file=float-$float_format.h -fi - -# Handle cpp installation. -if test x$enable_cpp != xno -then - tmake_file="$tmake_file t-install-cpp" -fi - # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." echo "Using \`$srcdir/config/$md_file' as machine description file." @@ -868,6 +926,18 @@ if test x$thread_file = x; then fi fi +# Look for a file containing extra machine modes. +if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then + extra_modes_file='$(srcdir)'/config/${extra_modes} + AC_SUBST(extra_modes_file) + AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "$extra_modes", + [Define to the name of a file containing a list of extra machine modes + for this architecture.]) + AC_DEFINE(EXTRA_CC_MODES, 1, + [Define if the target architecture needs extra machine modes to represent + the results of comparisons.]) +fi + # auto-host.h is the file containing items generated by autoconf and is # the first file included by config.h. # If host=build, it is correct to have hconfig include auto-host.h @@ -902,7 +972,7 @@ else cd .. rm -rf $tempdir build_auto=auto-build.h - FORBUILD=../$build + FORBUILD=../$build_alias fi AC_SUBST(FORBUILD) @@ -1010,9 +1080,9 @@ fi esac # Get an absolute path to the GCC top-level source directory -holddir=`pwd` +holddir=`${PWDCMD-pwd}` cd $srcdir -topdir=`pwd` +topdir=`${PWDCMD-pwd}` cd $holddir # Conditionalize the makefile for this host machine. @@ -1074,7 +1144,7 @@ for f in $tm_file; do ansidecl.h ) tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;; defaults.h ) - tm_file_list="${tm_file_list} $f" ;; + tm_file_list="${tm_file_list} \$(srcdir)/$f" ;; *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;; esac done @@ -1089,8 +1159,10 @@ for f in $host_xm_file; do case $f in ansidecl.h ) host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;; - auto-host.h | defaults.h ) + auto-host.h ) host_xm_file_list="${host_xm_file_list} $f" ;; + defaults.h ) + host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;; *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;; esac done @@ -1100,8 +1172,10 @@ for f in $build_xm_file; do case $f in ansidecl.h ) build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;; - auto-build.h | auto-host.h | defaults.h ) + auto-build.h | auto-host.h ) build_xm_file_list="${build_xm_file_list} $f" ;; + defaults.h ) + host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;; *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;; esac done @@ -1116,6 +1190,11 @@ then CROSS="-DCROSS_COMPILE" ALL=all.cross SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + case "$host","$target" in + i?86-*-*,x86_64-*-* \ + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac fi # If this is a cross-compiler that does not @@ -1142,8 +1221,8 @@ AC_SUBST(inhibit_libc) # FIXME. # These are the normal (build=host) settings: -HOST_PREFIX= AC_SUBST(HOST_PREFIX) -HOST_PREFIX_1=ignore- AC_SUBST(HOST_PREFIX_1) +BUILD_PREFIX= AC_SUBST(BUILD_PREFIX) +BUILD_PREFIX_1=ignore- AC_SUBST(BUILD_PREFIX_1) HOST_CC='$(CC)' AC_SUBST(HOST_CC) HOST_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(HOST_CFLAGS) @@ -1153,8 +1232,8 @@ STMP_FIXPROTO=stmp-fixproto AC_SUBST(STMP_FIXPROTO) # And these apply if build != host. if test x$build != x$host then - HOST_PREFIX=build- - HOST_PREFIX_1=build- + BUILD_PREFIX=build- + BUILD_PREFIX_1=build- HOST_CC='$(CC_FOR_BUILD)' HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)' @@ -1531,14 +1610,14 @@ elif test x$gcc_cv_as != x; then fi rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 - # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN. + # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN. # This is irritatingly difficult to feature test for. Look for # the date string after the version number. ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1` if echo "$ld_ver" | grep GNU > /dev/null; then changequote(,)dnl - ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'` - ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'` + ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` if test 0"$ld_date" -lt 20020404; then if test -n "$ld_date"; then # If there was date string, but was earlier than 2002-04-04, fail @@ -1564,13 +1643,25 @@ changequote(,)dnl changequote([,])dnl fi fi - if test x"$gcc_cv_as_hidden" = xyes; then AC_DEFINE(HAVE_GAS_HIDDEN, 1, [Define if your assembler supports .hidden.]) fi AC_MSG_RESULT($gcc_cv_as_hidden) libgcc_visibility=$gcc_cv_as_hidden +case "$target" in + mips-sgi-irix6*) + if test x"$gnu_ld_flag" = x"no"; then + # Even if using gas with .hidden support, the resulting object files + # cannot be linked with the IRIX 6 O32 linker. With the N32 and + # N64 linkers, the problem is that the linker refuses to accept + # -call_shared (passed by default to the linker) and -r (used to + # link the object file generated without .hidden directives with + # one that hides symbols), so we also lose. + libgcc_visibility=no + fi + ;; +esac AC_SUBST(libgcc_visibility) AC_MSG_CHECKING(assembler leb128 support) @@ -1715,6 +1806,145 @@ if test x"$gcc_cv_as_shf_merge" = xyes; then fi AC_MSG_RESULT($gcc_cv_as_shf_merge) +AC_MSG_CHECKING(assembler thread-local storage support) +gcc_cv_as_tls=no +conftest_s= +tls_first_major= +tls_first_minor= +case "$target" in +changequote(,)dnl + alpha*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + ldq $27,__tls_get_addr($29) !literal!1 + lda $16,foo($29) !tlsgd!1 + jsr $26,($27),__tls_get_addr !lituse_tlsgd!1 + ldq $27,__tls_get_addr($29) !literal!2 + lda $16,foo($29) !tlsldm!2 + jsr $26,($27),__tls_get_addr !lituse_tlsldm!2 + ldq $1,foo($29) !gotdtprel + ldah $2,foo($29) !dtprelhi + lda $3,foo($2) !dtprello + lda $4,foo($29) !dtprel + ldq $1,foo($29) !gottprel + ldah $2,foo($29) !tprelhi + lda $3,foo($2) !tprello + lda $4,foo($29) !tprel' + tls_first_major=2 + tls_first_minor=13 + ;; + i[34567]86-*-*) +changequote([,])dnl + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + movl %gs:0, %eax + leal foo@TLSGD(,%ebx,1), %eax + leal foo@TLSLDM(%ebx), %eax + leal foo@DTPOFF(%eax), %edx + movl foo@GOTTPOFF(%ebx), %eax + subl foo@GOTTPOFF(%ebx), %eax + addl foo@GOTNTPOFF(%ebx), %eax + movl foo@INDNTPOFF, %eax + movl $foo@TPOFF, %eax + subl $foo@TPOFF, %eax + leal foo@NTPOFF(%ecx), %eax' + tls_first_major=2 + tls_first_minor=14 + ;; + x86_64-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + movq %fs:0, %rax + leaq foo@TLSGD(%rip), %rdi + leaq foo@TLSLD(%rip), %rdi + leaq foo@DTPOFF(%rax), %rdx + movq foo@GOTTPOFF(%rip), %rax + movq $foo@TPOFF, %rax' + tls_first_major=2 + tls_first_minor=14 + ;; + ia64-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: data8 25 + .text + addl r16 = @ltoff(@dtpmod(foo#)), gp + addl r17 = @ltoff(@dtprel(foo#)), gp + addl r18 = @ltoff(@tprel(foo#)), gp + addl r19 = @dtprel(foo#), gp + adds r21 = @dtprel(foo#), r13 + movl r23 = @dtprel(foo#) + addl r20 = @tprel(foo#), gp + adds r22 = @tprel(foo#), r13 + movl r24 = @tprel(foo#)' + tls_first_major=2 + tls_first_minor=13 + ;; + s390-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + .long foo@TLSGD + .long foo@TLSLDM + .long foo@DTPOFF + .long foo@NTPOFF + .long foo@GOTNTPOFF + .long foo@INDNTPOFF + l %r1,foo@GOTNTPOFF(%r12) + l %r1,0(%r1):tls_load:foo + bas %r14,0(%r1,%r13):tls_gdcall:foo + bas %r14,0(%r1,%r13):tls_ldcall:foo' + tls_first_major=2 + tls_first_minor=14 + ;; + s390x-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + .quad foo@TLSGD + .quad foo@TLSLDM + .quad foo@DTPOFF + .quad foo@NTPOFF + .quad foo@GOTNTPOFF + lg %r1,foo@GOTNTPOFF(%r12) + larl %r1,foo@INDNTPOFF + brasl %r14,__tls_get_offset@PLT:tls_gdcall:foo + brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo' + tls_first_major=2 + tls_first_minor=14 + ;; +esac +if test -z "$tls_first_major"; then + : +elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x +then + if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \ + -a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \ + -o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then + gcc_cv_as_tls=yes + fi +elif test x$gcc_cv_as != x; then + echo "$conftest_s" > conftest.s + if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1 + then + gcc_cv_as_tls=yes + fi + rm -f conftest.s conftest.o +fi +if test "$gcc_cv_as_tls" = yes; then + AC_DEFINE(HAVE_AS_TLS, 1, + [Define if your assembler supports thread-local storage.]) +fi +AC_MSG_RESULT($gcc_cv_as_tls) + case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) @@ -1927,6 +2157,41 @@ EOF [Define true if the assembler supports '.long foo@GOTOFF'.]) AC_MSG_RESULT($gcc_cv_as_gotoff_in_data) ;; + + ia64*-*-*) + AC_CACHE_CHECK([assembler supports ltoffx and ldxmov], + gcc_cv_as_ltoffx_ldxmov_relocs, [ + gcc_cv_as_ltoffx_ldxmov_relocs=unknown + if test x$gcc_cv_gas_major_version != x \ + -a x$gcc_cv_gas_minor_version != x + then + if test "$gcc_cv_gas_major_version" -eq 2 \ + -a "$gcc_cv_gas_minor_version" -ge 14 \ + -o "$gcc_cv_gas_major_version" -gt 2; then + gcc_cv_as_ltoffx_ldxmov_relocs=yes + fi + elif test x$gcc_cv_as != x; then + cat > conftest.s << 'EOF' +changequote(,)dnl + .text + addl r15 = @ltoffx(x#), gp + ;; + ld8.mov r16 = [r15], x# +EOF +changequote([,])dnl + if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then + gcc_cv_as_ltoffx_ldxmov_relocs=yes + else + gcc_cv_as_ltoffx_ldxmov_relocs=no + fi + rm -f conftest.s conftest.o + fi + ]) + if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then + AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1, + [Define if your assembler supports ltoffx and ldxmov relocations.]) + fi + ;; esac AC_MSG_CHECKING(assembler dwarf2 debug_line support) @@ -1938,7 +2203,8 @@ gcc_cv_as_dwarf2_debug_line=no # ??? Once 2.11 is released, probably need to add first known working # version to the per-target configury. case "$target" in - i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-*) + i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ + | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-*) insn="nop" ;; ia64*-*-*) @@ -1992,7 +2258,7 @@ then -o "$gcc_cv_gas_major_version" -gt 2 \ && grep 'obj_format = elf' ../gas/Makefile > /dev/null \ && test x"$insn" != x ; then - gcc_cv_as_gdwarf2_debug_flag="yes" + gcc_cv_as_gdwarf2_flag="yes" fi elif test x$gcc_cv_as != x -a x"$insn" != x ; then echo '' > conftest.s @@ -2018,13 +2284,20 @@ then -o "$gcc_cv_gas_major_version" -gt 2 \ && grep 'obj_format = elf' ../gas/Makefile > /dev/null \ && test x"$insn" != x ; then - gcc_cv_as_gstabs_debug_flag="yes" + gcc_cv_as_gstabs_flag="yes" fi elif test x$gcc_cv_as != x -a x"$insn" != x ; then echo '' > conftest.s # ??? This fails with non-gnu grep. if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then gcc_cv_as_gstabs_flag="yes" + # The native Solaris 9/Intel assembler doesn't understand --gstabs + # and warns about it, but still exits successfully. So check for + # this. + if $gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | \ + grep -i warning > /dev/null ; then + gcc_cv_as_gstabs_flag="no" + fi fi rm -f conftest.s conftest.o fi @@ -2034,6 +2307,44 @@ if test x"$gcc_cv_as_gstabs_flag" = xyes; then fi AC_MSG_RESULT($gcc_cv_as_gstabs_flag) +AC_MSG_CHECKING(linker read-only and read-write section mixing) +gcc_cv_ld_ro_rw_mix=unknown +if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then + gcc_cv_ld_ro_rw_mix=read-write + fi +elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then + echo '.section myfoosect, "a"' > conftest1.s + echo '.section myfoosect, "aw"' > conftest2.s + echo '.byte 1' >> conftest2.s + echo '.section myfoosect, "a"' > conftest3.s + echo '.byte 0' >> conftest3.s + if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \ + && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \ + && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \ + && $gcc_cv_ld -shared -o conftest1.so conftest1.o \ + conftest2.o conftest3.o > /dev/null 2>&1; then + gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \ + | sed -e '/myfoosect/!d' -e N` + if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then + if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then + gcc_cv_ld_ro_rw_mix=read-only + else + gcc_cv_ld_ro_rw_mix=read-write + fi + fi + fi +changequote(,)dnl + rm -f conftest.* conftest[123].* +changequote([,])dnl +fi +if test x$gcc_cv_ld_ro_rw_mix = xread-write; then + AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1, + [Define if your linker links a mix of read-only + and read-write sections into a read-write section.]) +fi +AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix) + AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support) gcc_cv_ld_eh_frame_hdr=no if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then @@ -2046,96 +2357,43 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_eh_frame_hdr=yes fi fi -AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr) if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then - AC_MSG_CHECKING(whether linker eh_frame optimizations work properly) - gcc_cv_ld_eh_frame_hdr_works=no - if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 13 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then - gcc_cv_ld_eh_frame_hdr_works=yes - fi - elif test x$gcc_cv_ld != x; then - for gcc_WS in 4 8; do - cat > conftest.s <<EOF - .text -.LFB1: .skip 64 -.LFE1: -.LFB2: .skip 64 -.LFE2: -.LFB3: .skip 64 -.LFE3: - .section .eh_frame,"aw",@progbits -.Lframe1: - .4byte .LECIE1-.LSCIE1 -.LSCIE1: - .4byte 0x0 - .byte 0x1 - .ascii "zR\0" - .uleb128 0x1 - .sleb128 -4 - .byte 0x8 - .uleb128 0x1 - .byte 0x50 - .byte 0xc - .uleb128 0x4 - .uleb128 0x4 - .byte 0x88 - .uleb128 0x1 - .balign ${gcc_WS} -.LECIE1: -.LSFDE1: - .4byte .LEFDE1-.LASFDE1 -.LASFDE1: - .4byte .LASFDE1-.Lframe1 - .${gcc_WS}byte .LFB1 - .${gcc_WS}byte .LFE1-.LFB1 - .uleb128 0x0 - .balign ${gcc_WS} -.LEFDE1: -.LSFDE2: - .4byte .LEFDE2-.LASFDE2 -.LASFDE2: - .4byte .LASFDE2-.Lframe1 - .${gcc_WS}byte .LFB2 - .${gcc_WS}byte .LFE2-.LFB2 - .uleb128 0x0 - .balign ${gcc_WS} -.LEFDE2: -.LSFDE3: - .4byte .LEFDE3-.LASFDE3 -.LASFDE3: - .4byte .LASFDE3-.Lframe1 - .${gcc_WS}byte .LFB3 - .${gcc_WS}byte .LFE3-.LFB3 - .uleb128 0x0 - .balign ${gcc_WS} -.LEFDE3: - .4byte 0 -EOF - if ($gcc_cv_as -o conftest.o conftest.s; exit $?) 1>&AC_FD_CC 2>&1; then - if ($gcc_cv_ld --eh-frame-hdr -shared -o conftest.so conftest.o; exit $?) 1>&AC_FD_CC 2>&1; then -changequote(,)dnl - if $gcc_cv_objdump -h conftest.so 2>&AC_FD_CC \ - | grep 'eh_frame_hdr[ ]*0*[01][048cC][ ]' 1>&AC_FD_CC 2>&1; then - gcc_cv_ld_eh_frame_hdr_works=yes; break - else - $gcc_cv_objdump -h conftest.so 2>/dev/null | grep eh_frame_hdr 1>&AC_FD_CC 2>&1 - fi -changequote([,])dnl - fi - fi - rm -f conftest.* - done - fi - AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr_works) -fi -if test x"$gcc_cv_ld_eh_frame_hdr" = xyes \ - && test x"$gcc_cv_ld_eh_frame_hdr_works" = xyes; then AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1, [Define if your linker supports --eh-frame-hdr option.]) fi +AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr) + +# Miscellaneous target-specific checks. +case "$target" in + mips*-*-*) + AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently) + gcc_cv_mips_libgloss_startup=no + gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld + do + if grep '^STARTUP' $f > /dev/null 2>&1; then + gcc_cv_mips_libgloss_startup=yes + break + fi + done + if test x"$gcc_cv_mips_libgloss_startup" = xyes; then + AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1, + [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.]) + fi + AC_MSG_RESULT($gcc_cv_mips_libgloss_startup) + ;; +esac -if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then +if test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include") fi @@ -2153,8 +2411,8 @@ if test x"${enable_languages+set}" != xset; then enable_languages=all fi else - if test x"${enable_languages}" = x || - test x"${enable_languages}" = xyes; + if test x"${enable_languages}" = x \ + || test x"${enable_languages}" = xyes; then AC_MSG_ERROR([--enable-languages needs at least one language argument]) fi @@ -2194,6 +2452,8 @@ changequote([,])dnl esac done +expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'` +found_languages= subdirs= for lang in ${srcdir}/*/config-lang.in .. do @@ -2218,6 +2478,7 @@ changequote(,)dnl *,all,*) add_this_lang=yes ;; *) add_this_lang=no ;; esac + found_languages="${found_languages} ${lang_alias}" if test x"${add_this_lang}" = xyes; then case $lang in ${srcdir}/ada/config-lang.in) @@ -2235,6 +2496,35 @@ changequote([,])dnl esac done +missing_languages= +for expected_language in ${expected_languages} .. +do + if test "${expected_language}" != ..; then + missing_language="${expected_language}" + if test "${expected_language}" = "c" \ + || test "${expected_language}" = "all"; then + missing_language= + fi + for found_language in ${found_languages} .. + do + if test "${found_language}" != ..; then + if test "${expected_language}" = "${found_language}"; then + missing_language= + fi + fi + done + if test "x${missing_language}" != x; then + missing_languages="${missing_languages} ${missing_language}" + fi + fi +done + +if test "x$missing_languages" != x; then + AC_MSG_ERROR([ +The following requested languages were not found:${missing_languages} +The following languages were available: c${found_languages}]) +fi + # Make gthr-default.h if we have a thread file. gthread_flags= if test $thread_file != single; then @@ -2299,6 +2589,16 @@ AC_ARG_ENABLE(sjlj-exceptions, AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, [Define 0/1 to force the choice for exception handling model.])]) +# Use libunwind based exception handling. +AC_ARG_ENABLE(libunwind-exceptions, +[ --enable-libunwind-exceptions force use libunwind for exceptions], +use_libunwind_exceptions=$enableval, +use_libunwind_exceptions=no) +if test x"$use_libunwind_exceptions" = xyes; then + AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1, + [Define if gcc should use -lunwind.]) +fi + # Make empty files to contain the specs and options for each language. # Then add #include lines to for a compiler that has specs and/or options. @@ -2324,9 +2624,14 @@ all_languages= all_boot_languages= all_compilers= all_stagestuff= -all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc' +all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders' # List of language makefile fragments. all_lang_makefiles= +# Files for gengtype +all_gtfiles="$target_gtfiles" +# Files for gengtype with language +all_gtfiles_files_langs= +all_gtfiles_files_files= # Add the language fragments. # Languages are added via two mechanisms. Some information must be @@ -2347,6 +2652,7 @@ do compilers= stagestuff= outputs= + gtfiles= . ${srcdir}/$s/config-lang.in if test "x$language" = x then @@ -2365,9 +2671,32 @@ do all_compilers="$all_compilers $compilers" all_stagestuff="$all_stagestuff $stagestuff" all_outputs="$all_outputs $outputs" + all_gtfiles="$all_gtfiles $gtfiles" + for f in .. $gtfiles + do + if test $f != ".." + then + all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " + all_gtfiles_files_files="$all_gtfiles_files_files ${f} " + fi + done fi done +# Pick up gtfiles for c +gtfiles= +s="c" +. ${srcdir}/c-config-lang.in +all_gtfiles="$all_gtfiles $gtfiles" +for f in .. $gtfiles +do + if test $f != ".." + then + all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " + all_gtfiles_files_files="$all_gtfiles_files_files ${f} " + fi +done + check_languages= for language in .. $all_languages do @@ -2486,8 +2815,7 @@ else fi) AC_SUBST(slibdir) -# Nothing to do for FLOAT_H, float_format already handled. -objdir=`pwd` +objdir=`${PWDCMD-pwd}` AC_SUBST(objdir) # Process the language and host/target makefile fragments. @@ -2495,8 +2823,12 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma # Substitute configuration variables AC_SUBST(subdirs) +AC_SUBST(srcdir) AC_SUBST(all_boot_languages) AC_SUBST(all_compilers) +AC_SUBST(all_gtfiles) +AC_SUBST(all_gtfiles_files_langs) +AC_SUBST(all_gtfiles_files_files) AC_SUBST(all_lang_makefiles) AC_SUBST(all_languages) AC_SUBST(all_stagestuff) @@ -2543,6 +2875,7 @@ AC_SUBST(symbolic_link) AC_SUBST(thread_file) AC_SUBST(tm_file_list) AC_SUBST(tm_file) +AC_SUBST(tm_defines) AC_SUBST(tm_p_file_list) AC_SUBST(tm_p_file) AC_SUBST(xm_file) @@ -2608,7 +2941,7 @@ esac if test "$symbolic_link" = "ln -s"; then for d in .. ${subdirs} fixinc ; do if test $d != ..; then - STARTDIR=`pwd` + STARTDIR=`${PWDCMD-pwd}` cd $d for t in stage1 stage2 stage3 stage4 include do |