[uClinux-dev] Does ucfront work with libstdc++.a?
Erwin Authried
eauth at softsys.co.at
Sat Oct 20 14:40:58 EDT 2007
Am Samstag, den 20.10.2007, 19:25 +0200 schrieb Wolfgang Mües:
> Nero,
>
> On Samstag, 20. Oktober 2007, kitefree wrote:
>
> > Recently I have been working on c++ program with uClinux-dist. And I
> > found there seems to be some problem with using ucfront-g++ with
> > libstdc++.a(gcc 3.4.4). As you can see how I build my C++ program,
> > /home/nerokuo/uClinux/tools/ucfront-g++ arm-linux-g++ -D__PIC__ -fpic
> > -msingle-pic-base -msoft-float -Wall -c main.cpp
> > /home/nerokuo/uClinux/tools/ucfront-g++ arm-linux-g++
> > -L/home/nerokuo/uClinux/uClibc/lib -Wl,-elf2flt -Wl,--fatal-warnings
> > -o helloworld main.o -msoft-float -lstdc++
>
> You missed "-fpic -msingle-pic-base" for the linker.
> The linker needs this flags to select the correct version of the
> libraries.
It's generally true that you have to supply -fpic -msingle-pic-base to
the linker. With the 3.4.4 snapgear toolchain, this won't help either,
because the compilers libs are compiled without -msingle-pic-base. There
are other reasons why c++ won't work. As far as I remember, ucfront-g++
doesn't supply the right libraries for calling the
constructors/destructors, and the elf2flt ld script is for old compilers
with a different format of the ctor table.
Regards,
Erwin
More information about the uClinux-dev
mailing list