|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] why is blktap statically linking it's drivers?
On Fri, 2006-08-04 at 14:19 -0400, Sean Dague wrote:
> It took me a bit to realize that the issue I was having with blktap
> compiling in xen-unstable is that it is statically linking libcrypto and
> libc into all of the executables in: xen-unstable/tools/blktap/drivers
>
> Is there a reason for this? It means that every one of those executables
> ends up at > 1 MB, which seems quite excessive. It also means that you need
> static-devel packages on some distros, which tend to not be installed by
> default.
I am a great fan of static linking, because it is the only simple
solution to 'DLL hell' (which I find to be a greater problem on Linux
now than on Windows), and because it allows simple installation of
binaries to remote machines and places where I do not have root-access.
Most commercial software also comes in static versions, as this is the
only reasonable way to deal with the n-distros problem. Finally,
statically linked applications load faster because all the linking has
been done ahead of time.
Unfortunately GNU ld does a very poor job of eliminating unreachable
code, and when combined with the bloated glibc you end up with such
enourmous binaries. Other linkers, e.g. Microsoft's linker on Windows
and SN System's own linker which is used by most game developers prove
that it is possible to perform much better than ld. Another option is to
shun glibc in favor of a stripped-down libc such as uClibc, newlib or
dietlibc. I recently played with uClibc for my own tools, and one went
from 500kB down to 22kB just by replacing glibc with uclibc's version.
I hope that in the future GNU ld will improve (or perhaps the OpenWatcom
linker may be used instead), and that distro maintainers will remember
to ship .a versions of libraries, so that static linking keeps being an
option.
Regards,
Jacob
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|