Last steps towards a functional toolchain

Peter S. Mazinger ps.m at gmx.net
Sun Oct 9 15:19:51 UTC 2005


On Sun, 9 Oct 2005, 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 Install uClibc's header files
> > > 	How is this done?
> > 
> > `make install` ? :)
> 
> That's easy .-)
> 
> > >  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...
> 
> 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.
> 
> So I cheated about the linking stage and did it all by hand:
> 
> ${VAX_DIR}/install/usr/bin/vax-linux-uclibc-ld                                  \
>         -static -o main_vax                                                     \
>         ${VAX_DIR}/src/uclibc/lib/crt1.o                                        \
>         ${VAX_DIR}/src/uclibc/lib/crti.o                                        \
>         ${VAX_DIR}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/crtbeginT.o       \
>         main_vax.o                                                              \
>         --start-group ${VAX_DIR}/src/uclibc/lib/libc.a                          \
>         ${VAX_DIR}/src/uclibc/lib/libm.a                                        \
>         ${VAX_DIR}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/libgcc.a          \
>         --end-group ${VAX_DIR}/src/uclibc/lib/crtn.o
> 
> ...because I know the pathes.
> 
> Though, GCC doesn't and I guess I need to tell it. This is
> vax-linux-uclibc-gcc -static -v  output (edited for readability):
> 
> BASE=/home/jbglaw/vax-linux/scm/build-20051008-211533-vax-linux-uclibc
> $BASE/install/usr/libexec/gcc/vax-linux-uclibc/4.1.0/collect2	\
> 	crt1.o crti.o \
> 	${BASE}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/crtbeginT.o	\
> 	-L${BASE}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0	\
> 	-L${BASE}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/../../../../vax-linux-uclibc/lib
> 	-L/tmp/ccMQhuqS.o --start-group -lgcc -lc --end-group	\
> 	${BASE}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/crtend.o	\
> 	crtn.o	\
> 	${BASE}/install/usr/lib/gcc/vax-linux-uclibc/4.1.0/../../..
> /../vax-linux-uclibc/bin/ld: crt1.o: No such file: No such file or directory
> collect2: ld returned 1 exit status
> 
> 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?)

until you do not install *crt?.o into /usr/lib you have to use
gcc -nostartfiles and add them manually to the linker in the order shown 
above, only correcting the path 
gcc -nostartfiles path_to_crt1.o path_to_crti.o path_to_crtbeginT.o (for 
static, else crtbegin.o for dynamic executable or crtbeginS.o for shared 
lib/pie executable) -Lpath_to_libc ... path_to_crtend.o path_to_crtn.o

 
> > 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.
> 
> > 'vax-linux-uclibc' or ... ? i can update the buildroot config files for you 
> > so that vax is added to the arch list ...
> 
> I'll work on buildroot after my initial compiler works. With your last
> hints, I hope that should do really soon now. Thanks!
> 
> MfG, JBG
> 
> 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list