shared lib , problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

shared lib , problem

Post 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])
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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?
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Post 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])
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Post 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
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Post by mcheung63 »

thank you James :D
Post Reply