readd crti/crtn to sparc-*-rtems*

Joel Sherrill
Mon Jan 10 16:44:00 GMT 2011

On 01/10/2011 05:47 AM, Eric Botcazou wrote:
>> The sparc-rtems target currently uses init/fini for C++
>> constructors and without crti/n, they do not have the symbols.
> OK, this is indeed done the same way (hijacking the Solaris files) for i386.
>> Longer term, both probably need to switch to how sparc-elf
>> does it but I was just trying to fix the breakage.  And I didn't
>> build sparc64-rtems.  This is how sparc-rtems has done it
>> for at least 10 years.
> The patch is OK modulo the following couple of changes:
> 1) copy and adjust (x86 ->  SPARC) the lines:
> # This file was based on t-sol2 - x68 Solaris implementation. Actually,
> # the source code to create crti.o anf crtn.o are exactly the same
> # as the ones for Solaris. Later, we might want to have a RTEMS's
> # version of these files.
> from config/i386/t-rtems-i386 to the new config/sparc/t-rtems.
> 2) apply the config.gcc changes to both sparc-*-rtems* and sparc64-*-rtems*.
Agreed.  I just got email back from the sparc64 RTEMS person
and they admitted they never had global ctors working.  Which
confirms what Ralf and I said.

OK.  I will get a patch together and submit when tested.

> Thanks in advance.

More information about the Gcc-patches mailing list