[ARM/AArch64][2/2] Crypto intrinsics tuning for Cortex-A53 - pipeline description
[gcc.git] / gcc / configure.ac
index 91a22d58cf7543160f2bc6252003be8b07963d73..0336066ccd2ccac200930349bf2808979cd8bfd6 100644 (file)
@@ -1,7 +1,7 @@
 # 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.
 
@@ -1249,6 +1249,10 @@ force_sjlj_exceptions=yes],
     force_sjlj_exceptions=yes
     enableval=yes
     ;;
+  lm32*-*-*)
+     force_sjlj_exceptions=yes
+     enableval=yes
+     ;;
   *)
     force_sjlj_exceptions=no
     ;;
@@ -1529,13 +1533,16 @@ else
        /* | [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.
@@ -1900,6 +1907,7 @@ STMP_FIXINC=stmp-fixinc           AC_SUBST(STMP_FIXINC)
 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
 
@@ -2965,6 +2973,7 @@ foo:      .long   25
        .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.])
@@ -2974,6 +2983,7 @@ changequote(,)dnl
        .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
@@ -3004,6 +3014,7 @@ foo:      .long   25
        movq    $foo@TPOFF, %rax'
        tls_first_major=2
        tls_first_minor=14
+       tls_section_flag=T
        tls_as_opt=--fatal-warnings
        ;;
   ia64-*-*)
@@ -3069,6 +3080,13 @@ foo:
        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
@@ -3353,6 +3371,7 @@ case "$target" in
     # (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=
@@ -3495,6 +3514,35 @@ AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin,
 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],
@@ -3827,8 +3875,13 @@ foo:     nop
 
     # 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
@@ -3850,6 +3903,12 @@ foo:     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],
@@ -3861,17 +3920,60 @@ foo:    nop
       [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.])
 
     ;;
 
@@ -4275,8 +4377,8 @@ esac
 # 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)
@@ -5245,6 +5347,14 @@ fi
 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)