Re: Creating a statically linked executable for a LuaJIT+C program

  • From: John Spencer <maillist-luajit@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 28 Oct 2012 16:40:26 +0100

On 10/28/2012 03:25 PM, Florian Weimer wrote:
* John Spencer:

Statically linking against GNU libc does not work well because there
is system functionality which absolutely requires dynamic linking
(name resolution, user/group database, and so on).

thus *musl* libc, as i said earlier.

I don't think musl supports NSS, so your application will not play
well with LDAP, mDNS etc.

as long as the application that wants to be linked statically depends on these features (very unlikely) this doesn't matter a bit.


and generally behave different than the rest
of the system.


*if* glibc follows the POSIX/C specs, they will behave identically.
of course if glibc disrespects the standards, musl will behave differently (because musl *is* conforming).
in my eyes that's an advantage though.



thanks for your in-depth analysis why glibc is unsuitable for static
linking (apart from license issues and massive bloat) though.

You can link libc dynamically and the rest statically.


this sounds like A Bad Idea. if you dynamically link one component, you can as well just dynamically link everything, because you'll lose the advantages of static linking.

Other related posts: