Last steps towards a functional toolchain

Mike Frysinger vapier at gentoo.org
Sun Oct 9 09:15:37 UTC 2005


On Sunday 09 October 2005 03:50 am, Jan-Benedict Glaw wrote:
> On Sun, 2005-10-09 00:02:47 -0400, Mike Frysinger <vapier at gentoo.org> wrote:
> > On Saturday 08 October 2005 04:48 pm, Jan-Benedict Glaw wrote:
> > >  o Recompile gcc to use these headers and (even more important) to
> > >    generate a correct linker call for the -static case. (For now, I've
> > >    not hacked the dynamically linked path because I first wanted to
> > >    get the compile-time linker to work.)
> >
> > we use buildroot to do this usually ...
>
> I think you misunderstood me here...

no, i understood quite well actually ;)
i just confused v850 with vax which means i assumed certain details were 
already taken care of since we've already ported uClibc to v850 ...

> My newly compiled gcc does know about "VAX" and how to generate ELF
> object file for this processor, but it doesn't know about uClibc and
> how to fetch which libc.a from where.

right ... i dont know what version of gcc you're going to require, but you 
should look at buildroot/toolchain/gcc/<VER>/100-uclibc-conf.patch

basically you need to update gcc/config.gcc so that the vax-uclibc target 
knows to use 't-linux-uclibc' instead of 't-linux' and then update LINK_SPEC 
in one of the files in gcc/config/vax/ so that it knows how to link uclibc 
linux targets

the 100-uclibc-conf.patch should have plenty of examples for how to do all of 
this

> So from a first glance, it should work if I install libc.a (from
> uClibc) to $BASE/install/usr/lib/ .  The same for the crt stuff. (Side
> node: for sure crt1, crti, crtbeginT crtend and crtn are abbreviations
> for something. Who could tell me about their meaning?)

crt1 is the C runtime init object code ... basically it contains the initial 
runtime entry point which runs the loader/libc init code before jumping to 
the actual main defined by the user ... older ports may use crt0 instead of 
crt1, from the blackbox perspective, they're the same thing.  Scrt1 is the 
PIC version of crt1 (same goes for Scrt0 / crt0).

crt[in] implements the init/fini stuff ... i'm not too keen on the exact 
details beyond that ...

crtbegin/crtend is the gcc init/fini code (again, these have PIC versions 
named crtbeginS/crtendS)

> > tar up your custom uClibc source code:
> > tar -jcf uClibc-snapshot.tar.bz2 uClibc
> > then put that into the buildroot 'dl' dir and select the uClibc snapshot
> > option in the toolchain menu
> >
> > what is your target ? v850 right ? is the target tuple
> > 'v850-linux-uclibc' or
>
> Nope, it's really VAX. VAX is a CPU type developed some 30 years ago
> (and buried about 10 years ago), while the NEC V850 is a modern
> microcontroller.

oops ... i knew what a vax was just not v850 ;)
-mike



More information about the uClibc mailing list