This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, AArch64, ILP32] 5/5 Define _ILP32 and __ILP32__
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Thu, 27 Jun 2013 19:28:57 +0000
- Subject: Re: [Patch, AArch64, ILP32] 5/5 Define _ILP32 and __ILP32__
- References: <51CB6AAE dot 8030101 at arm dot com> <51CB6E64 dot 7010105 at arm dot com> <Pine dot LNX dot 4 dot 64 dot 1306270054590 dot 30407 at digraph dot polyomino dot org dot uk> <51CC88FD dot 2080004 at arm dot com>
On Thu, 27 Jun 2013, Yufeng Zhang wrote:
> We need a reliable way to tell we are compiling for ILP32. On one hand LLP64
> support may be added in the future; on the other hand, not all AArch64
If thinking of adding a third ABI, that suggests you should be using
something along the lines of _MIPS_SIM - a macro that's always defined,
with an integer value depending on the ABI in used.
> compilers may define _LP64 and __LP64__.
Why should all such compilers define the ILP32 macros, but not all define
the LP64 macros? Do you have an AArch64 equivalent of the ACLE that
specifies such things?
> Other ports like x86_64, ia64-hpux and pa-hpux also define one or both.
If multiple ports define something, that might be an indication for
defining it in target-independent code (like _LP64) rather than repeating
it for more targets. Although of course the macros __SIZEOF_INT__,
__SIZEOF_LONG__, __SIZEOF_LONG_LONG__ and __SIZEOF_POINTER__ have been
around for a long time, so new macros would just be for convenience (which
may nevertheless be a sensible reason to define macros) at the expense of
startup time.
--
Joseph S. Myers
joseph@codesourcery.com