This is the mail archive of the
mailing list for the newlib project.
Re: Build fails for mips1
- From: Steve Ellcey <steve dot ellcey at imgtec dot com>
- To: Joel Sherrill <Joel dot Sherrill at OARcorp dot com>
- Cc: Ivan Sichmann Freitas <ivansichfreitas at gmail dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Mon, 11 Feb 2013 13:43:20 -0800
- Subject: Re: Build fails for mips1
- References: <firstname.lastname@example.org>
On Sun, 2013-02-10 at 15:28 -0600, Joel Sherrill wrote:
> I have a hack of a patch to get mips-rtems to build. I thought I had posted it but maybe I didn't.
> I think it is a bug in the new implementation.
Yes, this is a bug. I have been able to reproduce it. The problem is
#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
(_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
When building for mips-elf, _MIPS_ISA is defined (by GCC) as _MIPS_ISA_MIPS1.
The problem is that _MIPS_ISA_MIPS1 (and MIPS4, and MIPS5, etc) are not defined
to have any specific values. So _MIPS_ISA is expanded to _MIPS_ISA_MIPS1 and
_MIPS_ISA_MIPS1 is expanded to 'nothing'. Since the value of '_MIPS_ISA_MIPS4'
is also 'nothing', they match and we set USE_PREFETCH when we shouldn't.
The long term fix is to fix the defines that GCC does for the MIPS_ISA macros, but
in the short term I guess we could check a different define, I see GCC is also doing
these defines with mips1:
#define _MIPS_ARCH_MIPS1 1
#define _MIPS_ARCH "mips1"
We could check one of those. I will send a patch soon.