# configure.ac for GCC
# Process this file with autoconf to generate a configuration script.
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#This file is part of GCC.
force_sjlj_exceptions=yes
enableval=yes
;;
+ lm32*-*-*)
+ force_sjlj_exceptions=yes
+ enableval=yes
+ ;;
*)
force_sjlj_exceptions=no
;;
/* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
*) realsrcdir=../${srcdir};;
esac
- saved_CFLAGS="${CFLAGS}"
+ # Clearing GMPINC is necessary to prevent host headers being
+ # used by the build compiler. Defining GENERATOR_FILE stops
+ # system.h from including gmp.h.
CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
- LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+ GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
${realsrcdir}/configure \
--enable-languages=${enable_languages-all} \
--target=$target_alias --host=$build_alias --build=$build_alias
- CFLAGS="${saved_CFLAGS}"
# We just finished tests for the build machine, so rename
# the file auto-build.h in the gcc directory.
if test x$build != x$host || test "x$coverage_flags" != x
then
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CXXFLAGS_FOR_BUILD)'
BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
fi
.section .tdata,"awt",@progbits'
tls_first_major=0
tls_first_minor=0
+ tls_section_flag=t
changequote([,])dnl
AC_DEFINE(TLS_SECTION_ASM_FLAG, 't',
[Define to the flag used to mark TLS sections if the default (`T') doesn't work.])
.section ".tdata","awT",@progbits'
tls_first_major=2
tls_first_minor=14
+ tls_section_flag=T
tls_as_opt="--fatal-warnings"
fi
conftest_s="$conftest_s
movq $foo@TPOFF, %rax'
tls_first_major=2
tls_first_minor=14
+ tls_section_flag=T
tls_as_opt=--fatal-warnings
;;
ia64-*-*)
tls_first_minor=19
tls_as_opt='--fatal-warnings'
;;
+ nios2-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits'
+ tls_first_major=2
+ tls_first_minor=23
+ tls_as_opt="--fatal-warnings"
+ ;;
aarch64*-*-*)
conftest_s='
.section ".tdata","awT",%progbits
# (32-bit x86) only lived in libthread, so check for that. Keep
# set_have_as_tls if found, disable if not.
AC_SEARCH_LIBS([$tga_func], [thread],, [set_have_as_tls=no])
+ ld_tls_libs="$LIBS"
# Clear LIBS if we cannot support TLS.
if test $set_have_as_tls = no; then
LIBS=
AC_MSG_RESULT($gcc_cv_lto_plugin)
case "$target" in
+ aarch64*-*-*)
+ gcc_GAS_CHECK_FEATURE([-mabi option], gcc_cv_as_aarch64_mabi,,
+ [-mabi=lp64], [.text],,,)
+ if test x$gcc_cv_as_aarch64_mabi = xyes; then
+ AC_DEFINE(HAVE_AS_MABI_OPTION, 1,
+ [Define if your assembler supports the -mabi option.])
+ else
+ if test x$with_abi = xilp32; then
+ AC_MSG_ERROR([Assembler does not support -mabi=ilp32.\
+ Upgrade the Assembler.])
+ fi
+ if test x"$with_multilib_list" = xdefault; then
+ TM_MULTILIB_CONFIG=lp64
+ else
+ aarch64_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
+ for aarch64_multilib in ${aarch64_multilibs}; do
+ case ${aarch64_multilib} in
+ ilp32)
+ AC_MSG_ERROR([Assembler does not support -mabi=ilp32.\
+ Upgrade the Assembler.])
+ ;;
+ *)
+ ;;
+ esac
+ done
+ fi
+ fi
+ ;;
+
# All TARGET_ABI_OSF targets.
alpha*-*-linux* | alpha*-*-*bsd*)
gcc_GAS_CHECK_FEATURE([explicit relocation support],
# These two are used unconditionally by i386.[ch]; it is to be defined
# to 1 if the feature is present, 0 otherwise.
+ as_ix86_gotoff_in_data_opt=
+ if test x$gas = xyes; then
+ as_ix86_gotoff_in_data_opt="--32"
+ fi
gcc_GAS_CHECK_FEATURE([GOTOFF in data],
- gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+ gcc_cv_as_ix86_gotoff_in_data, [2,11,0],
+ [$as_ix86_gotoff_in_data_opt],
[ .text
.L0:
nop
[AC_DEFINE(HAVE_AS_IX86_REP_LOCK_PREFIX, 1,
[Define if the assembler supports 'rep <insn>, lock <insn>'.])])
+ gcc_GAS_CHECK_FEATURE([ud2 mnemonic],
+ gcc_cv_as_ix86_ud2,,,
+ [ud2],,
+ [AC_DEFINE(HAVE_AS_IX86_UD2, 1,
+ [Define if your assembler supports the 'ud2' mnemonic.])])
+
gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc],
gcc_cv_as_ix86_tlsgdplt,,,
[call tls_gd@tlsgdplt],
[AC_DEFINE(HAVE_AS_IX86_TLSGDPLT, 1,
[Define if your assembler and linker support @tlsgdplt.])])
+ conftest_s='
+ .section .tdata,"aw'$tls_section_flag'",@progbits
+tls_ld:
+ .section .text,"ax",@progbits
+ call tls_ld@tlsldmplt'
gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM_PLT reloc],
gcc_cv_as_ix86_tlsldmplt,,,
- [tls_ld:
- call tls_ld@tlsldmplt],
+ [$conftest_s],
[if test x$gcc_cv_ld != x \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
gcc_cv_as_ix86_tlsldmplt=yes
fi
- rm -f conftest],
- [AC_DEFINE(HAVE_AS_IX86_TLSLDMPLT, 1,
- [Define if your assembler and linker support @tlsldmplt.])])
+ rm -f conftest])
+ AC_DEFINE_UNQUOTED(HAVE_AS_IX86_TLSLDMPLT,
+ [`if test $gcc_cv_as_ix86_tlsldmplt = yes; then echo 1; else echo 0; fi`],
+ [Define to 1 if your assembler and linker support @tlsldmplt.])
+
+ # Enforce 32-bit output with gas and gld.
+ if test x$gas = xyes; then
+ as_ix86_tls_ldm_opt="--32"
+ fi
+ if echo "$ld_ver" | grep GNU > /dev/null; then
+ if $gcc_cv_ld -V 2>/dev/null | grep elf_i386_sol2 > /dev/null; then
+ ld_ix86_tls_ldm_opt="-melf_i386_sol2"
+ else
+ ld_ix86_tls_ldm_opt="-melf_i386"
+ fi
+ fi
+ conftest_s='
+ .section .text,"ax",@progbits
+ .globl _start
+ .type _start, @function
+_start:
+ leal value@tlsldm(%ebx), %eax
+ call ___tls_get_addr@plt
+
+ .section .tdata,"aw'$tls_section_flag'",@progbits
+ .type value, @object
+value:'
+ gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM reloc],
+ gcc_cv_as_ix86_tlsldm,,
+ [$as_ix86_tls_ldm_opt],
+ [$conftest_s],
+ [if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \
+ && $gcc_cv_ld $ld_ix86_tls_ldm_opt -o conftest conftest.o $ld_tls_libs -lc > /dev/null 2>&1; then
+ if $gcc_cv_objdump -d conftest 2>/dev/null | grep nop > /dev/null \
+ || dis conftest 2>/dev/null | grep nop > /dev/null; then
+ gcc_cv_as_ix86_tlsldm=yes
+ fi
+ fi
+ rm -f conftest])
+ AC_DEFINE_UNQUOTED(HAVE_AS_IX86_TLSLDM,
+ [`if test $gcc_cv_as_ix86_tlsldm = yes; then echo 1; else echo 0; fi`],
+ [Define to 1 if your assembler and linker support @tlsldm.])
;;
# version to the per-target configury.
case "$cpu_type" in
aarch64 | alpha | arm | avr | bfin | cris | i386 | m32c | m68k | microblaze \
- | mips | pa | rs6000 | score | sparc | spu | tilegx | tilepro | xstormy16 \
- | xtensa)
+ | mips | nios2 | pa | rs6000 | score | sparc | spu | tilegx | tilepro \
+ | xstormy16 | xtensa)
insn="nop"
;;
ia64 | s390)
echo "source ${srcdir}/gdbinit.in" >> .gdbinit
echo "python import sys; sys.path.append('${srcdir}'); import gdbhooks" >> .gdbinit
+# Put a breakpoint on __asan_report_error to help with debugging buffer
+# overflow.
+case "$CFLAGS" in
+*-fsanitize=address*)
+ echo "source ${srcdir}/gdbasan.in" >> .gdbinit
+ ;;
+esac
+
gcc_tooldir='$(libsubdir)/$(libsubdir_to_prefix)$(target_noncanonical)'
AC_SUBST(gcc_tooldir)
AC_SUBST(dollar)