util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: L A Walsh <lkml@tlinx.org>
Cc: util-linux@vger.kernel.org
Subject: Re: static linking working w/gnu?  (was Re: [ANNOUNCE] util-linux v2.33-rc1)
Date: Mon, 8 Oct 2018 11:09:56 +0200	[thread overview]
Message-ID: <20181008090956.k6cjvg7ztwt3bnnp@ws.net.home> (raw)
In-Reply-To: <5BBB07AA.6010403@tlinx.org>

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@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2018-10-08  9:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 10:47 [ANNOUNCE] util-linux v2.33-rc1 Karel Zak
2018-09-30 23:33 ` L A Walsh
2018-10-02 10:14   ` Karel Zak
2018-10-06 19:25     ` L A Walsh
2018-10-07 14:57       ` Bernhard Voelker
2018-10-07 16:58         ` L A Walsh
2018-10-08  7:30     ` static linking working w/gnu? (was Re: [ANNOUNCE] util-linux v2.33-rc1) L A Walsh
2018-10-08  9:09       ` Karel Zak [this message]
2018-10-08 12:43         ` L A Walsh
2018-10-16  0:48         ` L A Walsh
2018-10-04 22:11 ` [ANNOUNCE] util-linux v2.33-rc1 Ruediger Meier
2018-10-04 22:11   ` Ruediger Meier
2018-10-05  9:37   ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181008090956.k6cjvg7ztwt3bnnp@ws.net.home \
    --to=kzak@redhat.com \
    --cc=lkml@tlinx.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).