Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 801070 - sys-fs/cryptsetup[static]: undefined reference to `mq_getattr' due to underlinking
Summary: sys-fs/cryptsetup[static]: undefined reference to `mq_getattr' due to underli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on: 801325
Blocks:
  Show dependency tree
 
Reported: 2021-07-07 19:13 UTC by Stefan Huber
Modified: 2021-07-12 08:19 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Huber 2021-07-07 19:13:39 UTC
All versions of sys-fs/cryptsetup with static use flag enabled fail to compile due to undefined reference to `mq_getattr':

[…]
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../lib64/libudev.a(src_libsystemd_sd-daemon_sd-daemon.c.o): in function `sd_is_mq':                 
(.text.sd_is_mq+0x3a): undefined reference to `mq_getattr'                                                                                                                                                                           
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../lib64/libudev.a(src_libsystemd_sd-daemon_sd-daemon.c.o): in function `sd_is_mq':                 
(.text.sd_is_mq+0x3a): undefined reference to `mq_getattr'                                                                                                                                                                           
collect2: error: ld returned 1 exit status                                                                                                                                                                                           
make[2]: *** [Makefile:1585: veritysetup.static] Error 1  
[…]

This bug is similar to bug #762017 which affects sys-fs/lvm2. This bug is not a duplicate of bug #786816.

Reproducible: Always
Comment 1 Marco Scardovi (scardracs) 2021-07-08 05:50:33 UTC
Please post emerge --info and the complete build log
Comment 2 Mike Gilbert gentoo-dev 2021-07-08 17:42:59 UTC
You probably just need to rebuild sys-apps/systemd.
Comment 3 Mike Gilbert gentoo-dev 2021-07-08 17:48:59 UTC
Looks like we need to link against librt to handle static linkage of libudev.
Comment 4 Mike Gilbert gentoo-dev 2021-07-08 17:54:40 UTC

*** This bug has been marked as a duplicate of bug 762017 ***
Comment 5 Stefan Huber 2021-07-09 07:48:35 UTC
Rebuilding systemd does not fix it.
Comment 6 Larry the Git Cow gentoo-dev 2021-07-11 14:41:37 UTC
The bug has been referenced in the following commit(s):

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

commit afc5cea9987daa5c97eb3dd96efae40663153ecf
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-07-11 14:37:12 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-07-11 14:37:12 +0000

    sys-apps/systemd: add static link info to libudev.pc
    
    Bug: https://bugs.gentoo.org/801070
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd/files/249-libudev-static.patch    | 26 ++++++++++++++++++++++
 ...systemd-249-r1.ebuild => systemd-249-r2.ebuild} |  0
 2 files changed, 26 insertions(+)
Comment 7 Stefan Huber 2021-07-11 19:52:52 UTC
(In reply to Larry the Git Cow from comment #6)

>  sys-apps/systemd/files/249-libudev-static.patch    | 26
> ++++++++++++++++++++++
>  ...systemd-249-r1.ebuild => systemd-249-r2.ebuild} |  0
>  2 files changed, 26 insertions(+)

Unfortunately, the build right now does not yet apply the patch.
Comment 8 Stefan Huber 2021-07-12 07:44:38 UTC
Now sys-fs/cryptsetup-2.3.6 builds fine against sys-apps/systemd-249-r3.
Comment 9 Marco Scardovi (scardracs) 2021-07-12 08:10:29 UTC
(In reply to Stefan Huber from comment #7)
> (In reply to Larry the Git Cow from comment #6)
> 
> >  sys-apps/systemd/files/249-libudev-static.patch    | 26
> > ++++++++++++++++++++++
> >  ...systemd-249-r1.ebuild => systemd-249-r2.ebuild} |  0
> >  2 files changed, 26 insertions(+)
> 
> Unfortunately, the build right now does not yet apply the patch.

If you are using gentoo-mirror or rsync you have to wait for new ebuilds to propagate through all the network
Comment 10 Stefan Huber 2021-07-12 08:19:02 UTC
(In reply to Marco Scardovi (scardracs) from comment #9)
> If you are using gentoo-mirror or rsync you have to wait for new ebuilds to
> propagate through all the network

I do not think that this explains the "0" in the lines added or removed for systemd-249-r2.ebuild in git, right. The -r3 ebuild fixes it, by the way.