AC_CHECK_PROG(AR, ar, ar, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar)
fi
+# The jit documentation looks better if built with sphinx, but can be
+# built with texinfo if sphinx is not available.
+# Set "doc_build_sys" to "sphinx" or "texinfo" accordingly.
+AC_CHECK_PROG(doc_build_sys, sphinx-build, sphinx, texinfo)
# --------------------
# Checks for C headers
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \
- sysconf strsignal getrusage nl_langinfo \
+ popen sysconf strsignal getrusage nl_langinfo \
gettimeofday mbstowcs wcswidth mmap setlocale \
gcc_UNLOCKED_FUNCS madvise)
saved_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
- strsignal strstr stpcpy strverscmp \
+ stpcpy strnlen strsignal strstr strverscmp \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
free basename getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[
#include "ansidecl.h"
SYSTEM_HEADER_DIR=$build_system_header_dir
fi
+if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
+ if test "x$with_headers" != x; then
+ target_header_dir=$with_headers
+ elif test "x$with_sysroot" = x; then
+ target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
+ elif test "x$with_build_sysroot" != "x"; then
+ target_header_dir="${with_build_sysroot}${native_system_header_dir}"
+ elif test "x$with_sysroot" = xyes; then
+ target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
+ else
+ target_header_dir="${with_sysroot}${native_system_header_dir}"
+ fi
+else
+ target_header_dir=${native_system_header_dir}
+fi
+
# If this is a cross-compiler that does not
# have its own set of headers then define
# inhibit_libc
: ${inhibit_libc=false}
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
test x$with_newlib = xyes ; } &&
- { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
+ { test "x$with_headers" = xno || test ! -f "$target_header_dir/stdio.h"; } ; then
inhibit_libc=true
fi
AC_SUBST(inhibit_libc)
;;
esac])
+install_gold_as_default=no
AC_ARG_ENABLE(gold,
[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
[case "${enableval}" in
*)
AC_MSG_ERROR([invalid --enable-gold argument])
;;
- esac],
-[install_gold_as_default=no])
+ esac])
# Identify the linker which will work hand-in-glove with the newly
# built GCC, so that we can examine its features. This is the linker
if test $gcc_cv_as_comdat_group_percent = yes; then
gcc_cv_as_comdat_group_group=no
else
- if test -z "${gcc_cv_as_comdat_group_group+set}"; then
- gcc_cv_as_comdat_group_group=no
- fi
case "${target}" in
# Sun as uses a completely different syntax.
*-*-solaris2*)
,, [$conftest_s])
;;
esac
+ if test -z "${gcc_cv_as_comdat_group_group+set}"; then
+ gcc_cv_as_comdat_group_group=no
+ fi
fi
fi
if test x"$ld_is_gold" = xyes; then
done
fi
fi
+ # Enable default workaround for AArch64 Cortex-A53 erratum 835769.
+ AC_ARG_ENABLE(fix-cortex-a53-835769,
+ [
+AS_HELP_STRING([--enable-fix-cortex-a53-835769],
+ [enable workaround for AArch64 Cortex-A53 erratum 835769 by default])
+AS_HELP_STRING([--disable-fix-cortex-a53-835769],
+ [disable workaround for AArch64 Cortex-A53 erratum 835769 by default])
+ ],
+ [
+ case $enableval in
+ yes)
+ tm_defines="${tm_defines} TARGET_FIX_ERR_A53_835769_DEFAULT=1"
+ ;;
+ no)
+ ;;
+ *)
+ AC_MSG_ERROR(['$enableval' is an invalid value for --enable-fix-cortex-a53-835769.\
+ Valid choices are 'yes' and 'no'.])
+ ;;
+
+ esac
+ ],
+ [])
;;
# All TARGET_ABI_OSF targets.
;;
esac
fi
- # Test if the assembler supports the section flag 'e' for specifying
- # an excluded section.
- gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e,
- [2,22,51],,
-[.section foo1,"e"
-.byte 0,0,0,0])
- AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE,
- [`if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`],
- [Define if your assembler supports specifying the section flag e.])
;;
esac
+ # Test if the assembler supports the section flag 'e' for specifying
+ # an excluded section.
+ gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e,
+ [2,22,51], [--fatal-warnings],
+[.section foo1,"e"
+.byte 0,0,0,0])
+ AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE,
+ [`if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`],
+ [Define if your assembler supports specifying the section flag e.])
+
gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
gcc_cv_as_ix86_filds,,,
[filds mem; fists mem],,
[Define if your assembler supports the --debug-prefix-map option.])])
fi
+gcc_GAS_CHECK_FEATURE([compressed debug sections],
+ gcc_cv_as_compress_debug,,[--compress-debug-sections],,
+ [# gas compiled without zlib cannot compress debug sections and warns
+ # about it, but still exits successfully. So check for this, too.
+ if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
+ then
+ gcc_cv_as_compress_debug=0
+ elif $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s > /dev/null 2>&1
+ then
+ gcc_cv_as_compress_debug=1
+ gcc_cv_as_compress_debug_option="--compress-debug-sections"
+ gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
+ else
+ gcc_cv_as_compress_debug=0
+ # FIXME: Future gas versions will support ELF gABI style via
+ # --compress-debug-sections[=type].
+ fi])
+AC_DEFINE_UNQUOTED(HAVE_AS_COMPRESS_DEBUG, $gcc_cv_as_compress_debug,
+[Define to the level of your assembler's compressed debug section support.])
+AC_DEFINE_UNQUOTED(AS_COMPRESS_DEBUG_OPTION, "$gcc_cv_as_compress_debug_option",
+[Define to the assembler option to enable compressed debug sections.])
+AC_DEFINE_UNQUOTED(AS_NO_COMPRESS_DEBUG_OPTION, "$gcc_cv_as_no_compress_debug_option",
+[Define to the assembler option to disable compressed debug sections.])
+
gcc_GAS_CHECK_FEATURE([.lcomm with alignment], gcc_cv_as_lcomm_with_alignment,
,,
[.lcomm bar,4,16],,
[Define to PREFIX/include if cpp should also search that directory.])
fi
-if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
- if test "x$with_headers" != x; then
- target_header_dir=$with_headers
- elif test "x$with_sysroot" = x; then
- target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
- elif test "x$with_build_sysroot" != "x"; then
- target_header_dir="${with_build_sysroot}${native_system_header_dir}"
- elif test "x$with_sysroot" = xyes; then
- target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
- else
- target_header_dir="${with_sysroot}${native_system_header_dir}"
- fi
-else
- target_header_dir=${native_system_header_dir}
-fi
-
# Determine the version of glibc, if any, used on the target.
AC_MSG_CHECKING([for target glibc version])
AC_ARG_WITH([glibc-version],
glibc_version_minor=`echo "$glibc_version_minor_define" | sed -e 's/.*__GLIBC_MINOR__[ ]*//'`
fi]])
AC_MSG_RESULT([$glibc_version_major.$glibc_version_minor])
+AC_DEFINE_UNQUOTED([TARGET_GLIBC_MAJOR], [$glibc_version_major],
+[GNU C Library major version number used on the target, or 0.])
+AC_DEFINE_UNQUOTED([TARGET_GLIBC_MINOR], [$glibc_version_minor],
+[GNU C Library minor version number used on the target, or 0.])
AC_ARG_ENABLE(gnu-unique-object,
[AS_HELP_STRING([--enable-gnu-unique-object],
fi
AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug)
+AC_MSG_CHECKING(linker for compressed debug sections)
+# gold/gld support compressed debug sections since binutils 2.19/2.21
+if test $in_tree_ld = yes ; then
+ gcc_cv_ld_compress_debug=0
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then
+ gcc_cv_ld_compress_debug=2
+ gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+ elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_compress_debug=1
+ fi
+elif echo "$ld_ver" | grep GNU > /dev/null; then
+ gcc_cv_ld_compress_debug=1
+ if test 0"$ld_date" -lt 20050308; then
+ if test -n "$ld_date"; then
+ # If there was date string, but was earlier than 2005-03-08, fail
+ gcc_cv_ld_compress_debug=0
+ elif test "$ld_vers_major" -lt 2; then
+ gcc_cv_ld_compress_debug=0
+ elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then
+ gcc_cv_ld_compress_debug=0
+ fi
+ fi
+ if test $ld_is_gold = yes; then
+ gcc_cv_ld_compress_debug=2
+ gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+ fi
+else
+changequote(,)dnl
+ case "${target}" in
+ *-*-solaris2*)
+ # Introduced in Solaris 11.2.
+ if $gcc_cv_ld --help 2>&1 | grep -- '-z compress-sections' > /dev/null; then
+ gcc_cv_ld_compress_debug=3
+ gcc_cv_ld_compress_debug_option="-z compress-sections"
+ else
+ gcc_cv_ld_compress_debug=0
+ fi
+ ;;
+ *)
+ # Assume linkers other than GNU ld don't support compessed debug
+ # sections.
+ gcc_cv_ld_compress_debug=0
+ ;;
+ esac
+changequote([,])dnl
+fi
+AC_DEFINE_UNQUOTED(HAVE_LD_COMPRESS_DEBUG, $gcc_cv_ld_compress_debug,
+[Define to the level of your linker's compressed debug section support.])
+AC_DEFINE_UNQUOTED(LD_COMPRESS_DEBUG_OPTION, "$gcc_cv_ld_compress_debug_option",
+[Define to the linker option to enable compressed debug sections.])
+AC_MSG_RESULT($gcc_cv_ld_compress_debug)
+
# --------
# UNSORTED
# --------
AC_ARG_VAR(ISLLIBS,[How to link ISL])
AC_ARG_VAR(ISLINC,[How to find ISL include files])
-
-AC_ARG_VAR(CLOOGLIBS,[How to link CLOOG])
-AC_ARG_VAR(CLOOGINC,[How to find CLOOG include files])
-if test "x${CLOOGLIBS}" != "x" ; then
- AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
-fi
-
-# Check for plugin support
-AC_ARG_ENABLE(plugin,
-[AS_HELP_STRING([--enable-plugin], [enable plugin support])],
-enable_plugin=$enableval,
-enable_plugin=yes; default_plugin=yes)
-
-pluginlibs=
-
-case "${host}" in
- *-*-darwin*)
- if test x$build = x$host; then
- export_sym_check="nm${exeext} -g"
- elif test x$host = x$target; then
- export_sym_check="$gcc_cv_nm -g"
- else
- export_sym_check=
- fi
- ;;
- *)
- if test x$build = x$host; then
- export_sym_check="objdump${exeext} -T"
- elif test x$host = x$target; then
- export_sym_check="$gcc_cv_objdump -T"
- else
- export_sym_check=
- fi
- ;;
-esac
-
-if test x"$enable_plugin" = x"yes"; then
-
- AC_MSG_CHECKING([for exported symbols])
- if test "x$export_sym_check" != x; then
- echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
- ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest$ac_exeext > /dev/null 2>&1
- if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
- : # No need to use a flag
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([yes])
- AC_MSG_CHECKING([for -rdynamic])
- ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest$ac_exeext > /dev/null 2>&1
- if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
- plugin_rdynamic=yes
- pluginlibs="-rdynamic"
- else
- plugin_rdynamic=no
- enable_plugin=no
- fi
- AC_MSG_RESULT([$plugin_rdynamic])
- fi
- else
- AC_MSG_RESULT([unable to check])
- fi
-
- # Check -ldl
- saved_LIBS="$LIBS"
- AC_SEARCH_LIBS([dlopen], [dl])
- if test x"$ac_cv_search_dlopen" = x"-ldl"; then
- pluginlibs="$pluginlibs -ldl"
- fi
- LIBS="$saved_LIBS"
-
- # Check that we can build shared objects with -fPIC -shared
- saved_LDFLAGS="$LDFLAGS"
- saved_CFLAGS="$CFLAGS"
- case "${host}" in
- *-*-darwin*)
- CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
- CFLAGS="$CFLAGS -fPIC"
- LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
- ;;
- *)
- CFLAGS="$CFLAGS -fPIC"
- LDFLAGS="$LDFLAGS -fPIC -shared"
- ;;
- esac
- AC_MSG_CHECKING([for -fPIC -shared])
- AC_TRY_LINK(
- [extern int X;],[return X == 0;],
- [AC_MSG_RESULT([yes]); have_pic_shared=yes],
- [AC_MSG_RESULT([no]); have_pic_shared=no])
- if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
- pluginlibs=
- enable_plugin=no
- fi
- LDFLAGS="$saved_LDFLAGS"
- CFLAGS="$saved_CFLAGS"
-
- # If plugin support had been requested but not available, fail.
- if test x"$enable_plugin" = x"no" ; then
- if test x"$default_plugin" != x"yes"; then
- AC_MSG_ERROR([
-Building GCC with plugin support requires a host that supports
--fPIC, -shared, -ldl and -rdynamic.])
- fi
- fi
+if test "x${ISLLIBS}" != "x" ; then
+ AC_DEFINE(HAVE_isl, 1, [Define if isl is in use.])
fi
+GCC_ENABLE_PLUGINS
AC_SUBST(pluginlibs)
AC_SUBST(enable_plugin)
if test x"$enable_plugin" = x"yes"; then
[The linker hash style])
fi
+# Generate gcc-driver-name.h containing GCC_DRIVER_NAME for the benefit
+# of jit/jit-playback.c.
+cat > gcc-driver-name.h <<EOF
+#define GCC_DRIVER_NAME "${target_noncanonical}-gcc-${gcc_BASEVER}${exeext}"
+EOF
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)