]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/rs6000/sysv4.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / rs6000 / sysv4.h
index 03726b434bdd3c02ad0f21717d7a7106c1c1ae4b..9ade72114e9eeaf809dbe08a19ebfd1ddf77f1ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for GNU compiler for PowerPC running System V.4
-   Copyright (C) 1995-2017 Free Software Foundation, Inc.
+   Copyright (C) 1995-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
    This file is part of GCC.
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* Header files should be C++ aware in general.  */
-#undef  NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
+#undef GNU_USER_TARGET_CRTI
+#define GNU_USER_TARGET_CRTI "%{mnewlib:ecrti.o%s;:crti.o%s}"
+#undef GNU_USER_TARGET_CRTN
+#define GNU_USER_TARGET_CRTN "%{mnewlib:ecrtn.o%s;:crtn.o%s}"
 
 /* Yes!  We are ELF.  */
 #define        TARGET_OBJECT_FORMAT OBJECT_ELF
@@ -38,9 +39,9 @@
 
 /* Override rs6000.h definition.  */
 #undef ASM_DEFAULT_SPEC
-#define        ASM_DEFAULT_SPEC "-mppc"
+#define        ASM_DEFAULT_SPEC "-mppc%{m64:64}"
 
-#define        TARGET_TOC              (TARGET_64BIT                           \
+#define        TARGET_HAS_TOC          (TARGET_64BIT                           \
                                 || (TARGET_MINIMAL_TOC                 \
                                     && flag_pic > 1)                   \
                                 || DEFAULT_ABI != ABI_V4)
@@ -49,7 +50,6 @@
 #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
 
 #define TARGET_SECURE_PLT      secure_plt
 #endif
 
+#if HAVE_AS_PLTSEQ
+#undef TARGET_PLTSEQ
+#define TARGET_PLTSEQ rs6000_pltseq
+#endif
+
 #define SDATA_DEFAULT_SIZE 8
 
 /* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
@@ -160,7 +165,7 @@ do {                                                                        \
     {                                                                  \
       rs6000_sdata = SDATA_NONE;                                       \
       error ("%<%s=%s%> and %<%s-%s%> are incompatible",               \
-            "-msdata", "-mcall", rs6000_sdata_name, rs6000_abi_name);  \
+            "-msdata", rs6000_sdata_name, "-mcall", rs6000_abi_name);  \
     }                                                                  \
                                                                        \
   targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;           \
@@ -191,6 +196,26 @@ do {                                                                       \
       error ("%qs not supported by your assembler", "-msecure-plt");   \
     }                                                                  \
                                                                        \
+  if (TARGET_PLTSEQ != rs6000_pltseq                                   \
+      && global_options_set.x_rs6000_pltseq)                           \
+    {                                                                  \
+      error ("%qs not supported by your assembler", "-mpltseq");       \
+    }                                                                  \
+                                                                       \
+  if (DEFAULT_ABI == ABI_V4 && TARGET_PLTSEQ && !TARGET_SECURE_PLT)    \
+    {                                                                  \
+      if (global_options_set.x_rs6000_pltseq)                          \
+       {                                                               \
+         if (global_options_set.x_secure_plt)                          \
+           error ("%qs and %qs are incompatible",                      \
+                  "-mpltseq", "-mbss-plt");                            \
+         else                                                          \
+           secure_plt = true;                                          \
+       }                                                               \
+      if (!TARGET_SECURE_PLT)                                          \
+       rs6000_pltseq = false;                                          \
+    }                                                                  \
+                                                                       \
   if (flag_pic > 1 && DEFAULT_ABI == ABI_V4)                           \
     {                                                                  \
       /* Note: flag_pic should not change any option flags that would  \
@@ -352,14 +377,14 @@ do {                                                                      \
 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
 #define        ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
   (TARGET_TOC                                                          \
-   && (GET_CODE (X) == SYMBOL_REF                                      \
+   && (SYMBOL_REF_P (X)                                                        \
        || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS     \
-          && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
+          && SYMBOL_REF_P (XEXP (XEXP (X, 0), 0)))                     \
        || GET_CODE (X) == LABEL_REF                                    \
-       || (GET_CODE (X) == CONST_INT                                   \
+       || (CONST_INT_P (X)                                             \
           && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
        || (!TARGET_NO_FP_IN_TOC                                                \
-          && GET_CODE (X) == CONST_DOUBLE                              \
+          && CONST_DOUBLE_P (X)                                        \
           && SCALAR_FLOAT_MODE_P (GET_MODE (X))                        \
           && BITS_PER_WORD == HOST_BITS_PER_INT)))
 
@@ -560,8 +585,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
     %{mcall-openbsd: -mno-eabi }}} \
 %{msdata: -msdata=default} \
 %{mno-sdata: -msdata=none} \
-%{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \
-%{profile: -p}"
+%{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}}" \
+GNU_USER_TARGET_CC1_SPEC
 
 /* Default starting address if specified.  */
 #define LINK_START_SPEC "\
@@ -608,9 +633,6 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
 #define LINK_OS_DEFAULT_SPEC ""
 
-#define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
-       %<msingle-float %<mdouble-float}"
-
 /* Override rs6000.h definition.  */
 #undef CPP_SPEC
 #define        CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
@@ -746,85 +768,32 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
   %{symbolic:-Bsymbolic}"
 
 /* GNU/Linux support.  */
-#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
-%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
-%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
+#define LIB_LINUX_SPEC \
+  "%{mnewlib: --start-group -llinux -lc --end-group; \
+     :" GNU_USER_TARGET_LIB_SPEC "}"
 
-#if ENABLE_OFFLOADING == 1
-#define CRTOFFLOADBEGIN "%{fopenacc|fopenmp:crtoffloadbegin%O%s}"
-#define CRTOFFLOADEND "%{fopenacc|fopenmp:crtoffloadend%O%s}"
-#else
-#define CRTOFFLOADBEGIN ""
-#define CRTOFFLOADEND ""
-#endif
+#define        STARTFILE_LINUX_SPEC GNU_USER_TARGET_STARTFILE_SPEC
 
-/* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC
-   but with the mnewlib ecrti.o%s selection substituted for crti.o%s.  */
-#define        STARTFILE_LINUX_SPEC \
-  "%{shared:; \
-     pg|p|profile:gcrt1.o%s; \
-     static:crt1.o%s; \
-     " PIE_SPEC ":Scrt1.o%s; \
-     :crt1.o%s} \
-   %{mnewlib:ecrti.o%s;:crti.o%s} \
-   %{static:crtbeginT.o%s; \
-     shared|" PIE_SPEC ":crtbeginS.o%s; \
-     :crtbegin.o%s} \
-   %{fvtable-verify=none:%s; \
-     fvtable-verify=preinit:vtv_start_preinit.o%s; \
-     fvtable-verify=std:vtv_start.o%s} \
-   " CRTOFFLOADBEGIN
-
-/* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC
-   but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s.  */
-#define ENDFILE_LINUX_SPEC \
-  "%{fvtable-verify=none:%s; \
-     fvtable-verify=preinit:vtv_end_preinit.o%s; \
-     fvtable-verify=std:vtv_end.o%s} \
-   %{static:crtend.o%s; \
-     shared|" PIE_SPEC ":crtendS.o%s; \
-     :crtend.o%s} \
-   %{mnewlib:ecrtn.o%s;:crtn.o%s} \
-   " CRTOFFLOADEND
+#define ENDFILE_LINUX_SPEC GNU_USER_TARGET_ENDFILE_SPEC
 
 #define LINK_START_LINUX_SPEC ""
 
 #define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
 
 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#undef MUSL_DYNAMIC_LINKER
 #define MUSL_DYNAMIC_LINKER \
   "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
-#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
-  "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
-#elif DEFAULT_LIBC == LIBC_MUSL
-#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
-  "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
-#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
-  "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
-#else
-#error "Unsupported DEFAULT_LIBC"
+
+#ifndef GNU_USER_DYNAMIC_LINKER
+#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
 #endif
-#define GNU_USER_DYNAMIC_LINKER \
-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
-                        MUSL_DYNAMIC_LINKER)
 
 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
   %{rdynamic:-export-dynamic} \
   -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
 
-#if defined(HAVE_LD_EH_FRAME_HDR)
-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-#endif
-
-#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
-%{!undef:                                                        \
-  %{!ansi:                                                       \
-    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                          \
-    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}              \
--Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
+#define CPP_OS_LINUX_SPEC "%{pthread:-D_REENTRANT}"
 
 /* NetBSD support.  */
 #define LIB_NETBSD_SPEC "\