Wai-Sun Chia <waisun.chia / msa.dec.com> writes:

> When building extensions you need to link with libruby, if you don't
> have a shared library then libruby.a will get linked in...
> 
> So if you have libruby.so, your extensions will be smaller as it uses
> the shared library instead of statically linking in libruby.a.
> 
> Having said that if you have just a couple of extensions, then it
> doesn't matter much, but if you have 10 or 20-plus extensions loaded
> concurrently, then a shared library saves quite some memory.

nope. At least not for standard extensions. eg with pcap:

gcc -shared  -L/usr/lib/ruby/1.6/i586-linux-gnu -L/usr/lib -L/usr/local/lib -o pcap.so Pcap.o packet.o ip_packet.o tcp_packet.o udp_packet.o icmp_packet.o -lpcap -lc

-> it doesn't access in any way libruby.a

it works because when ruby dlopen's pcap.so, it provides the rb_* symbols.


i know that some progs use libperl.so (eperl and mod_perl), i don't know if
any/many progs do the same with libruby.so?


cu Pixel.