Skip to content

mesa-aurora: bring llvmpipe back, linked to the system LLVM - #1711

Merged
maralcbr merged 2 commits into
omacom:masterfrom
scottjones:mesa-aurora-llvmpipe
Oct 29, 2026
Merged

maralcbr merged 2 commits into
omacom:masterfrom
scottjones:mesa-aurora-llvmpipe

Conversation

@scottjones

@scottjones scottjones commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1474. A Mac whose GPU doesn't start renders its desktop with Gallium's software fallback, and since 32ae19d that's been softpipe, which can't keep up with a Mac's panel. This brings llvmpipe back in mesa-aurora, linked to the system LLVM like Arch's own mesa, so those Macs get llvmpipe instead.

Eryk dropped llvmpipe in 32ae19d for a good reason: llvm-libs changes its soname every major, and a Mesa built against the old one stops loading, GPU driver included. So mesa-aurora now depends on LLVM's soname (makepkg writes libLLVM.so=23.1-64) and rebuilds on llvm-libs. That turns an LLVM major bump from a silent GPU failure into a loud refusal, and the refusal is the trade-off: until the rebuilt mesa-aurora publishes, the whole pacman -Syu fails with "breaks dependency 'libLLVM.so=23.1-64' required by mesa-aurora", and fresh installs fail the same way. The rebuild check runs every 6 hours, and a rebuild that fails waits as a red PR for a maintainer, so that window has no hard upper bound. Whether to accept it is a maintainer call.

We tried a frozen llvm22-libs next to the system LLVM first, but two LLVM versions in one process crash because their shared objects clash, in both orders.

On an M3 Air with the GPU switched off (chosen.asahi,t8122-gpu=0), the desktop was barely usable on softpipe and noticeably better on this build's llvmpipe (LLVM 23, one libLLVM in Hyprland); with the GPU back on it renders on the Apple M3 GPU as before. On the M2 Max, check() passes 111/111, llvmpipe draws about 17,000 fps against softpipe's 319 on a simple draw, the GPU path is unchanged, and LLVM 23 in the same process passes.

One thing to watch when promoting: each channel's mesa-aurora has to match that channel's Arch Linux ARM LLVM. Promoting an LLVM 24 build before the channel's snapshot moves, or the reverse, holds back -Syu there, and promote-channel doesn't check for it.

Test plan

  • CI: check() passes, and the built mesa-aurora's .PKGINFO has depend = libLLVM.so=<major.minor>-64, not bare
  • M3 Air with the GPU off (chosen.asahi,t8122-gpu=0): the session renderer is llvmpipe (LLVM 23), not softpipe, and the desktop is usable
  • M3 Air with the GPU on: the renderer is the Apple GPU, and the desktop and apps are unchanged
  • A Mac with a working GPU (M1/M2 or Neo): unchanged after the upgrade
  • An app that loads LLVM 23 itself (for example something using lavapipe) runs normally next to GL

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with the upgrade delays that scottjones explicitly accepts.

Summary

Restores llvmpipe in mesa-aurora using shared system LLVM.

  • Macs without a working GPU can use llvmpipe for desktop rendering.
  • Mesa rebuilds and upgrades track the LLVM soname it needs.

scottjones explicitly accepts blocked upgrades and fresh installs between an LLVM change and a successful rebuild. They also acknowledge that mismatched channel promotions can block upgrades because promote-channel does not check LLVM compatibility.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Build Mesa with llvmpipe] --> B[Gallium links system LLVM]
  B --> C[mesa-aurora declares libLLVM.so]
  D[llvm-libs version changes] --> E[Rebuild check detects change]
  E --> F[Bump package release and rebuild]
Loading

Reviews (4) · Last reviewed commit: "mesa-aurora: read libgallium's LLVM sona..." · Reviewed by Greptile

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scottjones, this is the right way to bring llvmpipe back. Linking the one system LLVM and letting makepkg version libLLVM.so from libgallium turns the 32ae19d failure, a GPU driver that silently stops loading, into a loud pacman refusal. The note on why a frozen llvm22-libs can't work is useful. No code blockers.

Checked and fine

  • check() (PKGBUILD:67-101) does what the commit says. Each of these fails the build: SPIRV-Tools anywhere, LLVM outside libgallium, two LLVMs or a soname that isn't major.minor, a non-executable libgallium, and a libgallium without LLVM. cp -a at PKGBUILD:110 keeps the exec bit that makepkg needs to version the depend.
  • rebuild_on: llvm-libs reads the same arm-mirror.omarchy.org as the edge builder (bin/sync-rebuilds:26, helpers/fast-ring-check.sh:41). So the rebuild sees the LLVM that edge users get.
  • The Mesa recipe test in tests/aurora-edge/review.py passes locally. Three other cases in that file (the kernel headers and m1n1) also fail on my Mac at the base, so they come from my environment, not this PR.

Before merge

  • CI hasn't run yet. The mesa-aurora build, self-tests and build-isolation are still pending, and result hasn't reported. Please tick the .PKGINFO item from the CI artifact: it should say depend = libLLVM.so=23.1-64, not a bare libLLVM.so. Only that line proves the hold works. If makepkg leaves the depend unversioned, an LLVM bump brings back exactly the 32ae19d failure.
  • Please make the PR body precise about the hold. pacman doesn't just hold back llvm-libs: the whole pacman -Syu fails with "breaks dependency 'libLLVM.so=23.1-64' required by mesa-aurora" until the rebuild publishes, and fresh installs fail the same way. The rebuild check runs every 6 hours (ci/README.md:108). A failed rebuild waits as a red PR for a maintainer, so the window has no hard upper bound.

Still open, and not code issues

  • Accepting that hold is a maintainer call. I think a refused upgrade is a better failure than a missing GPU driver, but I want that decision made explicitly before this merges.
  • rc and stable on aarch64 run their own Arch Linux ARM snapshots (helpers/fast-ring-check.sh:39-41), and bin/promote-channel doesn't compare sonames. So mesa-aurora has to be promoted in step with each snapshot's LLVM. A promotion guard would belong in a separate PR, since it's bin/. That PR could also fix README.md:229, which still says every aarch64 channel runs the same live repositories.
  • This edits existing tests under tests/aurora-edge/, so auto-merge won't arm (.github/scripts/auto-merge-pr.cjs:34). I'll merge it by hand once it's green.

Nits, fine as follow-ups:

  • PKGBUILD:81: under pipefail, the grep | sed pipeline aborts check() on the first library without LLVM. makepkg doesn't set pipefail today, but a single sed -nE 's/.*NEEDED.*\[(libLLVM[^]]*)\].*/\1/p' avoids the question and keeps the two-LLVM case failing.

For release (not the merge): before promoting to rc or stable, please confirm that channel's snapshot ships llvm-libs 23.1. The two unticked hardware items are also still needed: a Neo or M1 with a working GPU unchanged after the upgrade, and an app that loads LLVM 23 itself running next to GL, both on the CI build.

Comment thread pkgbuilds/mesa-aurora/PKGBUILD Outdated
echo "Unexpected compiler runtime dependency: $binary" >&2
return 1
fi
llvm=$(grep -oE 'NEEDED.*\[libLLVM[^]]*\]' <<<"$dependencies" | sed -E 's/.*\[(.*)\]/\1/')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: under pipefail this pipeline fails on every library without LLVM. llvm=$(sed -nE 's/.*NEEDED.*\[(libLLVM[^]]*)\].*/\1/p' <<<"$dependencies") gives the same result without depending on shell options.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cedcc6e. One sed now, so a library without LLVM no longer aborts check() under errexit with pipefail. Two LLVM sonames still fail.

pkgdesc='Aurora native Asahi Gallium and Zink OpenGL drivers'
depends=('expat' 'glibc' 'gcc-libs' 'libdrm' 'libglvnd' 'libx11' 'libxcb' 'libxext'
'libxshmfence' 'libxxf86vm' 'lm_sensors' 'wayland' 'zlib' 'zstd'
'libxshmfence' 'libxxf86vm' 'libLLVM.so' 'lm_sensors' 'wayland' 'zlib' 'zstd'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the line the hold depends on. Please confirm from the CI artifact's .PKGINFO that it comes out as libLLVM.so=23.1-64.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed on cedcc6e's CI artifact (run 40611672833): depend = libLLVM.so=23.1-64.

@scottjones

Copy link
Copy Markdown
Contributor Author

Here's where each of your points landed, Marcelo.

  • CI and .PKGINFO: the run on ca923f1 was all green (mesa-aurora build, self-tests, build-isolation, result). I pulled that run's artifact and mesa-aurora's .PKGINFO has depend = libLLVM.so=23.1-64, versioned, not bare. Your line 81 nit is fixed in cedcc6e (replied on that thread). CI on cedcc6e is still running; I'll confirm its .PKGINFO too once the build finishes.
  • Hold wording: updated. The description now says the whole pacman -Syu fails with "breaks dependency 'libLLVM.so=23.1-64' required by mesa-aurora" until the rebuild publishes, fresh installs fail the same way, the check runs every 6 hours, and a failed rebuild has no hard upper bound.
  • Release checks: both done on CI's own packages (run 40584161429).
    • MacBook Neo (Apple A18 Pro, G17P B1) with a working GPU: no change after installing CI's mesa-aurora and vulkan-aurora -2 with llvm-libs 23.1.4-1. Renderer is still G17P on asahi, Hyprland maps only libLLVM.so.23.1, 0 GPU faults, 0 coredumps.
    • App that loads LLVM 23 itself next to GL, same machine and build: a program linking LLVM 23 that interleaves MCJIT and GL draws passes on the GPU and on llvmpipe. The draw-module JIT paths (RasterPos, RasterPos with a vertex shader, GL_FEEDBACK) pass with LLVM 23 loaded late or preloaded. gles-draw with LLVM 23 preloaded runs about 117,000 fps on the GPU and about 14,000 on llvmpipe. Only one libLLVM.so.23.1 in the process.
    • Earlier: the M3 Air (J613) with the GPU off went from barely usable on softpipe to usable on llvmpipe (LLVM 23), and with the GPU back on it renders on the M3 GPU. M2 Max check() is 111/111.
  • Hold and promotion: agreed, the hold is your and Ryan's call. Also agreed a promotion guard belongs in a separate PR (bin/promote-channel comparing sonames, plus README.md:229). Before promoting to rc or stable, we should check that channel's snapshot ships llvm-libs 23.1.
  • Heads-up for the hold: arm-mirror.omarchy.org's extra database lists llvm-libs 23.1.4-1 right now, but that file returns 404 there (Arch Linux ARM upstream has it). I'm sending you a separate note on it.

Thanks for the careful review, this PR is better for it.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scottjones, everything from my last review is addressed. The .PKGINFO shows depend = libLLVM.so=23.1-64, and the Neo, M3 Air and M2 Max checks cover what I asked for. No code blockers at ec3972f.

Before merge

  • It conflicts with master since #1798 moved the Mesa pin. Please rebase onto master's pkgver=26.3.0_devel.20261029.231476.672657e05e6 and _commit=672657e05e6b…, keeping pkgrel=2 so it upgrades over the published -1. Then reconfirm the versioned libLLVM.so depend in the rebased build's .PKGINFO.
  • rebuilt_against says llvm-libs 23.1.3-4.1, but edge now serves 23.1.4-1.1. sync-rebuilds compares full versions, so this would open a redundant rebuild PR right after merge. Please record the version the rebased build actually used.

Channels, checked today

  • The 404 is gone: arm-mirror serves llvm-libs-23.1.4-1.1. rc and stable serve 23.1.3-3. All three are soname 23.1, so the -2 build installs on any of them.
  • rc is safe for now because release/mac-inventory.txt pins mesa-aurora to -1, which has no LLVM. -2 reaches rc only when someone qualifies it on purpose.
  • #1745's check-mac-set does not close the LLVM gap, because it skips dependencies the channel itself doesn't provide, and llvm-libs comes from Arch Linux ARM. The promote-channel soname guard is still worth its own PR. Until it exists, whoever qualifies a new mesa-aurora checks the target snapshot's LLVM.

The only thing left is the hold trade-off, which is a maintainer decision. I'll approve once that's made and the rebase is green.

scottjones and others added 2 commits October 29, 2026 07:09
A Mac without a working GPU renders its desktop with Gallium's software
fallback. Since 32ae19d that fallback has been softpipe, which can't
keep up with a Mac's panel (omacom#1474): on an M3 Air with its GPU off,
Hyprland pins a core under softpipe. llvmpipe (tested from an earlier
LLVM 22 build) is noticeably better, though not smooth with blur and
animations on.

32ae19d dropped llvmpipe because it links LLVM, and llvm-libs changes
its soname every major: an Arch Linux ARM bump would remove the libLLVM
this package was built against, and libgallium, with the Asahi GPU
driver in it, would stop loading until a rebuild.

Link llvmpipe to the system LLVM anyway, as Arch's own mesa does, so
every process has one LLVM. mesa-aurora depends on 'libLLVM.so', which
makepkg versions from libgallium's NEEDED soname (libLLVM.so=23.1-64
today, which llvm-libs provides), not on llvm-libs by name. So when
Arch Linux ARM moves to the next major, pacman refuses the upgrade
until this package is rebuilt for it, instead of leaving libgallium
without its LLVM. That is the cost: an LLVM major bump holds back -Syu,
and fresh installs, on these Macs until the rebuild publishes.
llvm-libs joins rebuild_on, so that rebuild starts by itself when
llvm-libs moves, and needs no edit for a new major. With llvmpipe built,
Gallium's draw module also JITs through this LLVM, so on the GPU path
feedback, select and RasterPos under a shader use it too, as in Arch's
mesa.

A frozen compat LLVM (llvm22-libs) next to the system one was tried and
dropped: two LLVM majors can't share a process here. Each libLLVM
exports objects with STB_GNU_UNIQUE binding, which glibc unifies by
name across libraries regardless of symbol version, so libLLVM.so.22.1
bound 111 of its own references to libLLVM.so.23.1's differently laid
out tables. llvmpipe then aborted with LLVM 23 in the process, the
stock Mesa segfaulted with LLVM 22 in it, and the GPU path's draw
module JIT aborted too. Any process that loads lavapipe, rusticl or
another LLVM 23 user next to GL would have crashed.

check() now allows LLVM only in libgallium, exactly one
libLLVM.so.<major>.<minor>, and requires libgallium to be executable,
because makepkg versions the libLLVM.so depend only from executable
files; otherwise it would ship unversioned. It fails on SPIRV-Tools
anywhere, and fails if libgallium doesn't link LLVM at all, so a
libgallium without llvmpipe can't ship unnoticed. The recipe and
metadata tests cover each rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check() found the libLLVM soname with grep piped to sed. For a library
without LLVM the grep exits 1, so under errexit with pipefail the
assignment would abort check(). One sed gives the same result without
depending on shell options. Two LLVM sonames still come out as two
lines, which the anchored match rejects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scottjones
scottjones force-pushed the mesa-aurora-llvmpipe branch from ec3972f to d2edc91 Compare October 29, 2026 11:13
@scottjones

Copy link
Copy Markdown
Contributor Author

Rebased onto master after #1798, now at d2edc91.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scottjones, the rebase is clean. At d2edc91 both of my earlier conditions are met, and there are no code blockers.

  • Against ec3972f, the only change is rebuilt_against, whose llvm-libs is now 23.1.4-1.1. The branch is up to date with master, and pkgver/_commit match the #1798 pin with pkgrel=2.
  • I checked CI's artifact from run 40863665253 myself:
    • mesa-aurora 1:26.3.0_devel.20261029.231476.672657e05e6-2 has depend = libLLVM.so=23.1-64 and was built against llvm-libs-23.1.4-1.1;
    • vulkan-aurora has no LLVM depend.
  • rebuilt_against matches what edge serves, so there won't be a redundant rebuild after merge.

The only thing left is the maintainer decision on the LLVM upgrade hold. Since this edits existing tests under tests/aurora-edge/, it will be merged by hand.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at d2edc91. I accept the LLVM upgrade hold: a refused pacman -Syu after an LLVM major bump is a better failure than a GPU driver that silently stops loading. Whoever qualifies this mesa-aurora for rc or stable checks that the channel's snapshot ships llvm-libs 23.1, until a promote-channel soname guard exists.

@maralcbr
maralcbr merged commit 619bcf7 into omacom:master Oct 29, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: mesa-aurora (aarch64, PR artifact)

  • edge/aarch64: mesa-aurora-1:26.3.0_devel.20261029.231476.672657e05e6-2-aarch64, vulkan-aurora-1:26.3.0_devel.20261029.231476.672657e05e6-2-aarch64

Commit 619bcf7 · run

maralcbr added a commit that referenced this pull request Oct 29, 2026
Moves the qualified mesa-aurora from -1 to -2 (#1711): the same mesa#19
pin, with llvmpipe linked to the system LLVM. It depends on
libLLVM.so=23.1-64, which rc's and stable's llvm-libs 23.1.3-3 provide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mesa-aurora: without a GPU the desktop falls back to softpipe, not llvmpipe

2 participants