diff mbox

add ELFv2 check to FreeBSD PowerPC64

Message ID 565B6AE8.40101@fgznet.ch
State New
Headers show

Commit Message

Andreas Tobler Nov. 29, 2015, 9:15 p.m. UTC
Hi all,

I'd like to commit this patch to trunk.

It is FreeBSD only.

If nobody objects I'll commit it within two days.

Thanks,

Andreas

2015-11-29  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.

Comments

Andreas Tobler Dec. 1, 2015, 9:47 p.m. UTC | #1
On 29.11.15 22:15, Andreas Tobler wrote:
> Hi all,
>
> I'd like to commit this patch to trunk.
>
> It is FreeBSD only.
>
> If nobody objects I'll commit it within two days.
>
> Thanks,
>
> Andreas
>
> 2015-11-29  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.
>


Committed to trunk. I'll wait till gcc5 opens again and then I'll 
backport to gcc5 and gcc49.

Thanks,
Andreas
Andreas Tobler Dec. 4, 2015, 8:52 p.m. UTC | #2
On 01.12.15 22:47, Andreas Tobler wrote:
> On 29.11.15 22:15, Andreas Tobler wrote:
>> Hi all,
>>
>> I'd like to commit this patch to trunk.
>>
>> It is FreeBSD only.
>>
>> If nobody objects I'll commit it within two days.
>>
>> Thanks,
>>
>> Andreas
>>
>> 2015-11-29  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.
>>
>
>
> Committed to trunk. I'll wait till gcc5 opens again and then I'll
> backport to gcc5 and gcc49.

Done with 231302 and 231306.

Andreas
diff mbox

Patch

Index: config/rs6000/freebsd64.h
===================================================================
--- config/rs6000/freebsd64.h	(revision 231047)
+++ config/rs6000/freebsd64.h	(working copy)
@@ -65,6 +65,13 @@ 
 #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 @@ 
 	      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;		\