Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 788409 - app-emulation/qemu-6.0.0[virgl, -opengl] : contrib/vhost-user-gpu/vhost-user-gpu.p/virgl.c.o: undefined reference to symbol 'epoxy_glFlush'
Summary: app-emulation/qemu-6.0.0[virgl, -opengl] : contrib/vhost-user-gpu/vhost-user-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-05-05 18:17 UTC by Karl-Johan Karlsson
Modified: 2021-05-07 08:27 UTC (History)
3 users (show)

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


Attachments
build.log (compressed, since it's 6MB raw) (build.log.xz,86.30 KB, application/x-xz)
2021-05-05 18:17 UTC, Karl-Johan Karlsson
Details
Patch to qemu-6.0.0.ebuild (qemu-6.0.0-virgl-requires-opengl.patch,927 bytes, patch)
2021-05-07 07:49 UTC, Karl-Johan Karlsson
Details | Diff
Patch to qemu-6.0.0.ebuild (qemu-6.0.0-virgl-requires-opengl.patch,927 bytes, patch)
2021-05-07 07:51 UTC, Karl-Johan Karlsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl-Johan Karlsson 2021-05-05 18:17:19 UTC
Created attachment 706212 [details]
build.log (compressed, since it's 6MB raw)

By accident, one of my hosts had app-emulation/qemu built with USE="virgl -opengl". This has always built just fine (at least since app-emulation/qemu-4.2.0, the oldest one in my logs), but I've never tried to use VirGL on that host, so who knows if it would have run.

When upgrading to app-emulation/qemu-6.0.0, the build failed with this linker error:

FAILED: contrib/vhost-user-gpu/vhost-user-gpu 
x86_64-pc-linux-gnu-gcc  -o contrib/vhost-user-gpu/vhost-user-gpu contrib/vhost-user-gpu/vhost-user-gpu.p/vhost-user-gpu.c.o contrib/vhost-user-gpu/vhost-user-gpu.p/virgl.c.o contrib/vhost-user-gpu/vhost-user-gpu.p/vugbm.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -fstack-protector-strong -march=native -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--enable-new-dtags -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a /usr/lib64/libpixman-1.so -lgbm -lvirglrenderer -pthread -lgthread-2.0 -lglib-2.0 -lgthread-2.0 -lglib-2.0 -lutil -lm -lgthread-2.0 -lglib-2.0 -Wl,--end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: contrib/vhost-user-gpu/vhost-user-gpu.p/virgl.c.o: undefined reference to symbol 'epoxy_glFlush'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libepoxy.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Adding USE="opengl" makes it build.

On another machine, setting USE="-opengl" makes the build fail in the same way.

Please add

   virgl? ( opengl )

to REQUIRED_USE for >=app-emulation/qemu-6.0.0.
Comment 1 Karl-Johan Karlsson 2021-05-05 18:23:01 UTC
Portage 3.0.18 (python 3.8.10-final-0, default/linux/amd64/17.1/hardened, gcc-11.1.0, glibc-2.33, 5.11.16-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.11.16-gentoo-x86_64-x86_64-AMD_Ryzen_7_PRO_3700U_w-_Radeon_Vega_Mobile_Gfx-with-glibc2.2.5
KiB Mem:    14295124 total,   4805028 free
KiB Swap:   15729660 total,  13574152 free
Timestamp of repository gentoo: Wed, 05 May 2021 15:30:01 +0000
Head commit of repository gentoo: ec9febe9594c231ef2b02eb4ced72a00612e8583
Head commit of repository creideiki: b7b0c52a306a95e4b94c4c6eae4fa78979fe6ee1

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p3) 2.36.1
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18_p9::gentoo, 3.8.10::gentoo, 3.9.5::gentoo
dev-lang/rust:            1.51.0-r2::gentoo
dev-util/cmake:           3.20.2::gentoo
sys-apps/baselayout:      2.7-r2::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.36.1-r1::gentoo
sys-devel/gcc:            10.3.0::gentoo, 11.1.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.12::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::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-verify-jobs: 1
    sync-rsync-extra-opts: --ipv4

creideiki
    location: /var/db/repos/creideiki
    sync-type: git
    sync-uri: https://github.com/creideiki/portage
    masters: gentoo

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

torbrowser
    location: /var/lib/layman/torbrowser
    sync-type: laymansync
    sync-uri: https://github.com/MeisterP/torbrowser-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --keep-going --quiet-build=n --backtrack=30 --verbose-conflicts"
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"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--ipv4"
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="X acl alsa amd64 bzip2 crypt dbus elogind eselect-ldso ffmpeg flac gif gles2 hackrf hardened iconv icu ipv6 jpeg libglvnd libtirpc mp3 multilib ncurses nls nptl ogg opencl opengl openmp orc pam pcre pie plasma png qml qt5 rav1e readline screencast seccomp split-usr ssl ssp udev unicode vaapi vorbis vulkan wayland x264 xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel" 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" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a 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="efi-64" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="en en-US en-GB sv" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF AMDGPU X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby27 ruby30" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS

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

app-emulation/qemu-6.0.0::gentoo was built with the following:
USE="-accessibility aio alsa bzip2 caps -capstone curl -debug -doc fdt filecaps -glusterfs -gnutls -gtk -infiniband -io-uring -iscsi -jack -jemalloc jpeg -lzo -multipath ncurses -nfs nls -numa opengl oss pin-upstream-blobs -plugins png -pulseaudio -python -rbd -sasl -sdl -sdl-image seccomp (-selinux) slirp -smartcard -snappy spice -ssh -static -static-user -systemtap -test udev -usb -usbredir -vde vhost-net -vhost-user-fs virgl -virtfs vnc -vte xattr -xen -xfs -zstd" ABI_X86="(64)" PYTHON_TARGETS="-python3_7 python3_8 -python3_9" QEMU_SOFTMMU_TARGETS="-aarch64 -alpha -arm -avr -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 x86_64 -xtensa -xtensaeb" QEMU_USER_TARGETS="-aarch64 -aarch64_be -alpha -arm -armeb -cris -hexagon -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 -x86_64 -xtensa -xtensaeb"
FEATURES="qa-unresolved-soname-deps preserve-libs userpriv protect-owned distlocks binpkg-docompress splitdebug usersandbox strict ipc-sandbox network-sandbox merge-sync sfperms news config-protect-if-modified xattr binpkg-multi-instance parallel-fetch multilib-strict assume-digests userfetch unmerge-logs buildpkg compressdebug unmerge-orphans binpkg-dostrip usersync fixlafiles unknown-features-warn sandbox pid-sandbox ebuild-locks binpkg-logs"

>>> Attempting to run pkg_info() for 'app-emulation/qemu-6.0.0'
Using:
  app-emulation/spice-protocol-0.14.3
  sys-firmware/edk2-ovmf-202008
    USE=binary
  sys-firmware/ipxe-1.21.1
  sys-firmware/seabios-1.14.0-r2
    USE=binary
  sys-firmware/sgabios-0.1_pre10
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-06 20:18:25 UTC
Do you want to write a patch yourself? I would apply it with `git am`.
Comment 3 Karl-Johan Karlsson 2021-05-07 07:49:13 UTC
Created attachment 706473 [details, diff]
Patch to qemu-6.0.0.ebuild

Sure. Here you go, output from "git format-patch -1".
Comment 4 Karl-Johan Karlsson 2021-05-07 07:51:32 UTC
Created attachment 706476 [details, diff]
Patch to qemu-6.0.0.ebuild

And here's one with the correct bug number, instead of the one in the template I copied.
Comment 5 Larry the Git Cow gentoo-dev 2021-05-07 08:24:36 UTC
The bug has been closed via the following commit(s):

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

commit e26a15f02d56e3eb1be5129ed7ef207ea3e46a1c
Author:     Karl-Johan Karlsson <creideiki@lysator.liu.se>
AuthorDate: 2021-05-07 07:40:43 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-05-07 08:24:33 +0000

    app-emulation/qemu: require opengl if virgl is enabled
    
    Closes: https://bugs.gentoo.org/788409
    Signed-off-by: Karl-Johan Karlsson <creideiki@lysator.liu.se>
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 app-emulation/qemu/qemu-6.0.0.ebuild | 1 +
 app-emulation/qemu/qemu-9999.ebuild  | 1 +
 2 files changed, 2 insertions(+)
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-07 08:27:24 UTC
Perfect! I applied it as it to 6.0.0 and copied to -9999.

Thank you!

Link failure also shows minor upstream problem: ideally the failure should happen at configure time (way earlier than link time). Looks like epoxy is still detected in ./configure instead of meson.build files. Might be worthwile tweaking upstream as well.