Re: static linking working w/gnu? (was Re: [ANNOUNCE] util-linux v2.33-rc1)

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

 



On Mon, Oct 08, 2018 at 12:30:50AM -0700, L A Walsh wrote:
> 	Did you get warnings similar to the above?  The claim
> is that you should be getting similar errors, but I got the impression
> that you did not.

I get the warning, but result is still static binary. Don't ask me why
;-)

$ file ./mount.static 
./mount.static: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=b66bae970bf72346cbf6d844e0e48d5dbfd07cc2, with debug_info, not stripped

The problem is the way how glibc uses stuff around NSS. In this case
glibc needs runtime modules, for more details see:

  https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F

on Fedora, the mount.static is static, but I guess glibc internally
uses some ldopen() when need NSS or iconv stuff.

It seems the issue is only getpwnam_r() which is necessary only when
mount(8) translates gid=<name> to gid=<number>. It's rarely used
mount(8) feature.

> One person claimed it to be a bug in the Gnu tools & lib, while
> others claim its designed that way, so not a bug...*sigh*.

I think you do not want to try resolve this issues in the utils.

It's all about libc design. If glibc does not well for you, then 
you need something else. For example uclibc, or glibc without NSS,
etc.

Now you know why we have projects like dracut for initramfs. It's
better to use standard libs and utils than try to build parallel
universe to boot or for rescue disks.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux