Page 1 of 1

shared lib , problem

Posted: Fri Oct 12, 2007 3:04 am
by mcheung63
Hi
What kind of libc using in your os? i mean not the static lib, i ask for the shared lib.
The newlib is good for static library, but hard to build it into shared one

thanks
from Peter ([email protected])

Posted: Fri Oct 12, 2007 3:15 am
by JamesM
I'm using newlib. Currently got it building as a static library but I'm sure I can hack the Makefile.am to make it shared.

I thought you could make a shared library from a static library anyway?

Posted: Fri Oct 12, 2007 3:23 am
by mcheung63
Hi James
No, i am currently have problem to build newlib into shared lib. I don't know why the default newlib's makefile doesn't build shared lib for many platforms. Newlib will only produce a .so if --target=i386-linux-*
Based on my understanding , to build a .so file is just linking all the .o files. Is it more than that?

thanks
from Peter ([email protected])

Posted: Fri Oct 12, 2007 3:26 am
by mcheung63
I got a work arround method:

ar -x libc.a ( extract all the object files)
ld -shared *.o -o libc.so ( link them back into a .so)

:) i am laughing

Posted: Fri Oct 12, 2007 5:40 am
by JamesM
Wow, that workaround looks suspiciously like the one I just posted in your other thread... ;)

edit: HA! looking at the timestamps I posted my post one minute after you, with the same content! talk about coincidence! :P

Posted: Sat Oct 13, 2007 10:41 am
by mcheung63
thank you James :D