This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ARM] EABI and the default to short enums


On 02/14/2012 04:05 PM, Ian Lance Taylor wrote:
Sebastian Huber<sebastian.huber@embedded-brains.de> writes:

the default ARM EABI configuration uses short enums by default (from
"gcc/config/arm/arm.c":

/* AAPCS based ABIs use short enums by default. */

static bool
arm_default_short_enums (void)
{
   return TARGET_AAPCS_BASED&&  arm_abi != ARM_ABI_AAPCS_LINUX;
}

This causes a major headache for me since some libraries assume that
sizeof(any enum)>  1, e.g. the standard XDR library.  Is the only
possible way to disable short enums to set the ABI to
ARM_ABI_AAPCS_LINUX?  Which side effects does this have?

This question would be better asked on the mailing list gcc-help@gcc.gnu.org rather than gcc@gcc.gnu.org. The gcc@ mailing list is for issues related to the development of gcc itself. Please take any followups to gcc-help. Thanks.

You can use -fno-short-enums.  However, see the note about ABI
compatibility in the -fshort-enums doc.

The problem is that I need a proper GCC ARM configuration for the RTEMS tool chain. To do this I have to provide the right definitions in


gcc/config/arm/rtems-eabi.h
gcc/config/arm/t-rtems-eabi

and this is clearly not a GCC user problem. The so called ARM ELF configuration didn't use short enums by default. It seems that Linux faced this problem before and now we have this exception in the arm_default_short_enums() function above. I want to preserve the ARM ELF behavior with respect to enums also in the ARM EABI configuration. The question is now who to achieve this. One option is to set the ABI to ARM_ABI_AAPCS_LINUX also for the RTEMS tool chain, but I am not sure that this is the right thing.

--
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]