This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [csl-arm] Tweaks to the linux-gnueabi configuration
On Mon, Mar 07, 2005 at 10:14:24AM +0000, Richard Earnshaw wrote:
> On Fri, 2005-03-04 at 21:26, Daniel Jacobowitz wrote:
> > Tested by comparing the predefined macros and size of enums on arm-eabi
> > and arm-linux-gnueabi. Fixes various things I noticed while comparing.
> > OK for csl-arm-branch?
>
> This is OK apart from the SUBTARGET_CPU_DEFAULT change which doesn't
> seem to belong in this patch (and wasn't mentioned in the ChangeLog).
* config/arm/linux-eabi.h (ARM_DEFAULT_ABI, SUBTARGET_CPU_DEFAULT)
The EABI really isn't applicable to anything before armv4t; I figure
carrying around the Linux default of armv3 is a bit excessive. I'll
commit without that bit for now, but is that OK? Should it be armv5?
Checked in like so - I missed the obvious documentation update.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-03-07 Daniel Jacobowitz <dan@codesourcery.com>
* config/arm/arm.c (arm_all_abis): Add aapcs-linux.
(arm_override_options): Use TARGET_AAPCS_BASED.
* config/arm/arm.h (enum arm_abi_type): Add ARM_ABI_AAPCS_LINUX.
(PTRDIFF_TYPE): Use int for AAPCS.
(DEFAULT_SHORT_ENUMS): Use false for aapcs-linux.
* config/arm/linux-eabi.h (ARM_DEFAULT_ABI, WCHAR_TYPE): Define.
(DEFAULT_SHORT_ENUMS): Delete.
* doc/invoke.texi (ARM Options): Document -mabi=aapcs-linux.
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.71
diff -u -p -r1.303.2.71 arm.c
--- config/arm/arm.c 27 Jan 2005 22:00:29 -0000 1.303.2.71
+++ config/arm/arm.c 7 Mar 2005 14:11:03 -0000
@@ -628,7 +628,8 @@ static const struct abi_name arm_all_abi
{"apcs-gnu", ARM_ABI_APCS},
{"atpcs", ARM_ABI_ATPCS},
{"aapcs", ARM_ABI_AAPCS},
- {"iwmmxt", ARM_ABI_IWMMXT}
+ {"iwmmxt", ARM_ABI_IWMMXT},
+ {"aapcs-linux", ARM_ABI_AAPCS_LINUX}
};
/* Return the number of bits set in VALUE. */
@@ -1109,7 +1110,7 @@ arm_override_options (void)
flag_schedule_insns = flag_schedule_insns_after_reload = 0;
/* Override the default structure alignment for AAPCS ABI. */
- if (arm_abi == ARM_ABI_AAPCS)
+ if (TARGET_AAPCS_BASED)
arm_structure_size_boundary = 8;
if (structure_size_string != NULL)
Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.210.2.53
diff -u -p -r1.210.2.53 arm.h
--- config/arm/arm.h 27 Jan 2005 21:35:33 -0000 1.210.2.53
+++ config/arm/arm.h 7 Mar 2005 14:11:03 -0000
@@ -490,7 +490,8 @@ enum arm_abi_type
ARM_ABI_APCS,
ARM_ABI_ATPCS,
ARM_ABI_AAPCS,
- ARM_ABI_IWMMXT
+ ARM_ABI_IWMMXT,
+ ARM_ABI_AAPCS_LINUX
};
extern enum arm_abi_type arm_abi;
@@ -716,8 +717,12 @@ extern const char * structure_size_strin
#define SIZE_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long unsigned int")
#endif
+#ifndef PTRDIFF_TYPE
+#define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int")
+#endif
+
#ifndef DEFAULT_SHORT_ENUMS
-#define DEFAULT_SHORT_ENUMS TARGET_AAPCS_BASED
+#define DEFAULT_SHORT_ENUMS (TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX)
#endif
/* AAPCS requires that structure alignment is affected by bitfields. */
Index: config/arm/linux-eabi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/Attic/linux-eabi.h,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 linux-eabi.h
--- config/arm/linux-eabi.h 15 Dec 2004 19:26:50 -0000 1.1.2.3
+++ config/arm/linux-eabi.h 7 Mar 2005 14:11:03 -0000
@@ -36,6 +36,11 @@
#undef TARGET_DEFAULT_FLOAT_ABI
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+/* We default to the "aapcs-linux" ABI so that enums are int-sized by
+ default. */
+#undef ARM_DEFAULT_ABI
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+
#undef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC "-m armelf_linux_eabi"
@@ -53,5 +58,7 @@
do not use -lfloat. */
#undef LIBGCC_SPEC
-/* Do not use short enums for the GNU/Linux platform. */
-#define DEFAULT_SHORT_ENUMS 0
+/* Use the AAPCS type for wchar_t, or the previous Linux default for
+ non-AAPCS. */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")