shared libstdc++

David McCullough davidm at snapgear.com
Tue Jan 17 23:21:18 UTC 2006


Jivin Lei Sun lays it down ...
> Hi:
>   I am having trouble runing C++ application uClinux, the elf2flt couldn't product correct binary with pic_and_got set, I disabled the shared lib support in uClibc, so all the C program is OK. But I got "reloc outside program"error when loading C++ application, the problem is that buildroot automatically built the gcclib and libstdc++ with PIC and GOT,  the elf2flt linker script grep the C++ binary and found "GLOBAL_OFFSET_TABLE"  and then set the pic_and_got, therefore , created faulty binary( I think it has some bugs).
>   As Mike pointed that uClinux list doesn't response question regarding elf2flt.

Thats unusual,  and I haven't seen too many questions go unanswered.
On the uClinux-dve list,  no answer usually means no one knows the answer :-)

> My question is, do i have to build gcc with -enable-shared option? as specified in buildroot's Makefile? if not, should buildroot add an option to let user select shared option when building gcclib?

First I would ask what platform are you building for ?
What compiler version are you building ?

You can only do shared libraries for uClinux on m68k at the moment,  and
no one has gone close to making a libstdc++ shared lib for uClinux on
m68k.

My guess is that you are mixing up MMU shared libraries with uClinux and
they just don't work.  Under uClinux you will never used the '-shared'
compile option and you are unlikely to use -fPIC (except for XIP on arm
platforms,  and then you need the XIP support in the compiler).

Cheers,
Davidm

-- 
David McCullough, davidm at cyberguard.com.au, Custom Embedded Solutions + Security
Ph:+61 734352815 Fx:+61 738913630 http://www.uCdot.org http://www.cyberguard.com



More information about the uClibc mailing list