top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

static linking with musl libc

+3 votes
326 views

I have built sysrooted gcc (4.7 and 4.8) understanding Ada, C, C++ etc, statically linked with musl libc and with musl in the sysroot. It is for x86_64 architecture. It is convenient to be able to copy it to any Linux distro and run it right away, even on machines on which I have not the root privilege.

My problem is that, when passing the -static argument to gnatmake (which is also the default, I think), the resulting file is still dynamically linked with the libc. I understand that this feature has been introduced because the Gnu libc has an incomplete static version -- at least part of the networking is missing. But this restriction does not exist in musl. It should be possible to turn this feature off when using musl, but I can't find which place of the source of gnatmake I need to patch. Would you be kind enough to point me to the right place?

posted Feb 10, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+3 votes

As per my understanding uninitialized static variable is stored in BSS and initialized static variable is stored in DS, then what about the variable which is initialized with 0 ? where it will be stored BSS/DS?

...