Created attachment 825433 [details] build.log (.text+0xa5): undefined reference to `gpgrt_lock_lock' /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xbc): undefined reference to `gpgrt_lock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/libgpgme.a(trust-item.o): in function `gpgme_trust_item_ref': (.text+0x85): undefined reference to `gpgrt_lock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/libgpgme.a(trust-item.o): in function `gpgme_trust_item_unref': (.text+0xe8): undefined reference to `gpgrt_lock_unlock' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:1839: q] Error 1 make[2]: Leaving directory '/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3' make[1]: *** [Makefile:2218: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3' make: *** [Makefile:1742: all] Error 2 * ERROR: app-portage/portage-utils-0.94.3::gentoo failed (compile phase): * emake failed [...] ---- # emerge --info Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.1/systemd, gcc-11.3.0, glibc-2.35-r8, 5.15.74-gentoo-dist-hardened x86_64) ================================================================= System uname: Linux-5.15.74-gentoo-dist-hardened-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.35 KiB Mem: 65765032 total, 14426840 free KiB Swap: 8290300 total, 7598332 free Timestamp of repository gentoo: Tue, 25 Oct 2022 08:02:02 +0000 sh bash 5.1_p16-r1 ld GNU ld (Gentoo 2.38 p4) 2.38 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r1::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.34.1-r3::gentoo dev-lang/python: 3.10.8::gentoo dev-lang/rust-bin: 1.64.0-r1::gentoo dev-util/cmake: 3.24.2::gentoo dev-util/meson: 0.62.2::gentoo sys-apps/baselayout: 2.8::gentoo sys-apps/sandbox: 2.29::gentoo sys-apps/systemd: 251.4::gentoo sys-devel/autoconf: 2.71-r1::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.38-r2::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 14.0.6-r1::gentoo sys-devel/gcc: 11.3.0::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/lld: 15.0.3::gentoo sys-devel/llvm: 14.0.6-r2::gentoo, 15.0.3::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.35-r8::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--keep-going --complete-graph" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="C.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/sh" USE="acl amd64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl systemd test-rust udev unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
The build is missing -lgpg-error and -lassuan. But only libgpg-error is available as a static library, libassuan does not even provide the option to build statically in the ebuild.
After building and installing a static libassuan.a: root@store:/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3 # x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -mtune=core2 -fomit-frame-pointer -Wunused -Wimplicit -Wshadow -Wformat=2 -Wmissing-declarations -Wwrite-strings -Wbad-function-cast -Wnested-externs -Wcomment -Winline -Wchar-subscripts -Wcast-align -Wsequence-point -Wold-style-definition -Wextra -Wno-format-nonliteral -Wno-expansion-to-defined -Wl,-O1 -Wl,--as-needed -static -o q q-main.o q-q.o q-qatom.o q-qcheck.o q-qdepends.o q-qfile.o q-qgrep.o q-qkeyword.o q-qlist.o q-qlop.o q-qmerge.o q-qpkg.o q-qsearch.o q-qsize.o q-qtbz2.o q-quse.o q-qwhich.o q-qxpak.o q-qmanifest.o q-qtegrity.o ./libq/libq.a ./autotools/gnulib/libgnu.a -fopenmp -lcrypto -lb2 -lz -lgpgme -lgpg-error -lassuan /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/libgomp.a(oacc-profiling.o): in function `goacc_profiling_initialize': (.text+0x824): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/libgpg-error.a(libgpg_error_la-sysutils.o): in function `_gpgrt_getpwdir': (.text+0x2da): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x2f8): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking root@store:/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3 # ls -l q -rwxr-xr-x 1 root root 2483952 Nov 7 22:09 q root@store:/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3 # ./q usage: q <applet> <args> : invoke a portage utility applet currently defined applets: q <applet> <args> : virtual applet qatom <pkg> : split atom strings qcheck <pkgname> : verify integrity of installed packages qdepends <pkgname> : show dependency info qfile <filename> : list all pkgs owning files qgrep <expr> [pkg ...]: grep in ebuilds qkeyword <action> <args> : list packages based on keywords qlist <pkgname> : list files owned by pkgname qlop <pkgname> : emerge log analyzer qmanifest <misc args> : verify or generate thick Manifest files qmerge <pkgnames> : fetch and merge binary package qpkg <misc args> : create or manipulate Gentoo binpkgs qsearch <regex> : search pkgname/desc qsize <pkgname> : calculate size usage qtbz2 <misc args> : manipulate tbz2 packages qtegrity <misc args> : verify files with IMA quse <useflag> : find pkgs using useflags qwhich <pkg ...> : find path to pkg qxpak <misc args> : manipulate xpak archives options: -[ioemvqChV] -i, --install * Install symlinks for applets -o, --overlays * Print available overlays (read from repos.conf) -e, --envvar * Print used variables and their found values -m, --masks * Print (package.)masks for the current profile --root <arg> * Set the ROOT env var -v, --verbose * Report full package versions, emit more elaborate output -q, --quiet * Tighter output; suppress warnings -C, --nocolor * Don't output color --color * Force color in output -h, --help * Print this help and exit -V, --version * Print version and exit root@store:/var/tmp/portage/app-portage/portage-utils-0.94.3/work/portage-utils-0.94.3 # ldd q not a dynamic executable
I wonder if we should restrict static not to allow qmanifest in that case. How is static enabled these days, I thought the USE-flag was dropped.
(In reply to Fabian Groffen from comment #3) > I wonder if we should restrict static not to allow qmanifest in that case. > How is static enabled these days, I thought the USE-flag was dropped. USE-flag here. For me, the question was: is this a regression in 0.94.3? (It looks like) then is this supposed to work at all? was it ever tested by the authors? (I really doubt that, as it does not compile without libassuan.a, and that thing is simply not produced by the ebuild without change)
Static usage is not very often tested. The issue likely was exposed when qmanifest was added (which requires gnupg support via gpgme). Feels like we need a static-libs on libassuan, which apparently isn't required by app-crypt/gpgme[static-libs]. gpgme needs gpgrt_lock_unlock, but it can't find it. Cc-ing gpgme maintainer, perhaps they have an idea how to resolve this elegantly. That said, what does `pkg-config gpgme --libs` return for you?
(In reply to Fabian Groffen from comment #5) > Static usage is not very often tested. The issue likely was exposed when > qmanifest was added (which requires gnupg support via gpgme). Feels like we > need a static-libs on libassuan, which apparently isn't required by > app-crypt/gpgme[static-libs]. > > gpgme needs gpgrt_lock_unlock, but it can't find it. Cc-ing gpgme > maintainer, perhaps they have an idea how to resolve this elegantly. > > That said, what does `pkg-config gpgme --libs` return for you? # pkg-config gpgme --libs -lgpgme # gpgme-config --libs -L/usr/lib64 -lgpgme -lassuan -lgpg-error # Hm...
(In reply to Fabian Groffen from comment #5) > Static usage is not very often tested. The issue likely was exposed when > qmanifest was added (which requires gnupg support via gpgme). Feels like we > need a static-libs on libassuan, which apparently isn't required by > app-crypt/gpgme[static-libs]. Yeah the deps in the gpgme ebuild seem to be incomplete. > gpgme needs gpgrt_lock_unlock, but it can't find it. Cc-ing gpgme > maintainer, perhaps they have an idea how to resolve this elegantly. > > That said, what does `pkg-config gpgme --libs` return for you? gpgme.pc has this: > Requires.private: gpg-error, libassuan If you run pkg-config --libs --static, you'll get the right result: > % pkg-config --libs --static gpgme > -lgpgme -lgpg-error -lassuan
Note: Problem still exists with app-portage:portage-utils-0.96.1.
so this would mean we'd have to call PKG_CHECK_MODULES_STATIC or something, hmmm
Ok, that PKG_CHECK_MODULES_STATIC basically adds --static to $PKG_CONFIG. Given that portage-utils' configure doesn't have --enable-static or something, it doesn't have any idea of doing static stuff, other then what you pass it on. I think you'd have to export PKG_CONFIG="pkg-config --static" yourself to get this going.