/* Definitions for 64-bit PowerPC running FreeBSD using the ELF format
- Copyright (C) 2012-2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2020 Free Software Foundation, Inc.
This file is part of GCC.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+/* Undef gnu-user.h macros we don't want. */
+#undef CPLUSPLUS_CPP_SPEC
+#undef LINK_GCC_C_SEQUENCE_SPEC
+
/* Override the defaults, which exist to force the proper definition. */
#ifdef IN_LIBGCC2
#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 \
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; \
if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
{ \
rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
- error ("-m64 requires a PowerPC64 cpu"); \
+ error ("%<-m64%> requires a PowerPC64 cpu"); \
} \
if ((rs6000_isa_flags_explicit \
& OPTION_MASK_MINIMAL_TOC) != 0) \
{ \
if (global_options_set.x_rs6000_current_cmodel \
&& rs6000_current_cmodel != CMODEL_SMALL) \
- error ("-mcmodel incompatible with other toc options"); \
+ error ("%<-mcmodel%> incompatible with other toc options"); \
SET_CMODEL (CMODEL_SMALL); \
} \
else \
} \
while (0)
-#undef ASM_DEFAULT_SPEC
#undef ASM_SPEC
#undef LINK_OS_FREEBSD_SPEC
-#define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
#define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
#define LINK_OS_FREEBSD_SPEC "%{m32:%(link_os_freebsd_spec32)}%{!m32:%(link_os_freebsd_spec64)}"
#define ASM_SPEC32 "-a32 \
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
+%{mrelocatable} %{mrelocatable-lib} %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
%{memb} %{!memb: %{msdata=eabi: -memb}} \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-freebsd: -mbig} \
{ "link_os_freebsd_spec32", LINK_OS_FREEBSD_SPEC32 }, \
{ "link_os_freebsd_spec64", LINK_OS_FREEBSD_SPEC64 },
-#define FREEBSD_DYNAMIC_LINKER32 "/libexec/ld-elf32.so.1"
-#define FREEBSD_DYNAMIC_LINKER64 "/libexec/ld-elf.so.1"
-
-#define LINK_OS_FREEBSD_SPEC_DEF32 "\
+#define LINK_OS_FREEBSD_SPEC_DEF "\
%{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
%{v:-V} \
%{assert*} %{R*} %{rpath*} %{defsym*} \
%{!shared: \
%{!static: \
%{rdynamic: -export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " FREEBSD_DYNAMIC_LINKER32 "}} \
+ %{!dynamic-linker:-dynamic-linker " FBSD_DYNAMIC_LINKER "}} \
%{static:-Bstatic}} \
%{symbolic:-Bsymbolic}"
-#define LINK_OS_FREEBSD_SPEC_DEF64 "\
- %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic: -export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " FREEBSD_DYNAMIC_LINKER64 "}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-#define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF32
+#define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
-#define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF64
+#define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "m64" }
registers and memory. FIRST is nonzero if this is the only
element. */
#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
- (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
+ (!(FIRST) ? PAD_UPWARD : targetm.calls.function_arg_padding (MODE, TYPE))
/* FreeBSD doesn't support saving and restoring 64-bit regs with a 32-bit
kernel. This is supported when running on a 64-bit kernel with
/* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
+
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
-
-/* Override rs6000.h definition. */
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-
-/* Override rs6000.h definition. */
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
/* Function profiling bits */
#undef RS6000_MCOUNT
#define RS6000_MCOUNT "_mcount"
true if the symbol may be affected by dynamic relocations. */
#undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
- ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \
+ (TARGET_64BIT || flag_pic \
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
| (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
: DW_EH_PE_absptr)
/* The default value isn't sufficient in 64-bit mode. */
#define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
-#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
+/* Use standard DWARF numbering for DWARF debugging information. */
+#define RS6000_USE_DWARF_NUMBERING
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
#undef ADJUST_FIELD_ALIGN
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
+#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
+ (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \
? 128 \
: (TARGET_64BIT \
&& TARGET_ALIGN_NATURAL == 0 \
- && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
+ && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \
? MIN ((COMPUTED), 32) \
: (COMPUTED))
#define MINIMAL_TOC_SECTION_ASM_OP \
(TARGET_64BIT \
? "\t.section\t\".toc1\",\"aw\"" \
- : ((TARGET_RELOCATABLE || flag_pic) \
+ : (flag_pic \
? "\t.section\t\".got2\",\"aw\"" \
: "\t.section\t\".got1\",\"aw\""))
#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)) \
- || (GET_CODE (X) == CONST_DOUBLE \
+ || (CONST_DOUBLE_P (X) \
&& ((TARGET_64BIT \
&& (TARGET_MINIMAL_TOC \
|| (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
&& ! TARGET_NO_FP_IN_TOC))) \
|| (!TARGET_64BIT \
&& !TARGET_NO_FP_IN_TOC \
- && !TARGET_RELOCATABLE \
&& SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
&& BITS_PER_WORD == HOST_BITS_PER_INT)))))