Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 892327 - app-emulation/qemu[curl,gnutls] Missing Static Libs
Summary: app-emulation/qemu[curl,gnutls] Missing Static Libs
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-28 03:57 UTC by David E. Narváez
Modified: 2023-04-22 03:55 UTC (History)
2 users (show)

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


Attachments
qemu build log (qemu-7.2.0.log.bz2,68.06 KB, application/x-bzip)
2023-01-28 03:59 UTC, David E. Narváez
Details
Contents of /var/db/pkg/app-emulation/qemu-7.2.0 (qemu-7.2.0.tgz,57.90 KB, application/x-compressed-tar)
2023-02-01 14:29 UTC, David E. Narváez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David E. Narváez 2023-01-28 03:57:04 UTC
This is not necessarily a bug in the app-emulation/qemu ebuild but I do not know if I should report it against the other ebuilds since the solution might be to not allow curl and gnutls flags when using static-libs.

Building app-emulation/qemu-7.2.0[satic-libs,curl,gnutls] failed with the attached log, so I searched for the packages that own the offending libraries and added static-libs flags to all of them to fix the build.

After taking a closer look, the packages I rebuilt with static libs fall into:
- Direct dependencies of net-libs/gnutls, where gnutls does not propagate the static-libs flag to its dependencies:
libtasn1
libunistring
libidn2

- Direct dependencies of curl, where curl does not propagate static-libs either:
nghttp2
c-ares

- Indirect dependencies (this is where I stopped looking into this because libffi is a dependency of app-crypt/p11-kit which does not have a static-libs use flag):
util-linux
libffi


Reproducible: Always
Comment 1 David E. Narváez 2023-01-28 03:59:13 UTC
Created attachment 849315 [details]
qemu build log
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-28 05:58:34 UTC
Run-time dependency blkio found: NO (tried pkgconfig)
WARNING: Static library 'cares' not found for dependency 'libcurl', may not be statically linked
WARNING: Static library 'nghttp2' not found for dependency 'libcurl', may not be statically linked
[snip]
WARNING: Static library 'unistring' not found for dependency 'gnutls', may not be statically linked
WARNING: Static library 'tasn1' not found for dependency 'gnutls', may not be statically linked
WARNING: Static library 'idn2' not found for dependency 'gnutls', may not be statically linked
[snip]
WARNING: Static library 'tasn1' not found for dependency 'libtasn1', may not be statically linked
[snip]
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lffi: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmount: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblkid: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lffi: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmount: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblkid: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lffi: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmount: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblkid: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lffi: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmount: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblkid: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lunistring: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltasn1: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lidn2: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lcares: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lnghttp2: No such file or directory

qemu[static,gnutls,curl] depends on gnutls[static-libs] and curl[static-libs]. Are gnutls and curl actually built with USE=static-libs?
Comment 3 David E. Narváez 2023-01-28 06:13:44 UTC
(In reply to John Helmert III from comment #2)
> qemu[static,gnutls,curl] depends on gnutls[static-libs] and
> curl[static-libs]. Are gnutls and curl actually built with USE=static-libs?

Yes, the build would not start otherwise, right?

For context, I built an ancient version of qemu years ago but for the update I deleted the package.use file that had all the static-libs flags needed, then regenerated the file with the current list of packages that needed the static-libs flag, which included curl and gnutls, but not the ones reported in this bug.

The problem is gnutls and curl do not propagate the static-libs flag downwards (or upwards if you think of dependencies going up), from what I can see.
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-28 23:25:47 UTC
But they do, as far as I can tell. For example: https://github.com/gentoo/gentoo/blob/master/net-libs/gnutls/gnutls-3.7.8.ebuild#L22

Can you share the contents of /var/db/pkg/app-emulation/qemu, /var/db/pkg/net-libs/gnutls, and /var/db/pkg/net-misc/curl?
Comment 5 David E. Narváez 2023-01-31 03:45:13 UTC
(In reply to John Helmert III from comment #4)
> But they do, as far as I can tell. For example:
> https://github.com/gentoo/gentoo/blob/master/net-libs/gnutls/gnutls-3.7.8.
> ebuild#L22

Does MULTILIB_USEDEP propagate static-libs? I thought it was just ABI stuff.

> Can you share the contents of /var/db/pkg/app-emulation/qemu,
> /var/db/pkg/net-libs/gnutls, and /var/db/pkg/net-misc/curl?

Do you mean the contents of those directories or just the file listings?
Comment 6 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-31 16:08:03 UTC
(In reply to David E. Narváez from comment #5)
> (In reply to John Helmert III from comment #4)
> > But they do, as far as I can tell. For example:
> > https://github.com/gentoo/gentoo/blob/master/net-libs/gnutls/gnutls-3.7.8.
> > ebuild#L22
> 
> Does MULTILIB_USEDEP propagate static-libs? I thought it was just ABI stuff.

Ah, sorry, I was confused while looking between a bunch of ebuilds.

> > Can you share the contents of /var/db/pkg/app-emulation/qemu,
> > /var/db/pkg/net-libs/gnutls, and /var/db/pkg/net-misc/curl?
> 
> Do you mean the contents of those directories or just the file listings?

The contents, but given my confusion, just qemu's should be sufficient.
Comment 7 David E. Narváez 2023-02-01 14:29:26 UTC
Created attachment 849622 [details]
Contents of /var/db/pkg/app-emulation/qemu-7.2.0
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2023-02-04 15:19:39 UTC
Mostly out of curiosity, what is the static useflag good for?
Comment 9 David E. Narváez 2023-02-04 15:28:13 UTC
(In reply to Andreas K. Hüttel from comment #8)
> Mostly out of curiosity, what is the static useflag good for?

To build a statically-linked emulator that you can place inside a chroot so that it does not need to search for dynamically-linked libraries outside of it.
Comment 10 Larry the Git Cow gentoo-dev 2023-04-07 23:09:44 UTC
The bug has been referenced in the following commit(s):

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

commit 6574ed72af5cc538aafbf125189cf6cc5437c4ed
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2023-04-07 23:08:56 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2023-04-07 23:09:32 +0000

    app-emulation/qemu: drop useflag static, not really useful
    
    Bug: https://bugs.gentoo.org/892327
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 app-emulation/qemu/qemu-9999.ebuild | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
Comment 11 David E. Narváez 2023-04-15 07:50:17 UTC
(In reply to Larry the Git Cow from comment #10)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=6574ed72af5cc538aafbf125189cf6cc5437c4ed
> 
> commit 6574ed72af5cc538aafbf125189cf6cc5437c4ed
> Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
> AuthorDate: 2023-04-07 23:08:56 +0000
> Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
> CommitDate: 2023-04-07 23:09:32 +0000
> 
>     app-emulation/qemu: drop useflag static, not really useful
>     
>     Bug: https://bugs.gentoo.org/892327
>     Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
> 
>  app-emulation/qemu/qemu-9999.ebuild | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)

Well, thanks! You have made the QEMU package useless for me since I only use it statically, but I appreciate taking my input into account.
Comment 12 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-04-16 19:29:48 UTC
(In reply to David E. Narváez from comment #11)
> (In reply to Larry the Git Cow from comment #10)
> > The bug has been referenced in the following commit(s):
> > 
> > https://gitweb.gentoo.org/repo/gentoo.git/commit/
> > ?id=6574ed72af5cc538aafbf125189cf6cc5437c4ed
> > 
> > commit 6574ed72af5cc538aafbf125189cf6cc5437c4ed
> > Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
> > AuthorDate: 2023-04-07 23:08:56 +0000
> > Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
> > CommitDate: 2023-04-07 23:09:32 +0000
> > 
> >     app-emulation/qemu: drop useflag static, not really useful
> >     
> >     Bug: https://bugs.gentoo.org/892327
> >     Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
> > 
> >  app-emulation/qemu/qemu-9999.ebuild | 21 +++++++--------------
> >  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> Well, thanks! You have made the QEMU package useless for me since I only use
> it statically, but I appreciate taking my input into account.

I think your use-case is somewhat peculiar in the first place. If you want binaries to push into isolation in a chroot, I don't see why you can't just put the dynamic libraries in there too.
Comment 13 David E. Narváez 2023-04-22 03:55:59 UTC
(In reply to John Helmert III from comment #12)
> I think your use-case is somewhat peculiar in the first place. If you want
> binaries to push into isolation in a chroot, I don't see why you can't just
> put the dynamic libraries in there too.

My case is so peculiar it even has an entry in the Gentoo Wiki

https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Compiling_with_qemu_user_chroot