System information
$ inxi -GSC -xx
System:
Host: erigorv Kernel: 6.14.0-rc5-mainline-byw-llvm-znver4 arch: x86_64
bits: 64 compiler: clang v: 19.1.7
Desktop: KDE Plasma v: 6.2.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
Distro: Gentoo Base System release 2.17
CPU:
Info: 8-core model: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics bits: 64
type: MT MCP arch: Zen 4 rev: 1 cache: L1: 512 KiB L2: 8 MiB L3: 16 MiB
Speed (MHz): avg: 523 high: 1397 min/max: 400/3801 boost: enabled cores:
1: 400 2: 400 3: 400 4: 400 5: 400 6: 400 7: 400 8: 400 9: 1383 10: 400
11: 1397 12: 400 13: 400 14: 400 15: 400 16: 400 bogomips: 121374
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: AMD Phoenix1 vendor: Framework driver: amdgpu v: kernel
arch: RDNA-3 pcie: speed: 16 GT/s lanes: 16 ports: active: DP-4,eDP-1
empty: DP-1, DP-2, DP-3, DP-5, DP-6, DP-7, DP-8, Writeback-1
bus-ID: c2:00.0 chip-ID: 1002:15bf temp: 43.0 C
Device-2: Framework Laptop Webcam Module (2nd Gen) driver: uvcvideo
type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-1:2 chip-ID: 32ac:001c
Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
compositor: kwin_wayland driver: X: loaded: amdgpu
unloaded: fbdev,modesetting,radeon alternate: vesa dri: radeonsi
gpu: amdgpu d-rect: 4720x5440 display-ID: 0
Monitor-1: DP-4 pos: primary,top-left res: 2160x3840 size: N/A
Monitor-2: eDP-1 pos: bottom-r res: 2560x1600 size: N/A
API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
gbm: drv: kms_swrast surfaceless: drv: radeonsi wayland: drv: radeonsi x11:
drv: radeonsi
API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.1.0-devel
glx-v: 1.4 direct-render: yes renderer: AMD Radeon 780M (radeonsi phoenix
ACO DRM 3.61 6.14.0-rc5-mainline-byw-llvm-znver4) device-ID: 1002:15bf
display-ID: :0.0
API: Vulkan v: 1.4.304 surfaces: xcb,xlib,wayland device: 0
type: integrated-gpu driver: N/A device-ID: 1002:15bf
$ gcc --version
gcc (Gentoo Hardened 14.2.1_p20241221 p7) 14.2.1 20241221
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 19.1.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/19/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
Describe the issue
Since !33634 (merged) ( bisected to 906dcb56 ), fails to build ( linking I'm guessing ). Fails to find a reference too glFlush ( error messages below )
Regression
-
removing the option
-Dlegacy-x11=dri2
leads to successful build -
Before commit 906dcb56 or reverting 906dcb56 starting from 69982e6f and
git rm src/gallium/targets/osmesa/meson.build
, build succeeds
Build configuration/script
I build 64bit manually ( for git bisect reasons ) from mesa repository rather than gentoo ebuild
#!/bin/bash
mesaargs=(
-Db_lto=false
-Db_pch=false
-Dwerror=false
-Dbuildtype=plain
-Dplatforms=x11,wayland
-Dgallium-nine=false
-Dgallium-va=enabled
-Dva-libs-path=/usr/lib64/va/drivers
-Dgallium-vdpau=disabled
-Dgallium-xa=disabled
-Dvulkan-layers=device-select,overlay
-Dglx=dri
-Dintel-rt=disabled
-Dbuild-tests=false
-Dshared-glapi=enabled
-Dlegacy-x11=dri2
-Dexpat=enabled
-Dopengl=true
-Dgbm=enabled
-Dgles1=enabled
-Dgles2=enabled
-Dglvnd=enabled
-Degl=enabled
-Dllvm=enabled
-Dlmsensors=enabled
-Dosmesa=false
-Dselinux=false
-Dlibunwind=disabled
-Dzstd=enabled
-Dsse2=true
-Dmesa-clc=auto
-Dvalgrind=disabled
-Dvideo-codecs=all
-Dgallium-drivers=llvmpipe,radeonsi,zink
-Dvulkan-drivers=amd
-Db_ndebug=true)
SRCDIR="/home/user/gitrepo/gitlab_freedesktop_org/mesa/mesa/"
BUILDDIR="/home/user/gitrepo/gitlab_freedesktop_org/mesa/_build"
rm -r $BUILDDIR
meson setup $SRCDIR $BUILDDIR "${mesaargs[@]}"
if [[ $? -ne 0 ]]; then
echo meson setup failed...
exit 1
fi
meson configure --no-pager $BUILDDIR
if [[ $? -ne 0 ]]; then
echo meson configure failed...
exit 1
fi
ninja -j18 -l0 -C $BUILDDIR
if [[ $? -ne 0 ]]; then
echo ninja building failed...
exit 1
fi
exit 0
When building 32bit, I do so just using gentoo emerge as I wasn't quite sure how to manually configure the build environment to 32bit. The ebuild for that is https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/mesa/mesa-9999.ebuild?id=ae0f979e636e5c517ef46be2f6f6dc3c76959967
Error messages building mesa
64bit - manually from repo
[1706/1708] Linking target src/glx/libGLX_mesa.so.0.0.0
FAILED: src/glx/libGLX_mesa.so.0.0.0
c++ -o src/glx/libGLX_mesa.so.0.0.0 -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libGLX_mesa.so.0 -Wl,--whole-archive -Wl,--start-group src/glx/libglx.a -Wl,--no-whole-archive src/loader/libloader.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/x11/libloader_x11.a src/gallium/auxiliary/pipe-loader/libpipe_loader_dynamic.a src/util/libxmlconfig.a src/gallium/targets/dri/libgallium-25.1.0-devel.so -Wl,-Bsymbolic -Wl,--gc-sections /usr/lib64/libdrm.so -lm -pthread /usr/lib64/libX11.so /usr/lib64/libxcb-glx.so /usr/lib64/libxcb.so /usr/lib64/libX11-xcb.so /usr/lib64/libxcb-dri2.so /usr/lib64/libXext.so /usr/lib64/libXfixes.so /usr/lib64/libXxf86vm.so /usr/lib64/libxcb-shm.so /usr/lib64/libz.so /usr/lib64/libzstd.so /usr/lib64/libexpat.so /usr/lib64/libxshmfence.so /usr/lib64/libxcb-randr.so /usr/lib64/libxcb-dri3.so /usr/lib64/libxcb-present.so /usr/lib64/libxcb-sync.so /usr/lib64/libxcb-xfixes.so -Wl,--end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: src/glx/libglx.a.p/dri2_glx.c.o: in function `dri2Flush':
dri2_glx.c:(.text.dri2Flush+0x4d): undefined reference to `glFlush'
collect2: error: ld returned 1 exit status
[1708/1708] Linking target src/amd/vulkan/libvulkan_radeon.so
ninja: build stopped: subcommand failed.
32bit - from gentoo emerge
FAILED: src/glx/libGLX_mesa.so.0.0.0
g++ -m32 -mfpmath=sse -o src/glx/libGLX_mesa.so.0.0.0 -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libGLX_mesa.so.0 -Wl,--whole-archive -Wl,--start-group src/glx/libglx.a -Wl,--no-whole-archive -O2 -pipe -march=znver4 -mtune=znver4 -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-O2 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-O2 -Wl,--as-needed -Wl,-z,pack-relative-relocs src/loader/libloader.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/x11/libloader_x11.a src/gallium/auxiliary/pipe-loader/libpipe_loader_dynamic.a src/util/libxmlconfig.a src/gallium/targets/dri/libgallium-25.1.0-devel.so -Wl,-Bsymbolic -Wl,--gc-sections /usr/lib/libdrm.so -lm -pthread /usr/lib/libX11.so /usr/lib/libxcb-glx.so /usr/lib/libxcb.so /usr/lib/libX11-xcb.so /usr/lib/libxcb-dri2.so /usr/lib/libXext.so /usr/lib/libXfixes.so /usr/lib/libXxf86vm.so /usr/lib/libxcb-shm.so /usr/lib/libz.so /usr/lib/libzstd.so /usr/lib/libexpat.so /usr/lib/libxshmfence.so /usr/lib/libxcb-randr.so /usr/lib/libxcb-dri3.so /usr/lib/libxcb-present.so /usr/lib/libxcb-sync.so /usr/lib/libxcb-xfixes.so -Wl,--end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: src/glx/libglx.a.p/dri2_glx.c.o: in function `dri2SwapBuffers':
dri2_glx.c:(.text.dri2SwapBuffers+0x159): undefined reference to `glFlush'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: src/glx/libglx.a.p/dri2_glx.c.o: in function `dri2CopySubBuffer':
dri2_glx.c:(.text.dri2CopySubBuffer+0x171): undefined reference to `glFlush'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
another user report from Arch Linux - https://aur.archlinux.org/packages/mesa-git#comment-1014127
FAILED: src/glx/libGLX_mesa.so.0.0.0
c++ -o src/glx/libGLX_mesa.so.0.0.0 -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libGLX_mesa.so.0 -Wl,--whole-archive -Wl,--start-group src/glx/libglx.a -Wl,--no-whole-archive -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g1 src/loader/libloader.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/x11/libloader_x11.a src/gallium/auxiliary/pipe-loader/libpipe_loader_dynamic.a src/util/libxmlconfig.a src/gallium/targets/dri/libgallium-25.1.0-devel.so -Wl,-Bsymbolic -Wl,--gc-sections /usr/lib/libdrm.so -lm -pthread /usr/lib/libX11.so /usr/lib/libxcb-glx.so /usr/lib/libxcb.so /usr/lib/libX11-xcb.so /usr/lib/libxcb-dri2.so /usr/lib/libXext.so /usr/lib/libXfixes.so /usr/lib/libXxf86vm.so /usr/lib/libxcb-shm.so /usr/lib/libz.so /usr/lib/libzstd.so /usr/lib/libunwind.so /usr/lib/libexpat.so /usr/lib/libxshmfence.so /usr/lib/libxcb-randr.so /usr/lib/libxcb-dri3.so /usr/lib/libxcb-present.so /usr/lib/libxcb-sync.so /usr/lib/libxcb-xfixes.so -Wl,--end-group
/usr/bin/ld: src/glx/libglx.a.p/dri2_glx.c.o: in function `dri2SwapBuffers':
/home/user/.cache/paru/clone/mesa-git/src/_build/../mesa/src/glx/dri2_glx.c:288:(.text.dri2SwapBuffers+0x127): undefined reference to `glFlush'
/usr/bin/ld: src/glx/libglx.a.p/dri2_glx.c.o: in function `dri2CopySubBuffer':
/home/user/.cache/paru/clone/mesa-git/src/_build/../mesa/src/glx/dri2_glx.c:288:(.text.dri2CopySubBuffer+0x172): undefined reference to `glFlush'
collect2: error: ld returned 1 exit status
[3424/3433] Compiling Rust source src/nouveau/headers/lib.rs
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
Aborting...
error: failed to build 'mesa-git-25.0.0_devel.200442.bfa6b9b6551.d41d8cd-1':
error: packages failed to build: mesa-git-25.0.0_devel.200442.bfa6b9b6551.d41d8cd-1