From: Andreas Tobler Date: Tue, 1 Dec 2015 20:17:37 +0000 (+0100) Subject: freebsd64.h (ELFv2_ABI_CHECK): Add new macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5f310313531456890c23279d248afb7e5cecf71;p=gcc.git freebsd64.h (ELFv2_ABI_CHECK): Add new macro. 2015-12-01 Andreas Tobler * 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: r231129 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c94f88b8cd6..9a78b7a9bd4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-01 Andreas Tobler + + * 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-01 Nathan Sidwell * config/nvptx/nvptx-protos.h (nvptx_output_aligned_decl): Declare. diff --git a/gcc/config/rs6000/freebsd64.h b/gcc/config/rs6000/freebsd64.h index b5435c10838..c667f0dc7f8 100644 --- a/gcc/config/rs6000/freebsd64.h +++ b/gcc/config/rs6000/freebsd64.h @@ -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; \