Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 954152 - app-emulation/qemu-9.2.3-r1: Fails to build - error: use of undeclared identifier 'x11_window'; did you mean 'gdk_window'?
Summary: app-emulation/qemu-9.2.3-r1: Fails to build - error: use of undeclared identi...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-21 13:26 UTC by zyxhere
Modified: 2025-04-22 06:40 UTC (History)
2 users (show)

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


Attachments
build.log.gz (build.log.gz,95.28 KB, application/gzip)
2025-04-21 13:26 UTC, zyxhere
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zyxhere 2025-04-21 13:26:27 UTC
Created attachment 925600 [details]
build.log.gz

./ui/gtk-egl.c:54:5: error: use of undeclared identifier 'Window'
   54 |     Window x11_window = gdk_x11_window_get_xid(gdk_window);
      |     ^
../ui/gtk-egl.c:55:10: error: use of undeclared identifier 'x11_window'; did you mean 'gdk_window'?
   55 |     if (!x11_window) {
      |          ^~~~~~~~~~
      |          gdk_window
../ui/gtk-egl.c:49:16: note: 'gdk_window' declared here
   49 |     GdkWindow *gdk_window = gtk_widget_get_window(vc->gfx.drawing_area);
      |                ^
../ui/gtk-egl.c:61:45: error: use of undeclared identifier 'x11_window'
   61 |         (vc->gfx.ectx, (EGLNativeWindowType)x11_window);
      |                                             ^
../ui/gtk-egl.c:397:5: error: use of undeclared identifier 'Display'
  397 |     Display *x11_display = gdk_x11_display_get_xdisplay(gdk_display);
      |     ^
../ui/gtk-egl.c:397:14: error: use of undeclared identifier 'x11_display'; did you mean 'gdk_display'?
  397 |     Display *x11_display = gdk_x11_display_get_xdisplay(gdk_display);
      |              ^~~~~~~~~~~
      |              gdk_display
../ui/gtk-egl.c:396:17: note: 'gdk_display' declared here
  396 |     GdkDisplay *gdk_display = gdk_display_get_default();
      |                 ^
../ui/gtk-egl.c:397:28: error: call to undeclared function 'gdk_x11_display_get_xdisplay'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  397 |     Display *x11_display = gdk_x11_display_get_xdisplay(gdk_display);
      |                            ^
../ui/gtk-egl.c:399:31: error: use of undeclared identifier 'x11_display'; did you mean 'gdk_display'?
  399 |     if (qemu_egl_init_dpy_x11(x11_display, mode) < 0) {
      |                               ^~~~~~~~~~~
      |                               gdk_display
../ui/gtk-egl.c:396:17: note: 'gdk_display' declared here
  396 |     GdkDisplay *gdk_display = gdk_display_get_default();
      |                 ^
7 errors generated.
ninja: subcommand failed


Portage 3.0.68 (python 3.13.3-final-0, default/linux/amd64/23.0/no-multilib/hardened/systemd, gcc-15, glibc-2.41-r1, 6.14.2-gentoo-dist-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.14.2-gentoo-dist-hardened-x86_64-12th_Gen_Intel-R-_Core-TM-_i5-1235U-with-glibc2.41
KiB Mem:    11953108 total,   3491576 free
KiB Swap:    8290300 total,   7380192 free
Timestamp of repository gentoo: Mon, 21 Apr 2025 10:48:59 +0000
Head commit of repository gentoo: 5dd1ceecb53ab6aa7df216edc260af270bec50a5

Timestamp of repository guru: Sun, 20 Apr 2025 09:35:12 +0000
Head commit of repository guru: 450f3009286a72260b58299322acae553e5400ae

sh bash 5.2_p37
ld GNU ld (Gentoo 2.44 p1) 2.44.0
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.17-r2::gentoo
dev-build/cmake:           3.31.7::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.7.2::gentoo
dev-lang/perl:             5.40.2::gentoo
dev-lang/python:           3.12.10::gentoo, 3.13.3::gentoo
dev-lang/rust:             1.81.0-r101::gentoo
llvm-core/clang:           18.1.8-r6::gentoo
llvm-core/lld:             18.1.8::gentoo
llvm-core/llvm:            18.1.8-r6::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/sandbox:          2.46::gentoo
sys-apps/systemd:          257.5::gentoo
sys-devel/binutils:        2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             15.0.1_pre20250418-r1::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.14::gentoo (virtual/os-headers)
sys-libs/glibc:            2.41-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/guru.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64-v3

Installed sets: @base, @extra, @gnomie, @utils
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -flto=auto -ggdb3 		-fno-semantic-interposition -ftrivial-auto-var-init=zero -Werror=odr -Werror=lto-type-mismatch 		-Werror=strict-aliasing -fdiagnostics-color=always"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=native -O2 -pipe -flto=auto -ggdb3 		-fno-semantic-interposition -ftrivial-auto-var-init=zero -Werror=odr -Werror=lto-type-mismatch 		-Werror=strict-aliasing -fdiagnostics-color=always"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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="-march=native -O2 -pipe -flto=auto -ggdb3 		-fno-semantic-interposition -ftrivial-auto-var-init=zero -Werror=odr -Werror=lto-type-mismatch 		-Werror=strict-aliasing -fdiagnostics-color=always"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live compressdebug config-protect-if-modified distlocks ebuild-locks export-pms-vars fixlafiles installsources ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
FFLAGS="-march=native -O2 -pipe -flto=auto -ggdb3 		-fno-semantic-interposition -ftrivial-auto-var-init=zero -Werror=odr -Werror=lto-type-mismatch 		-Werror=strict-aliasing -fdiagnostics-color=always"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LD="ld.mold"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=auto -fuse-ld=mold"
LEX="flex"
LIBTOOL="rlibtool"
MAKE="make LIBTOOL=rlibtool"
MAKEFLAGS="LIBTOOL=rlibtool"
MAKEOPTS="-j10 -l12"
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"
RUSTFLAGS="-C target-cpu=native -C linker=clang -C linker-plugin-lto 		-C link-arg=-flto=auto -C link-arg=-fuse-ld=mold"
SHELL="/bin/bash"
USE="acl amd64 aom av1 avif bluetooth bzip2 cet crypt cups dbus dist-kernel ffmpeg flac fontconfig gdbm gif gles gles2 gnome gnome-keyring gstreamer gtk gtk4 hardened harfbuzz iconv icu io-uring ipv6 jpeg jpegxl keyring lcms libaom libtirpc lto lz4 lzma lzo modemmanager ncurses networkmanager nls openh264 openmp opus orc pam pcre pdf pgo pic pie pipewire png policykit profile readline screencast seccomp sound spell ssl ssp svg systemd test-rust tiff tpm udev udisks unicode upower usb vaapi vala vpx vulkan wayland webp xattr xml xtpax zlib zstd" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_SLOT="18" LLVM_TARGETS="x86 AMDGPU WebAssembly AArch64 ARM RISCV LoongArch" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_13" PYTHON_TARGETS="python3_13" RUBY_TARGETS="ruby32" VIDEO_CARDS="intel lavapipe" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LINGUAS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Eli Schwartz gentoo-dev 2025-04-22 04:39:30 UTC
  if gtk.found()
    gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
                        method: 'pkg-config',
                        required: false)




if gtkx11.found()
  x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found())
endif


And then it sets -DCONFIG_X11 everywhere.

This is pretty awkward.


As discussed with Sam, I added this commit:

commit fae2ef851deea7ee791ac044e2b201cdef62bc89
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: Mon Apr 14 22:07:22 2025
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: Mon Apr 21 04:28:42 2025

    app-emulation/qemu: avoid automagic deps on gtk+[X,wayland]
    
    e.g. the upstream code checks whether GDK_WINDOWING_WAYLAND is defined
    by the gtk headers, and if so will compile against the wayland symbols
    it provides. This means that qemu built on a system with gtk+[-wayland]
    will be compatible with anything, but when built on a system with
    gtk+[wayland], requires that at runtime.
    
    Use a Gentoo-specific macro hack to hide the GTK implementations when we
    don't want it, alongside new USE flags to control the dependency usage.
    
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 app-emulation/qemu/{qemu-9.1.2.ebuild => qemu-9.1.2-r1.ebuild} | 10 +++++++---
 app-emulation/qemu/{qemu-9.1.3.ebuild => qemu-9.1.3-r1.ebuild} | 10 +++++++---
 app-emulation/qemu/{qemu-9.2.3.ebuild => qemu-9.2.3-r1.ebuild} | 10 +++++++---
 app-emulation/qemu/qemu-9999.ebuild                            | 10 +++++++---
 4 files changed, 28 insertions(+), 12 deletions(-)
 rename app-emulation/qemu/{qemu-9.1.2.ebuild => qemu-9.1.2-r1.ebuild} (98%)
 rename app-emulation/qemu/{qemu-9.1.3.ebuild => qemu-9.1.3-r1.ebuild} (98%)
 rename app-emulation/qemu/{qemu-9.2.3.ebuild => qemu-9.2.3-r1.ebuild} (98%)


This is obviously a "good" thing as now you can't get automagic dependencies if you build with USE="-X". Also, it's a bad thing since it now goes ahead and detects x11.pc and gtk+-x11-3.0.pc regardless and tries to use it.

I think this means effectively USE=X needs to be forced / withdrawn so that USE=gtk unconditionally enables X support. Do we think that upstream will add an option to control this?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-22 06:25:23 UTC
> I think this means effectively USE=X needs to be forced / withdrawn so that
> USE=gtk unconditionally enables X support. Do we think that upstream will
> add an option to control this?

I think they would, yeah, though reviews usually take ages. Forcing is fine for now.
Comment 3 Larry the Git Cow gentoo-dev 2025-04-22 06:40:58 UTC
The bug has been referenced in the following commit(s):

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

commit ce499b2bc455a19aa44b36f451966168ecc2160b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-22 06:33:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-22 06:40:41 +0000

    profiles/base: force app-emulation/qemu[X]
    
    qemu[X] still has automagic on some parts of gtk[X]. Workaround that
    for now for bug #954152.
    
    This was exposed by fae2ef851deea7ee791ac044e2b201cdef62bc89 as if
    gtk[X] was found (and gtk[X] being found implies libX11 is around), you
    would get the automagic availability of functions like gdk_x11_display_get_xdisplay.
    
    Bug: https://bugs.gentoo.org/954152
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.use.force | 5 +++++
 1 file changed, 5 insertions(+)