Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 801403 - sys-apps/util-linux[abi_x86_32]: fails to build with glibc using libxcrypt[-abi_x86_32]
Summary: sys-apps/util-linux[abi_x86_32]: fails to build with glibc using libxcrypt[-a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libxcrypt-migration
  Show dependency tree
 
Reported: 2021-07-09 22:32 UTC by Reid Swanson
Modified: 2021-08-22 02:52 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The output of emerge --info '=sys-apps/util-linux-2.36.2::gentoo' (emerge.info.xz,3.39 KB, application/x-xz)
2021-07-09 22:32 UTC, Reid Swanson
Details
The full build log (build.log.xz,13.04 KB, application/x-xz)
2021-07-09 22:33 UTC, Reid Swanson
Details
config.log for abi_x86_64 (config.abi_x86_64.log.xz,21.12 KB, application/x-xz)
2021-07-09 22:50 UTC, Reid Swanson
Details
config.log for abi_x86_32 (config.abi_x86_32.log.xz,20.51 KB, application/x-xz)
2021-07-09 22:50 UTC, Reid Swanson
Details
fix definitions overrides (util-linux_fix_redefinitions.patch,630 bytes, patch)
2021-07-09 22:53 UTC, Samuel Bauer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Reid Swanson 2021-07-09 22:32:04 UTC
Created attachment 723025 [details]
The output of emerge --info '=sys-apps/util-linux-2.36.2::gentoo'

After reading the news item about migrating to libxcrypt I tried following the instructions on the wiki(https://wiki.gentoo.org/wiki/Project:Toolchain/libcrypt_implementation). However, after making the changes to enable libxcrypt my system will only partially complete the update process. It emerges and installs libxcrypt and glibc without any problems, but it fails when it gets to sys-apps/util-linux.

What I believe to be the relevant error message is below (but the full build log is also attached):

In file included from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/libmount/src/context.c:42:
/var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/include/namespace.h:43:19: error: static declaration of ‘unshare’ follows non-static declaration
   43 | static inline int unshare(int flags)
      |                   ^~~~~~~
In file included from /usr/include/sched.h:43,
                 from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/include/namespace.h:11,
                 from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/libmount/src/context.c:42:
/usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here
   86 | extern int unshare (int __flags) __THROW;
      |            ^~~~~~~
In file included from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/libmount/src/context.c:42:
/var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/include/namespace.h:50:19: error: static declaration of ‘setns’ follows non-static declaration
   50 | static inline int setns(int fd, int nstype)
      |                   ^~~~~
In file included from /usr/include/sched.h:43,
                 from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/include/namespace.h:11,
                 from /var/tmp/portage/sys-apps/util-linux-2.36.2/work/util-linux-2.36.2/libmount/src/context.c:42:
/usr/include/bits/sched.h:95:12: note: previous declaration of ‘setns’ was here
   95 | extern int setns (int __fd, int __nstype) __THROW;
      |            ^~~~~
make[2]: *** [Makefile:10158: libmount/src/la-context.lo] Error 1
make[2]: *** Waiting for unfinished jobs....


There appears to be an open upstream bug report (https://github.com/karelzak/util-linux/issues/933) that seems to trigger the same error. 

I've posted a more complete summary of the steps I have taken on the gentoo forums (https://forums.gentoo.org/viewtopic-p-8633737.html#8633737), but they are hard to reproduce here in plain text. In brief summary:

1) I show the current version of libcrypt and glibc before migrating to libxcrypt.
2) Show which gcc version I am using (gcc 10.3.0)
3) Show a successful emerge of util-linux
4) sync my system (emerge --sync)
5) update my system (emerge -uvDU --with-bdeps=y @world
6) clean my system (emerge -acq)
7) Make the use flag, keyword, etc. changes to enable libxcrypt
8) Update the system (emerge -uavDU @world)
9) There are 22 packages to emerge
10) It fails on 17 of 22 (util-linux)

Please see the attached emerge --info (emerge.info) and build.log
Comment 1 Reid Swanson 2021-07-09 22:33:01 UTC
Created attachment 723028 [details]
The full build log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-09 22:37:42 UTC
Big thanks. Could you include config.log too?
Comment 3 Reid Swanson 2021-07-09 22:39:29 UTC
I'd be happy to, but I only saw the build log. Where is it located?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-09 22:45:54 UTC
(In reply to Reid Swanson from comment #3)
> I'd be happy to, but I only saw the build log. Where is it located?

Cheers!

For me, it's in /var/tmp/portage/sys-apps/util-linux-2.36/work/util-linux-2.36-abi_x86_64.amd64/config.log, but it may be in /var/tmp/portage/sys-apps/util-linux-2.36/work/util-linux-2.36.2-abi_x86_32.x86/config.log for you because that's the variant which is failing.
Comment 5 Reid Swanson 2021-07-09 22:50:00 UTC
Created attachment 723031 [details]
config.log for abi_x86_64
Comment 6 Reid Swanson 2021-07-09 22:50:22 UTC
Created attachment 723034 [details]
config.log for abi_x86_32
Comment 7 Reid Swanson 2021-07-09 22:50:52 UTC
There were logs in both locations so I attached them both.
Comment 8 Samuel Bauer 2021-07-09 22:53:44 UTC
Created attachment 723037 [details, diff]
fix definitions overrides

I was bitten by this issue and force compile to continue with this patch.
The patch should apply safe to systems were the bug doesn't hit as there is both case no need for those redefinitions. I didn't spend long time to really inspect the situation carefully so I hope some people will be interested in inspecting more carefully side effects.

Weird thing is that next day when trying to open the bug, I wasn't hit by the wrong behavior anymore.
Comment 9 Samuel Bauer 2021-07-10 00:59:21 UTC
This issue is already described on the upstream bugtracker:
https://github.com/karelzak/util-linux/issues/933
Comment 10 Larry the Git Cow gentoo-dev 2021-07-10 21:31:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f97eb250b55904388c542a546ec048f239f89b5c

commit f97eb250b55904388c542a546ec048f239f89b5c
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2021-07-10 21:24:33 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-07-10 21:31:41 +0000

    sys-apps/util-linux: Attempt fix build with sys-libs/libxcrypt[-abi_x86_32]
    
    Bug: https://bugs.gentoo.org/801403
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 .../files/util-linux-2.37-avoid_autoreconf.patch   | 136 +++++++++++++++++++++
 .../files/util-linux-2.37-lcrypt_link_fix.patch    |  50 ++++++++
 .../files/util-linux-2.37-lcrypt_use_LIBS.patch    |  91 ++++++++++++++
 sys-apps/util-linux/util-linux-2.37.ebuild         |   4 +
 4 files changed, 281 insertions(+)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-12 01:59:47 UTC
This occurred when building util-linux[abi_x86_32] with libxcrypt[-abi_x86_32]. We only need libxcrypt for the native (64 bit) variant on amd64 because it's only used for sulogin (a binary, not a library -- which isn't compiled/installed on the non-native variant).

For posterity, patches were:
- https://github.com/karelzak/util-linux/commit/637cc045ee464909c261d6fa16c71ed15cd455e3
- https://github.com/karelzak/util-linux/commit/75cba8d5cdb2a0e84c23de26007feac977837a6f

Mentioned this upstream too: https://github.com/karelzak/util-linux/issues/933#issuecomment-877913170.

Fixes the issue for me and is included in 2.37 in Gentoo, please let us know if it still fails for any of you.
Comment 12 Alex Xu (Hello71) 2021-07-17 22:55:12 UTC
it works for me
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-17 23:01:41 UTC
(In reply to Alex Xu (Hello71) from comment #12)
> it works for me

Yep, and thanks to you after all! I think we can close this now. Fine here as well.