OSDN Git Service

* config/i386/i386.md (UNSPECV_CMPXCHG): Rename from
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / linux.h
index e31c511..ca9a136 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
-   Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2004, 2005,
+   2006, 2007 Free Software Foundation, Inc.
    Contributed by Eric Youngdale.
    Modified for stabs-in-ELF by H.J. Lu.
 
@@ -8,7 +8,7 @@ This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GCC is distributed in the hope that it will be useful,
@@ -17,9 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 /* Output at beginning of assembler file.  */
 /* The .file command should always begin the output.  */
@@ -56,7 +55,7 @@ Boston, MA 02111-1307, USA.  */
    frame, so we cannot allow profiling without a frame pointer.  */
 
 #undef SUBTARGET_FRAME_POINTER_REQUIRED
-#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
@@ -74,11 +73,6 @@ Boston, MA 02111-1307, USA.  */
   do                                           \
     {                                          \
        LINUX_TARGET_OS_CPP_BUILTINS();         \
-       if (flag_pic)                           \
-         {                                     \
-           builtin_define ("__PIC__");         \
-           builtin_define ("__pic__");         \
-         }                                     \
     }                                          \
   while (0)
 
@@ -104,13 +98,19 @@ Boston, MA 02111-1307, USA.  */
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
+/* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
 #define LINK_EMULATION "elf_i386"
-#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+#undef  ASM_SPEC
+#define ASM_SPEC \
+  "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+  %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
 
 #undef  SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "link_emulation", LINK_EMULATION },\
-  { "dynamic_linker", DYNAMIC_LINKER }
+  { "dynamic_linker", LINUX_DYNAMIC_LINKER }
 
 #undef LINK_SPEC
 #define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
@@ -121,6 +121,15 @@ Boston, MA 02111-1307, USA.  */
        %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \
        %{static:-static}}}"
 
+/* Similar to standard Linux, but adding -ffast-math support.  */
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{mpc32:crtprec32.o%s} \
+   %{mpc64:crtprec64.o%s} \
+   %{mpc80:crtprec80.o%s} \
+   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
 /* A C statement (sans semicolon) to output to the stdio stream
    FILE the assembler definition of uninitialized global DECL named
    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
@@ -140,7 +149,13 @@ Boston, MA 02111-1307, USA.  */
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
       if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
+      else {                                                           \
+       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
+       /* Make sure that we have at least 8 byte alignment if > 8 byte \
+          alignment is preferred.  */                                  \
+       if ((LOG) > 3 && (1 << (LOG)) > ((MAX_SKIP) + 1))               \
+         fprintf ((FILE), "\t.p2align 3\n");                           \
+      }                                                                        \
     }                                                                  \
   } while (0)
 #endif
@@ -170,15 +185,30 @@ Boston, MA 02111-1307, USA.  */
 #define CRT_GET_RFIB_DATA(BASE)                                                \
   __asm__ ("call\t.LPR%=\n"                                            \
           ".LPR%=:\n\t"                                                \
-          "popl\t%0\n\t"                                               \
+          "pop{l}\t%0\n\t"                                             \
           /* Due to a GAS bug, this cannot use EAX.  That encodes      \
              smaller than the traditional EBX, which results in the    \
              offset being off by one.  */                              \
-          "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"                 \
+          "add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"              \
+                  "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}"              \
           : "=d"(BASE))
 #endif
 
+/* Put all *tf routines in libgcc.  */
+#undef LIBGCC2_HAS_TF_MODE
+#define LIBGCC2_HAS_TF_MODE 1
+#define LIBGCC2_TF_CEXT q
+#define TF_SIZE 113
+
 #undef NEED_INDICATE_EXEC_STACK
 #define NEED_INDICATE_EXEC_STACK 1
 
 #define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h"
+
+/* This macro may be overridden in i386/k*bsd-gnu.h.  */
+#define REG_NAME(reg) reg
+
+#ifdef TARGET_LIBC_PROVIDES_SSP
+/* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
+#define TARGET_THREAD_SSP_OFFSET       0x14
+#endif