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
Created attachment 849315 [details] qemu build log
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?
(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.
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?
(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?
(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.
Created attachment 849622 [details] Contents of /var/db/pkg/app-emulation/qemu-7.2.0
Mostly out of curiosity, what is the static useflag good for?
(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.
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(-)
(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.
(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.
(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