New: xfsprogs 4.17 and later can't be built as static binaries anymore
https://bugzilla.kernel.org/show_bug.cgi?id=201287
Bug ID: 201287
Summary: xfsprogs 4.17 and later can't be built as static
binaries anymore
Product: File System
Version: 2.5
Kernel Version: n/a
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: XFS
Assignee: [email protected]
Reporter: [email protected]
Regression: No
In Gentoo we offer the possibility to build xfsprogs fully static, e.g. for initramdisks.
This still worked fine with 4.14.
With 4.17 and 4.18 we however get:
../libfrog/.libs/libfrog.a(convert.o): In function `gid_from_string':
convert.c:(.text+0x984): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
and final linking fails.
See also https://bugs.gentoo.org/666196
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
https://bugzilla.kernel.org/show_bug.cgi?id=201287
Eric Sandeen ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #1 from Eric Sandeen ([email protected]) ---
Is there a recipe to demonstrate this failure in the upstream git tree w/o the gentoo patches or build environment?
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
Jeff Mahoney ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #2 from Jeff Mahoney ([email protected]) --- This isn't an xfsprogs problem at all. It's a glibc change:
$ cat tmp.c #define _GNU_SOURCE #include <grp.h> #include <stdio.h>
int
main(void)
{
struct group *grp;
grp = getgrnam("users");
return grp != NULL;
}$ cc tmp.c -static /tmp/ccPA29iG.o: In function `main': tmp.c:(.text+0xe): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
--- Comment #3 from Andreas K. Hüttel ([email protected]) --- Ugh. I can't reproduce the final link failure with the unmodified release tarball. So that part is likely our problem, sorry for the noise.
[We sed LLDFLAGS += -all-static into the Makefiles.]
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
--- Comment #4 from Andreas K. Hüttel ([email protected]) --- (In reply to Andreas K. Hüttel from comment #3)
Quoted 4 lines
Ugh. I can't reproduce the final link failure with the unmodified release tarball. So that part is likely our problem, sorry for the noise.
[We sed LLDFLAGS += -all-static into the Makefiles.]
(More precisely, simplified from the "ebuild":
sed -i -e "1iLLDFLAGS += -all-static" include/builddefs.in find -name Makefile -exec sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
)
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
--- Comment #5 from Andreas K. Hüttel ([email protected]) --- With above two commands and the configure call below I can reproduce the problem with the otherwise unmodified 4.18 tarball.
(Feel free to close anyway if you see fit.)
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/xfsprogs-4.18.0 --htmldir=/usr/share/doc/xfsprogs-4.18.0/html --libdir=/usr/lib64 --disable-lto --enable-blkid --with-crond-dir=/etc/cron.d --with-systemd-unit-dir=/lib/systemd/system --disable-libicu --enable-gettext --disable-readline --disable-editline --enable-static
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
Dave Chinner ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #6 from Dave Chinner ([email protected]) ---
So the distro build env modifies the xfsprogs build flags to add something upstream doesn't support, right? And that distro hack doesn't work anymore, yes?
If so, this is a distro package build problem, not an upstream issue. If the distro package maintainers want the upstream source tree to support static builds as the distro requires, then please send patches to support this functionality directly out of the upstream tree to [email protected].
-Dave.
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
Eric Sandeen ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALIDSignature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 201287] xfsprogs 4.17 and later can't be built as static binaries anymore
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=201287
--- Comment #7 from Eric Sandeen ([email protected]) ---
(FWIW I think the issue here is that getgrnam() wanders into different libnss* libraries, which glibc dlopens (?) and so it's pretty much impossible to statically link.)
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.