OSDN Git Service

2010-11-17 Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / sysv4.h
index 8e30980..e82a1c6 100644 (file)
@@ -1,6 +1,6 @@
 /* Target definitions for GNU compiler for PowerPC running System V.4
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
    This file is part of GCC.
    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 COPYING3.  If not see
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
 /* Header files should be C++ aware in general.  */
@@ -54,9 +59,11 @@ extern enum rs6000_sdata_type rs6000_sdata;
 
 #define        TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
 #define        TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
+#define        TARGET_PROTOTYPE        target_prototype
 #define        TARGET_NO_PROTOTYPE     (! TARGET_PROTOTYPE)
 #define        TARGET_NO_TOC           (! TARGET_TOC)
 #define        TARGET_NO_EABI          (! TARGET_EABI)
+#define        TARGET_REGNAMES         rs6000_regnames
 
 #ifdef HAVE_AS_REL16
 #undef TARGET_SECURE_PLT
@@ -69,18 +76,12 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
 
 #define SDATA_DEFAULT_SIZE 8
 
-/* Sometimes certain combinations of command options do not make sense
-   on a particular target machine.  You can define a macro
-   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
-   defined, is executed once just after all the command options have
-   been parsed.
-
-   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
-   get control.  */
+/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
+   get control in TARGET_OPTION_OVERRIDE.  */
 
 #define SUBTARGET_OVERRIDE_OPTIONS                                     \
 do {                                                                   \
-  if (!g_switch_set)                                                   \
+  if (!global_options_set.x_g_switch_value)                            \
     g_switch_value = SDATA_DEFAULT_SIZE;                               \
                                                                        \
   if (rs6000_abi_name == NULL)                                         \
@@ -119,9 +120,9 @@ do {                                                                        \
   else if (!strcmp (rs6000_abi_name, "i960-old"))                      \
     {                                                                  \
       rs6000_current_abi = ABI_V4;                                     \
-      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI                  \
-                      | MASK_NO_BITFIELD_WORD);                        \
+      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI);                        \
       target_flags &= ~MASK_STRICT_ALIGN;                              \
+      TARGET_NO_BITFIELD_WORD = 1;                                     \
     }                                                                  \
   else                                                                 \
     {                                                                  \
@@ -222,7 +223,8 @@ do {                                                                        \
     }                                                                  \
                                                                        \
   else if (TARGET_RELOCATABLE)                                         \
-    flag_pic = 2;                                                      \
+    if (!flag_pic)                                                     \
+      flag_pic = 2;                                                    \
 } while (0)
 
 #ifndef RS6000_BI_ARCH
@@ -257,36 +259,26 @@ do {                                                                      \
 #define        BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 #define        WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 /* Define cutoff for using external functions to save floating point.
-   Currently on 64-bit V.4, always use inline stores.  When optimizing
-   for size on 32-bit targets, use external functions when
-   profitable.  */
-#define FP_SAVE_INLINE(FIRST_REG) (optimize_size && !TARGET_64BIT      \
+   When optimizing for size, use external functions when profitable.  */
+#define FP_SAVE_INLINE(FIRST_REG) (optimize_size                       \
                                   ? ((FIRST_REG) == 62                 \
                                      || (FIRST_REG) == 63)             \
                                   : (FIRST_REG) < 64)
 /* And similarly for general purpose registers.  */
 #define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32    \
-                                  && (TARGET_64BIT || !optimize_size))
+                                  && !optimize_size)
 
 /* Put jump tables in read-only memory, rather than in .text.  */
 #define JUMP_TABLES_IN_TEXT_SECTION 0
 
 /* Prefix and suffix to use to saving floating point.  */
 #define        SAVE_FP_PREFIX "_savefpr_"
-#define SAVE_FP_SUFFIX (TARGET_64BIT ? "_l" : "")
+#define SAVE_FP_SUFFIX ""
 
 /* Prefix and suffix to use to restoring floating point.  */
 #define        RESTORE_FP_PREFIX "_restfpr_"
-#define RESTORE_FP_SUFFIX (TARGET_64BIT ? "_l" : "")
+#define RESTORE_FP_SUFFIX ""
 
 /* Type used for ptrdiff_t, as a string used in a declaration.  */
 #define PTRDIFF_TYPE "int"
@@ -381,8 +373,8 @@ do {                                                                        \
    containing one of them.  If -mfp-in-toc (the default), we also do
    this for floating-point constants.  We actually can only do this
    if the FP formats of the target and host machines are the same, but
-   we can't check that since not every file that uses
-   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
+   we can't check that since not every file that uses these target macros
+   includes real.h.
 
    Unlike AIX, we don't key off of -mminimal-toc, but instead do not
    allow floating point constants in the TOC if -mrelocatable.  */
@@ -411,8 +403,6 @@ do {                                                                        \
    Some svr4 assemblers need to also have something extra said about the
    function's return value.  We allow for that here.  */
 
-extern int rs6000_pic_labelno;
-
 /* Override elfos.h definition.  */
 #undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                    \
@@ -511,17 +501,6 @@ do {                                                                       \
                 reg_names[1]);                                         \
 } while (0)
 
-/* Switch  Recognition by gcc.c.  Add -G xx support.  */
-
-/* Override svr4.h definition.  */
-#undef SWITCH_TAKES_ARG
-#define        SWITCH_TAKES_ARG(CHAR)                                          \
-  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'                     \
-   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'                  \
-   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'                  \
-   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'                  \
-   || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
-
 extern int fixuplabelno;
 
 /* Handle constructors specially for -mrelocatable.  */
@@ -585,10 +564,10 @@ extern int fixuplabelno;
 /* Override svr4.h definition.  */
 #undef ASM_SPEC
 #define        ASM_SPEC "%(asm_cpu) \
-%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
-%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
-%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
-%{memb|msdata|msdata=eabi: -memb} \
+%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
+SVR4_ASM_SPEC \
+"%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
+%{memb|msdata=eabi: -memb} \
 %{mlittle|mlittle-endian:-mlittle; \
   mbig|mbig-endian      :-mbig;    \
   mcall-aixdesc |                 \
@@ -862,7 +841,7 @@ extern int fixuplabelno;
 #define LINK_START_FREEBSD_SPEC        ""
 
 #define LINK_OS_FREEBSD_SPEC "\
-  %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
+  %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
   %{v:-V} \
   %{assert*} %{R*} %{rpath*} %{defsym*} \
   %{shared:-Bshareable %{h*} %{soname*}} \
@@ -898,10 +877,12 @@ extern int fixuplabelno;
 
 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+#if DEFAULT_LIBC == LIBC_UCLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
 #else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
+#error "Unsupported DEFAULT_LIBC"
 #endif
 #define LINUX_DYNAMIC_LINKER \
   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)