sparc-rtems is built using Solaris specific config/sparc/* files and
as a result ends up with unix predefined.
NOTE: sparc-elf may also suffer from this but this was not investigated.
Created attachment 5902 [details]
patch to rewrite config/sparc/rtemself.h
Please review so I can commit this before 3.4.0.
Based upon a review of config.gcc, I believe sparc-elf, sparc64-elf and
sparclite-elf have the same problem since they include the solaris specific
The embedded sparc targets could probably be modified in a similar way and
longer term all share some common underlying file(s).
This has been a lurking issue but not a critical one. We added a stub for
mprotect() to RTEMS a long time ago to workaround this the first time.
But now the gnat run-time checks for defined(unix) and decides
it is on a unix box instead of an embedded sparc. This results
in real breakage.
Given the complexity of the conditionals in some of the Ada run-time code, I
wouldn't be surprised if they have discovered other cpp predefine
inconsistencies and are covering them up. Look at gcc/ada/init.c and
gcc/ada/sysdep.c have some pretty complicated conditionals. I have to
wonder if some vxworks target doesn't have this problem based upon this
code from ctrl_c.c:
#if (defined (_AIX) || defined (unix)) && !defined (__vxworks)
which I read as meaning there is some VxWorks target with unix defined.
This is OK for 3.4.0.
This patch was okayed for 3.4.0 but never applied, Mark I know you do not want any
patch which can cause many problems at this point as we are about to release but is this
still okay to apply for 3.4.0? Joel if Mark says it is okay, then please apply right away as
the release is near.
Subject: Re: sparc-rtems predefines unix
pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-07 02:57 -------
> This patch was okayed for 3.4.0 but never applied, Mark I know you do not want any
> patch which can cause many problems at this point as we are about to release but is this
> still okay to apply for 3.4.0? Joel if Mark says it is okay, then please apply right away as
> the release is near.
I have not committed this because I do not have a working
3.4.x sparc-rtems toolset. I got side-tracked with
the cross gnatmake and generic *-rtems run-time issues.
So this patch is off the table for 3.4.0.
I'm removing the target milestone for this PR since this doesn't look to me like
it's a regression. Still, if you get this working, you can apply the patch for
2005-01-24 Eric Botcazou <email@example.com>
* config.gcc (sparc-*-elf*): Remove sol2.h, sparc/sol2.h and
sparc/elf.h, add sparc/sp-elf.h.
(sparclite-*-elf*): Remove sol2.h, sparc/sol2.h, sparc/elf.h and
tm-dwarf2.h, add sparc/sp-elf.h.
(sparc64-*-elf*): Remove sol2.h, sparc/sol2.h and tm-dwarf2.h.
* config/sparc/liteelf.h (TARGET_SUB_OS_CPP_BUILTINS): Rename into
* config/sparc/sp86x-elf (TARGET_SUB_OS_CPP_BUILTINS): Likewise.
* config/sparc/rtemself.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise.
* config/sparc/openbsd64.h (NO_IMPLICIT_EXTERN_C): Undefine.
* config/sparc/sp64-elf.h (NO_IMPLICIT_EXTERN_C): New macro.
* config/sparc/elf.h: Delete.
* config/sparc/sp-elf.h: New file.