]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: freebsd64.h (ELFv2_ABI_CHECK): Add new macro.
authorAndreas Tobler <andreast@gcc.gnu.org>
Fri, 4 Dec 2015 20:25:56 +0000 (21:25 +0100)
committerAndreas Tobler <andreast@gcc.gnu.org>
Fri, 4 Dec 2015 20:25:56 +0000 (21:25 +0100)
2015-12-04  Andreas Tobler  <andreast@gcc.gnu.org>

    Backport from mainline
    2015-12-01  Andreas Tobler  <andreast@gcc.gnu.org>

    * config/rs6000/freebsd64.h (ELFv2_ABI_CHECK): Add new macro.
    (SUBSUBTARGET_OVERRIDE_OPTIONS): Use it to decide whether to set
    rs6000_current_abi to ABI_AIX or ABI_ELFv2.

From-SVN: r231306

gcc/ChangeLog
gcc/config/rs6000/freebsd64.h

index f0e5d6f245e97cf0644d972f9913d14ce68f22cd..de5c0bdaa1e0d729cbaa2a23ffba853fd7eb8e51 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-04  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       Backport from mainline
+       2015-12-01  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       * config/rs6000/freebsd64.h (ELFv2_ABI_CHECK): Add new macro.
+       (SUBSUBTARGET_OVERRIDE_OPTIONS): Use it to decide whether to set
+       rs6000_current_abi to ABI_AIX or ABI_ELFv2.
+
 2015-12-02  Renlin Li  <renlin.li@arm.com>
 
        Backport from mainline.
index 0348670892192ed4ced489f22f7b878e9b3cd13c..062a980f63a59f5eee051ed25e97cf2a1c22d60a 100644 (file)
@@ -65,6 +65,13 @@ extern int dot_symbols;
 #define INVALID_64BIT "-m%s not supported in this configuration"
 #define INVALID_32BIT INVALID_64BIT
 
+/* Use LINUX64 instead of FREEBSD64 for compat with e.g. sysv4le.h */
+#ifdef LINUX64_DEFAULT_ABI_ELFv2
+#define ELFv2_ABI_CHECK (rs6000_elf_abi != 1)
+#else
+#define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)
+#endif
+
 #undef  SUBSUBTARGET_OVERRIDE_OPTIONS
 #define SUBSUBTARGET_OVERRIDE_OPTIONS                          \
   do                                                           \
@@ -84,6 +91,12 @@ extern int dot_symbols;
              rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE;     \
              error (INVALID_64BIT, "relocatable");             \
            }                                                   \
+         if (ELFv2_ABI_CHECK)                                  \
+           {                                                   \
+             rs6000_current_abi = ABI_ELFv2;                   \
+             if (dot_symbols)                                  \
+               error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
+           }                                                   \
          if (rs6000_isa_flags & OPTION_MASK_EABI)              \
            {                                                   \
              rs6000_isa_flags &= ~OPTION_MASK_EABI;            \