Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 733554 - sys-fs/multipath-tools generates underlinked libraries (was: =app-emulation/qemu-5.0.0-r2: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_release')
Summary: sys-fs/multipath-tools generates underlinked libraries (was: =app-emulation/q...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-22 18:12 UTC by Alessandro Barbieri
Modified: 2020-07-25 01:41 UTC (History)
4 users (show)

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


Attachments
qemu-5.0.0-r2:20200722-174028.log.xz (qemu-5.0.0-r2:20200722-174028.log.xz,55.04 KB, application/x-xz)
2020-07-22 18:16 UTC, Alessandro Barbieri
Details
info (info,12.22 KB, text/plain)
2020-07-22 18:17 UTC, Alessandro Barbieri
Details
deleteme (deleteme,393.01 KB, text/plain)
2020-07-22 18:41 UTC, Alessandro Barbieri
Details
build.log (build.log.bz2,40.97 KB, application/x-bzip)
2020-07-23 09:23 UTC, Paul Jones
Details
multipath-tools-0.8.4:20200716-153724.log (multipath-tools-0.8.4:20200716-153724.log,154.75 KB, text/plain)
2020-07-23 22:11 UTC, Alessandro Barbieri
Details
lvm2-2.02.187-r2:20200717-001956.log (lvm2-2.02.187-r2:20200717-001956.log,420.97 KB, text/plain)
2020-07-23 22:12 UTC, Alessandro Barbieri
Details
libdevmapper-symbols (libdevmapper-symbols,21.94 KB, text/plain)
2020-07-23 23:24 UTC, Alessandro Barbieri
Details
libmultipath-symbols (libmultipath-symbols,24.69 KB, text/plain)
2020-07-23 23:24 UTC, Alessandro Barbieri
Details
qemu-5.0.0-r2:20200723-230747.log.xz (qemu-5.0.0-r2:20200723-230747.log.xz,69.50 KB, application/x-xz)
2020-07-23 23:30 UTC, Alessandro Barbieri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2020-07-22 18:12:50 UTC
qemu automagically depend on sys-fs/multipath-tools and can't link to it

x86_64-pc-linux-gnu-g++ -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -floop-interchange -ftree-loop-distribute-patterns -fpredictive-commoning -ftree-loop-distribution -fsplit-paths -ftree-vectorize -ftree-partial-pre -fgcse-after-reload -fivopts -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64  -fstack-protector-strong -o scsi/qemu-pr-helper scsi/qemu-pr-helper.o scsi/utils.o authz/base.o authz/simple.o authz/list.o authz/listfile.o authz/pamacct.o crypto/init.o crypto/hash.o crypto/hash-nettle.o crypto/hmac.o crypto/hmac-nettle.o crypto/aes.o crypto/desrfb.o crypto/cipher.o crypto/tlscreds.o crypto/tlscredsanon.o crypto/tlscredspsk.o crypto/tlscredsx509.o crypto/tlssession.o crypto/secret.o crypto/pbkdf.o crypto/pbkdf-nettle.o crypto/ivgen.o crypto/ivgen-essiv.o crypto/ivgen-plain.o crypto/ivgen-plain64.o crypto/afsplit.o crypto/block.o crypto/block-qcow.o crypto/block-luks.o io/channel.o io/channel-buffer.o io/channel-command.o io/channel-file.o io/channel-socket.o io/channel-tls.o io/channel-watch.o io/channel-websock.o io/channel-util.o io/dns-resolver.o io/net-listener.o io/task.o qom/object.o qom/container.o qom/qom-qobject.o qom/object_interfaces.o  libqemuutil.a  -lpam -ldl -lm -ljemalloc -luring -lz -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lgthread-2.0 -pthread -lglib-2.0 -lnettle -lgnutls -lzstd  -lrt -lz -lutil -lcap-ng  -ludev -lmultipath -lmpathpersist
x86_64-pc-linux-gnu-g++ -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -floop-interchange -ftree-loop-distribute-patterns -fpredictive-commoning -ftree-loop-distribution -fsplit-paths -ftree-vectorize -ftree-partial-pre -fgcse-after-reload -fivopts -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64  -fstack-protector-strong -o qemu-bridge-helper qemu-bridge-helper.o  libqemuutil.a   -ldl -lm -ljemalloc -luring -lz -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lgthread-2.0 -pthread -lglib-2.0 -lnettle -lgnutls -lzstd  -lrt -lz -lutil -lcap-ng
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_release'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_pathvec'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_maps'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `cleanup_prio'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_is_mpath'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `strlcpy'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `pathcount'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `recv_packet'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_map_present'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_config'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_multipathvec'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `set_max_fds'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_mapname'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `disassemble_status'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `select_all_tg_pt'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `mpath_disconnect'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_map'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `pathinfo'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `vector_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `mpath_connect'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dlog'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `disassemble_map'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `get_udev_device'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `find_mp_by_alias'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `select_reservation_key'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `load_config'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `cleanup_checkers'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `send_packet'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_exit'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_status'
collect2: error: ld returned 1 exit status
make: *** [/var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/rules.mak:124: scsi/qemu-pr-helper] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: app-emulation/qemu-5.0.0-r2::gentoo failed (compile phase):
 *   emake failed
 *
Comment 1 Alessandro Barbieri 2020-07-22 18:16:51 UTC
Created attachment 650214 [details]
qemu-5.0.0-r2:20200722-174028.log.xz

buildlog
Comment 2 Alessandro Barbieri 2020-07-22 18:17:42 UTC
Created attachment 650216 [details]
info

emerge --info
Comment 3 Alessandro Barbieri 2020-07-22 18:41:37 UTC
Created attachment 650220 [details]
deleteme

buildlog
Comment 4 Alessandro Barbieri 2020-07-22 18:43:41 UTC
Comment on attachment 650220 [details]
deleteme

wrong attachment
Comment 5 Paul Jones 2020-07-23 09:18:17 UTC
Same here. GCC 10 with -fcommon
I thought it was an lto bug at first so I turned it off for both multipath-tools and qemu, but same error.
Comment 6 Paul Jones 2020-07-23 09:23:47 UTC
Created attachment 650270 [details]
build.log

server ~ # emerge --info '=app-emulation/qemu-5.0.0-r1::gentoo'
Portage 3.0.0 (python 3.7.8-final-0, default/linux/amd64/17.1/systemd, gcc-10.1.0, glibc-2.30-r8, 5.7.8-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.7.8-gentoo-x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2643_v2_@_3.50GHz-with-gentoo-2.6
KiB Mem:    32901056 total,   1022036 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: 53682bf62e3c247e5c49229bf7abd1698d99a1de

sh bash 5.0_p17
ld GNU ld (Gentoo 2.34 p3) 2.34.0
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 3.7.9 [disabled]
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r100::lto-overlay, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/ccache:          3.7.9::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.34-r1::gentoo
sys-devel/gcc:            10.1.0-r2::gentoo
sys-devel/gcc-config:     2.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: laymansync
    sync-uri: https://github.com/InBetweenNames/gentooLTO.git
    masters: gentoo mv
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50

peejay
    location: /media/data/data-root/shared/peejay-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=ivybridge -O3 -pipe -falign-functions=32"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=ivybridge -O3 -pipe -falign-functions=32"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="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"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict news nostrip 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://ftp.swin.edu.au/gentoo http://mirror.aarnet.edu.au/pub/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo https://www.jabawok.net/gentoo/distfiles/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j13"
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"
USE="3dnow 3dnowext a52 aac activefilter alisp alsa amd64 amr apng berkdb btrfs bzip2 cli cpudetection crypt curl developer dri dvb eap-tls encode experimental faac fat fdk ffmpeg fileinfo flac fontconfig fpm ftp gd gdbm gdu graphite gudev httpd hwdb iconv ipv6 jemalloc jpeg kvm libtirpc libvidstab lm_sensors lvm lxc lz4 lzma mad mdadm minizip mp3 mpeg mtp multilib mysql mysqli ncurses nfs nfsv3 nfsv4 nfsv41 nls nptl openmp pam pcntl pcre pcre16 pdo pgo php png policykit pvr readline run-as-root seccomp snmp sockets sphinx split-usr sqlite sse2_4way sse3 sse4 sse4_1 sse4_2 ssl syslog systemd tcpd threads tiff tokudb truetype udev unicode ups_drivers_snmp-ups usb usbredir utils vpx x264 x265 xattr xkb xml xmltv xxhash xz yassl zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="aes avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="x86" NGINX_MODULES_HTTP="fastcgi auth_basic gzip gzip_static proxy" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" QEMU_SOFTMMU_TARGETS="aarch64 arm x86_64" QEMU_USER_TARGETS="aarch64 arm" RUBY_TARGETS="ruby25" 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 steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-emulation/qemu-5.0.0-r1::gentoo would be built with the following:
USE="aio alsa bzip2 caps curl fdt filecaps jemalloc jpeg lzo ncurses nfs nls oss pin-upstream-blobs png seccomp ssh usb usbredir vde vhost-net vhost-user-fs virtfs vnc xattr xkb zstd -accessibility (-capstone) -debug -doc -glusterfs -gnutls -gtk -infiniband -io-uring -iscsi -numa -opengl -plugins -pulseaudio -python -rbd -sasl -sdl -sdl-image (-selinux) -smartcard -snappy -spice -static -static-user -systemtap -tci -test -virgl -vte -xen -xfs" ABI_X86="(64)" PYTHON_TARGETS="python3_7 -python3_6 -python3_8" QEMU_SOFTMMU_TARGETS="aarch64 arm x86_64 -alpha -cris -hppa -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="aarch64 arm -aarch64_be -alpha -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -x86_64 -xtensa -xtensaeb"

>>> Attempting to run pkg_info() for 'app-emulation/qemu-5.0.0-r1'
Using:

  sys-firmware/edk2-ovmf-201905
    USE=binary
  sys-firmware/ipxe-1.0.0_p20190728
  sys-firmware/seabios-1.12.0
    USE=binary
  sys-firmware/sgabios-0.1_pre8-r1
Comment 7 Sergei Trofimovich gentoo-dev 2020-07-23 18:16:24 UTC
> qemu automagically depend on sys-fs/multipath-tools and can't link to it

It's is two distinct bugs.

> /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_release'

This looks like underlinked libmpathpersist.so against lvm libraries. Let' sort that out first. Can you attach build.log for sys-fs/multipath-tools?
Comment 8 Alessandro Barbieri 2020-07-23 22:11:56 UTC
Created attachment 650414 [details]
multipath-tools-0.8.4:20200716-153724.log

buildlog
Comment 9 Alessandro Barbieri 2020-07-23 22:12:45 UTC
Created attachment 650416 [details]
lvm2-2.02.187-r2:20200717-001956.log

buildlog
Comment 10 Sergei Trofimovich gentoo-dev 2020-07-23 22:32:51 UTC
(In reply to Alessandro Barbieri from comment #8)
> Created attachment 650414 [details]
> multipath-tools-0.8.4:20200716-153724.log
> 
> buildlog

> x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -shared -lpthread -ldevmapper -ldl -L../libmultipath -lmultipath -L../libmpathcmd -lmpathcmd -Wl,-soname=libmpathpersist.so.0 -o libmpathpersist.so.0 mpath_persist.o mpath_updatepr.o mpath_pr_ioctl.o

Does qemu still fail to link after the rebuild? dm_lib_release() should be providede by libdevmapper.
Comment 11 Alessandro Barbieri 2020-07-23 23:24:22 UTC
Created attachment 650422 [details]
libdevmapper-symbols

symbols
Comment 12 Alessandro Barbieri 2020-07-23 23:24:44 UTC
Created attachment 650424 [details]
libmultipath-symbols

symbols
Comment 13 Alessandro Barbieri 2020-07-23 23:28:51 UTC
I have just rebuilt all the 3 packages. Attached above the symbols provided by libmultipath and libdevmapper. Now quemu build just fail at linking without any meaningful error
Comment 14 Alessandro Barbieri 2020-07-23 23:30:05 UTC
Created attachment 650426 [details]
qemu-5.0.0-r2:20200723-230747.log.xz

buildlog
Comment 15 Sergei Trofimovich gentoo-dev 2020-07-24 06:41:50 UTC
(In reply to Alessandro Barbieri from comment #13)
> I have just rebuilt all the 3 packages. Attached above the symbols provided
> by libmultipath and libdevmapper. Now quemu build just fail at linking
> without any meaningful error

Looks meaningful to me:

"""
x86_64-pc-linux-gnu-g++ -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-tim
e -Os -pipe -march=native -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -floop-interchange -
ftree-loop-distribute-patterns -fpredictive-commoning -ftree-loop-distribution -fsplit-paths -ftree-vectorize -ftree-partial-pre -fgcse-after-reload -fivopts -Wimplicit-function-declaration -W
no-error=implicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64  -fstack-protector-strong -o scsi/qemu-pr-helper scsi/qemu-pr-helper.o scsi/u
tils.o authz/base.o authz/simple.o authz/list.o authz/listfile.o authz/pamacct.o crypto/init.o crypto/hash.o crypto/hash-nettle.o crypto/hmac.o crypto/hmac-nettle.o crypto/aes.o crypto/desrfb.
o crypto/cipher.o crypto/tlscreds.o crypto/tlscredsanon.o crypto/tlscredspsk.o crypto/tlscredsx509.o crypto/tlssession.o crypto/secret.o crypto/pbkdf.o crypto/pbkdf-nettle.o crypto/ivgen.o cry
pto/ivgen-essiv.o crypto/ivgen-plain.o crypto/ivgen-plain64.o crypto/afsplit.o crypto/block.o crypto/block-qcow.o crypto/block-luks.o io/channel.o io/channel-buffer.o io/channel-command.o io/c
hannel-file.o io/channel-socket.o io/channel-tls.o io/channel-watch.o io/channel-websock.o io/channel-util.o io/dns-resolver.o io/net-listener.o io/task.o qom/object.o qom/container.o qom/qom-
qobject.o qom/object_interfaces.o  libqemuutil.a  -lpam -ldl -lm -ljemalloc -luring -lz -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lgthread-2.0 -pthread -lglib-2.0 -lnettle -lgnut
ls -lzstd  -lrt -lz -lutil -lcap-ng  -ludev -lmultipath -lmpathpersist
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_release'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_pathvec'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_maps'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `cleanup_prio'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_is_mpath'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `strlcpy'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `pathcount'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `recv_packet'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_map_present'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_config'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `free_multipathvec'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `set_max_fds'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_mapname'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `disassemble_status'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `select_all_tg_pt'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `mpath_disconnect'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_map'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `pathinfo'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `vector_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `mpath_connect'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dlog'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `disassemble_map'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `get_udev_device'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `find_mp_by_alias'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `select_reservation_key'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `load_config'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `cleanup_checkers'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `send_packet'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_lib_exit'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/libmpathpersist.so: undefined reference to `dm_get_status'
collect2: error: ld returned 1 exit status
make: *** [/var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/rules.mak:124: scsi/qemu-pr-helper] Error 1
make: *** Waiting for unfinished jobs....
"""

libmpathpersist.so seems to miss a few of it's own symbols, like free_pathvec. And a few of devmapper symbols.

To make underlinking errors more visible try to build sys-fs/multipath-tools with LDFLAGS=-Wl,--no-undefined

I think the problem here is the ordering of object files and library files:

"""
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -shared -lpthread -ldevmapper -ldl -L../libmultipath -lmultipath -L../libmpathcmd -lmpathcmd -Wl,-soname=libmpathpersist.so.0 -o libmpathpersist.so.0 mpath_persist.o mpath_updatepr.o mpath_pr_ioctl.o
"""

For some linkers order matters: linked files should be passed in order of dependencies. Usually it is: $(LDFLAGS) $(OBJECTS) $(LIBS). Here we see $(LDFLAGS) $(LIBS) $(OBJECTS).

Assigning to base-system@ to fix underlinking.

Please file a separate bug to make qemu less automagic against sys-fs/multipath-tools.