public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 4.6 not building crti.o and crtn.o in cross-compiler
@ 2011-05-06 16:21 David Paterson
  2011-05-06 18:11 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: David Paterson @ 2011-05-06 16:21 UTC (permalink / raw)
  To: gcc-help

Hi all,

I've hit a strange problem in building my cross tool chain when I
moved up from GCC 4.5.2 to 4.6.

For some reason crti.o and crtn.o aren't being built, and I'm puzzled
as to why...

I've just run two complete rebuilds of the entire toolchain into clean
directories, using exactly the
same configuration options, and with only the different GCC sources.
I've carefully compared
directories one by one, and there are virtually no differences in the
set of files created in each build,
apart from these two somewhat essential ones.  (The other differences
are some new C++ include
files and dll's in 4.6 and a couple of other minor things).

My GCC config is as follows (substitute 4.5.2 or 4.6.0 for n.n.n) :-

../../GCCSources/gcc-n.n.n/configure --target=$TARGET --disable-shared
--disable-nls --disable-werror \
  --enable-languages="c,c++" --enable-interwork --enable-multilib
--disable-libssp --disable-threads \
  --with-newlib --with-gmp=$PREFIX --with-mpfr=$PREFIX
--with-mpc=$PREFIX --with-gnu-as --with-gnu-ld \
  --prefix=$PREFIX

where TARGET = sparc-elf
and PREFIX = /usr/local/testn.n.n

For reference, I'm also using gmp-5.0.1, mpfr-3.0.1, mpc-0.9,
binutils-2.21, newlib-1.19.0 and gdb-7.2.

I'm trying to pick through the configure files for both versions to
see where and why the choices
about crti.o and crtn.o are made, but so far I can't work out why one
builds and the other doesn't.

Any thoughts on what's gone wrong would be appreciated.

Cheers,

David P.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6 not building crti.o and crtn.o in cross-compiler
  2011-05-06 16:21 GCC 4.6 not building crti.o and crtn.o in cross-compiler David Paterson
@ 2011-05-06 18:11 ` Ian Lance Taylor
  2011-05-06 20:37   ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2011-05-06 18:11 UTC (permalink / raw)
  To: David Paterson; +Cc: gcc-help, ebotcazou

David Paterson <dnpaterson@gmail.com> writes:

> For some reason crti.o and crtn.o aren't being built, and I'm puzzled
> as to why...

> where TARGET = sparc-elf

For most targets crti.o and crtn.o are built by the C library, not by
gcc.  sparc-elf was one of the unusual exceptions.  Support for building
them as part of gcc was removed by this change:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01334.html , presumably
as part of "removes some left-overs".

I've CC'ed Eric in case he has anything to add.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6 not building crti.o and crtn.o in cross-compiler
  2011-05-06 18:11 ` Ian Lance Taylor
@ 2011-05-06 20:37   ` Eric Botcazou
  2011-05-09 10:16     ` David Paterson
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2011-05-06 20:37 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: David Paterson, gcc-help

> For most targets crti.o and crtn.o are built by the C library, not by
> gcc.  sparc-elf was one of the unusual exceptions.  Support for building
> them as part of gcc was removed by this change:
> http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01334.html , presumably
> as part of "removes some left-overs".

Right, sparc-elf and sparc-rtems were hijacking sol2-ci.asm and sol2-cn.asm, 
which are supposed to be Solaris-specific.  Now the RTEMS folks complained 
about the removal and I accepted to backpedal for sparc-rtems:
  http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00530.html
They never applied the patch, though.

The funny thing is that neither sparc64-elf nor sparc64-rtems build them.
But they are very likely little used targets.

I guess the best solution to clean up the mess at this point is to backpedal 
entirely and build them (again) for sparc*-elf and sparc*-rtems.  I'll do the 
change for the upcoming 4.6.1 release.

> I've CC'ed Eric in case he has anything to add.

Thanks for bringing this to my attention.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6 not building crti.o and crtn.o in cross-compiler
  2011-05-06 20:37   ` Eric Botcazou
@ 2011-05-09 10:16     ` David Paterson
  0 siblings, 0 replies; 4+ messages in thread
From: David Paterson @ 2011-05-09 10:16 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Ian Lance Taylor, gcc-help

On Fri, May 6, 2011 at 9:37 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> For most targets crti.o and crtn.o are built by the C library, not by
>> gcc.  sparc-elf was one of the unusual exceptions.  Support for building
>> them as part of gcc was removed by this change:
>> http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01334.html , presumably
>> as part of "removes some left-overs".
>
> Right, sparc-elf and sparc-rtems were hijacking sol2-ci.asm and sol2-cn.asm,
> which are supposed to be Solaris-specific.  Now the RTEMS folks complained
> about the removal and I accepted to backpedal for sparc-rtems:
>  http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00530.html
> They never applied the patch, though.
>
> The funny thing is that neither sparc64-elf nor sparc64-rtems build them.
> But they are very likely little used targets.
>
> I guess the best solution to clean up the mess at this point is to backpedal
> entirely and build them (again) for sparc*-elf and sparc*-rtems.  I'll do the
> change for the upcoming 4.6.1 release.

Thanks guys.  Funnily, the reason for moving up to 4.6 was to get the Leon-
specific support.  I'm also planning on doing some experimentation with RTEMS,
so these patches and discussions are relevant to that as well.

I'm guessing this issue might also be relevant for the upcoming 4.7 release.

Someone's also asked me to help with tools for an embedded Arm project, and
a quick test gives me crti.o & crtn.o in both 4.5.2 and 4.6.0 builds.
Seems like
there isn't a consistent approach to which "extra_parts" get build for
the various
selectable platforms...

I'm quite new to GCC building, so don't want to be adding to the workload by
getting deprecated stuff restored.  If it makes more sense to generate
these files
from libc, and that's where you want to head for future releases, I'm
quite happy to
go that way.

Cheers,

David P.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-09 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 16:21 GCC 4.6 not building crti.o and crtn.o in cross-compiler David Paterson
2011-05-06 18:11 ` Ian Lance Taylor
2011-05-06 20:37   ` Eric Botcazou
2011-05-09 10:16     ` David Paterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).