aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/sysv4.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-06-04 17:23:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2003-06-04 17:23:42 +0200
commit9739c90c8dd255fbc0a47814454b70f270f09aad (patch)
treede85908a357b1e8e25a4356a59ac8686963b75dc /gcc/config/rs6000/sysv4.h
parent150b72ed1f83d507c049fd84cd41172b14cc99b4 (diff)
downloadgcc-9739c90c8dd255fbc0a47814454b70f270f09aad.zip
gcc-9739c90c8dd255fbc0a47814454b70f270f09aad.tar.gz
gcc-9739c90c8dd255fbc0a47814454b70f270f09aad.tar.bz2
linux.h (NO_PROFILE_COUNTERS): Define to 1.
* config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1. * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise. * config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise. * config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise. * config/darwin.h (NO_PROFILE_COUNTERS): Likewise. * final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined. (profile_function): Allow NO_PROFILE_COUNTERS to be non-constant. * config/rs6000/rs6000.c (output_profile_hook): Likewise. * configure.in (powerpc*-*, s390*-*): Set tls_as_opt. Pass it to $gcc_cv_as. * configure: Rebuilt. * config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer. (print_operand): Allow TARGET_AIX to be non-constant. (rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore): Define unconditionally. (rs6000_elf_declare_function_name): New function. * config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be non-constant. * config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define to 1. (DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define. [IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__ is defined. (TARGET_AIX): Define to 1 if TARGET_64BIT. (PROCESSOR_DEFAULT): Remove. (TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT, INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define. [RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define. (ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both -m32 and -m64. (MULTILIB_DEFAULTS): Define. (SUBSUBTARGET_EXTRA_SPECS): Define. (ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define. (TARGET_TOC): Define only if !RS6000_BI_ARCH. (TARGET_NO_TOC): Remove. [!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI, TARGET_PROTOTYPE): Define to 0. (NO_PROFILE_COUNTERS): Define to TARGET_64BIT. (PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT. (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly if !TARGET_64BIT. (USER_LABEL_PREFIX): Remove. (JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT. (SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init if TARGET_64BIT. (TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64. (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define. (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove. (TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT. (MINIMAL_TOC_SECTION_ASM_OP): Likewise. (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on TARGET_64BIT. (RS6000_CALL_GLUE): Likewise. (SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX, RESTORE_FP_SUFFIX): Likewise. (ASM_DECLARE_FUNCTION_NAME): Remove. (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function name if TARGET_64BIT. (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and !TARGET_64BIT. (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs. (ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account. (DRAFT_V4_STRUCT_RET): Define. (SIGNAL_FRAMESIZE): New enum value. (MD_FALLBACK_FRAME_STATE_FOR): Define. * config/rs6000/default64.h: New file. * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64 options. (SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc if !TARGET_64BIT. [!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name function. (TARGET_OS_SYSV_CPP_BUILTINS): Define. (TARGET_OS_CPP_BUILTINS): Use it. (CPP_SYSV_SPEC): Remove. (CPP_SPEC): Remove cpp_sysv. (SUBTARGET_EXTRA_SPECS): Remove cpp_sysv. Add SUBSUBTARGET_EXTRA_SPECS. (SUBSUBTARGET_EXTRA_SPECS): Define. * config/rs6000/biarch64.h: New file. * config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name): New prototype. * config/rs6000/x-linux64: New file. * config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float multilibs. * config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__. * config/rs6000/eabi-cn.asm: Likewise. * config/rs6000/tramp.asm: Likewise. * config/rs6000/sol-ci.asm: Likewise. * config/rs6000/sol-cn.asm: Likewise. * config/rs6000/linux.h (TARGET_64BIT): Define to 0. (TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS. * config/rs6000/ppc-asm.h: Move __powerpc64__ section before _CALL_AIXDESC section. * config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler, defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs or default32. Co-Authored-By: Alan Modra <amodra@bigpond.net.au> From-SVN: r67442
Diffstat (limited to 'gcc/config/rs6000/sysv4.h')
-rw-r--r--gcc/config/rs6000/sysv4.h97
1 files changed, 42 insertions, 55 deletions
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index d91dd3d..57b26e3 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -149,6 +149,10 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
N_("Set the PPC_EMB bit in the ELF flags header") }, \
{ "windiss", 0, N_("Use the WindISS simulator") }, \
{ "shlib", 0, N_("no description yet") }, \
+ { "64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \
+ N_("Generate 64-bit code") }, \
+ { "32", - (MASK_64BIT | MASK_POWERPC64), \
+ N_("Generate 32-bit code") }, \
EXTRA_SUBTARGET_SWITCHES \
{ "newlib", 0, N_("no description yet") },
@@ -172,6 +176,9 @@ do { \
if (!g_switch_set) \
g_switch_value = SDATA_DEFAULT_SIZE; \
\
+ if (rs6000_abi_name == NULL) \
+ rs6000_abi_name = RS6000_ABI_NAME; \
+ \
if (!strcmp (rs6000_abi_name, "sysv")) \
rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
@@ -274,7 +281,7 @@ do { \
rs6000_abi_name); \
} \
\
- if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \
+ if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX) \
{ \
flag_pic = 0; \
error ("-fPIC and -mcall-%s are incompatible", \
@@ -293,9 +300,16 @@ do { \
\
else if (TARGET_RELOCATABLE) \
flag_pic = 2; \
- \
} while (0)
+#ifndef RS6000_BI_ARCH
+# define SUBSUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
+ error ("-m%s not supported in this configuration", \
+ (target_flags & MASK_64BIT) ? "64" : "32"); \
+} while (0)
+#endif
/* Override rs6000.h definition. */
#undef TARGET_DEFAULT
@@ -590,51 +604,7 @@ extern int rs6000_pic_labelno;
/* Override elfos.h definition. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
- do { \
- const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
- \
- if (TARGET_RELOCATABLE \
- && (get_pool_size () != 0 || current_function_profile) \
- && uses_TOC()) \
- { \
- char buf[256]; \
- \
- (*targetm.asm_out.internal_label) (FILE, "LCL", rs6000_pic_labelno); \
- \
- ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
- fprintf (FILE, "\t%s ", init_ptr); \
- assemble_name (FILE, buf); \
- putc ('-', FILE); \
- ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
- assemble_name (FILE, buf); \
- putc ('\n', FILE); \
- } \
- \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
- ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
- \
- if (DEFAULT_ABI == ABI_AIX) \
- { \
- const char *desc_name, *orig_name; \
- \
- orig_name = (*targetm.strip_name_encoding) (NAME); \
- desc_name = orig_name; \
- while (*desc_name == '.') \
- desc_name++; \
- \
- if (TREE_PUBLIC (DECL)) \
- fprintf (FILE, "\t.globl %s\n", desc_name); \
- \
- fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
- fprintf (FILE, "%s:\n", desc_name); \
- fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
- fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
- if (DEFAULT_ABI == ABI_AIX) \
- fprintf (FILE, "\t%s 0\n", init_ptr); \
- fprintf (FILE, "\t.previous\n"); \
- } \
- ASM_OUTPUT_LABEL (FILE, NAME); \
- } while (0)
+ rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
@@ -789,6 +759,25 @@ extern int fixuplabelno;
#define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
#endif
+#define TARGET_OS_SYSV_CPP_BUILTINS() \
+ do \
+ { \
+ if (flag_pic == 1) \
+ { \
+ builtin_define ("__pic__=1"); \
+ builtin_define ("__PIC__=1"); \
+ } \
+ else if (flag_pic == 2) \
+ { \
+ builtin_define ("__pic__=2"); \
+ builtin_define ("__PIC__=2"); \
+ } \
+ if (target_flags_explicit \
+ & MASK_RELOCATABLE) \
+ builtin_define ("_RELOCATABLE"); \
+ } \
+ while (0)
+
#ifndef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -800,6 +789,7 @@ extern int fixuplabelno;
builtin_assert ("system=svr4"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \
+ TARGET_OS_SYSV_CPP_BUILTINS (); \
} \
while (0)
#endif
@@ -945,14 +935,9 @@ extern int fixuplabelno;
#define LINK_OS_DEFAULT_SPEC ""
-#define CPP_SYSV_SPEC \
-"%{mrelocatable*: -D_RELOCATABLE} \
-%{fpic|fpie: -D__PIC__=1 -D__pic__=1} \
-%{!fpic: %{fPIC|fPIE: -D__PIC__=2 -D__pic__=2}}"
-
/* Override rs6000.h definition. */
#undef CPP_SPEC
-#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \
+#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{mads : %(cpp_os_ads) ; \
myellowknife : %(cpp_os_yellowknife) ; \
mmvme : %(cpp_os_mvme) ; \
@@ -1219,7 +1204,6 @@ ncrtn.o%s"
/* Override rs6000.h definition. */
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
- { "cpp_sysv", CPP_SYSV_SPEC }, \
{ "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \
{ "lib_ads", LIB_ADS_SPEC }, \
{ "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
@@ -1288,7 +1272,10 @@ ncrtn.o%s"
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
{ "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
{ "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \
- { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
+ { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
+ SUBSUBTARGET_EXTRA_SPECS
+
+#define SUBSUBTARGET_EXTRA_SPECS
/* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are