[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] why is blktap statically linking it's drivers?


  • To: Sean Dague <japh@xxxxxxxxxx>
  • From: Jacob Gorm Hansen <jacobg@xxxxxxx>
  • Date: Mon, 07 Aug 2006 22:47:26 -0700
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Aug 2006 22:50:11 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=rowxWdjSzRwcMQkjzVFtjD+4W+EhoI5iK9z/AQ8sjBdD7I1yC0RRl81Co9oty5cLRzbR+KOskh8RII3RjMfKHym2cPVuo3RGg7N/JlXoUPsHro3mxcPByhymQn7eT44YGohB4uZGqBS69yAacK3MsOVlIuDQbkBkBGsKY2D8hCQ=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.