Subject: cpp switches
To: None <port-mips@NetBSD.org>
From: Masao Uebayashi <uebayasi@gmail.com>
List: port-mips
Date: 11/13/2007 22:01:29
To share source code well among ABIs, we use cpp switches (builtin
definitions) that GCC provides.  These are described in
gnu/dist/gcc4/gcc/config/mips/*.

Now GCC is configured to define __mips_o64 / __mips_n32 / __mips_n64
if the target ABI is O64 / N32 / N64.

Now in sys/arch/mips/include/cdefs.h, _MIPS_BSD_API is defined as either
  - _MIPS_BSD_API_LP32
  - _MIPS_BSD_API_LP32_63CLEAN (!)
  - _MIPS_BSD_API_N32
  - _MIPS_BSD_API_LP64
for O32 / O64 / N32 / N64.

* I think GCC should provide __mips_o32 too for consistency.

* _MIPS_BSD_API_* should be renamed as _MIPS_BSD_API_{O32,O64,N32,N64}
for obvious reasons.

Masao