[Top][All Lists]

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

Re: [Chicken-users] chicken-static is not really static

From: Peter Keller
Subject: Re: [Chicken-users] chicken-static is not really static
Date: Wed, 12 Jan 2005 01:37:25 -0600
User-agent: Mutt/

On Wed, Jan 12, 2005 at 07:55:22AM +0100, felix winkelmann wrote:
> I take it you are trying to build a completely static version of the
> compiler to move it do a different linux system, yes?

Actually, there is more you need to do....

Even though you've used -static on the link line and ldd will say "not
a dynamic executable", it lies. :) Basically, if you ever make a call
to something like gethostbyname(), then the glibc will manually dlopen
the nss libraries and load shared segments which might or might not be
available (or of the correct API version) on the target machine you've
moved the binary too.

In this case, the right solution is to download the version of
glibc you have and configure it with "--enable-static-nss
--enable-add-ons --disable-shared --without-cvs
--prefix=/someplace/other/than/default/location" and make it
(and then install it in the place you specified).  You might need
to seperately deal with the linuxthreads addon, it depends upon
the revision of the glibc you'll need. When it is all finished, use
-L/someplace/other/than/the/default/location before any other -L flags on
the compile line and include -lnss_files -lnss_dns -lnss_ldap -lnss_nis
-lresolve on the link line. This should ensure that your binary can use
one of those protocols when moved to another machine.

You don't have to do this, but if you do you'd gain the maximum compatibility
between linux distributions. Yeah, I know it is a pain. Linux is like that


reply via email to

[Prev in Thread] Current Thread [Next in Thread]