Apply the rest of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4279 to fix the build for real. I've verified that this builds for armv7 on edge.
Taken from upstream. Our mesa-git is pretty outdated, we should update it soon. But we need to unblock the repository first, so this is the fastest way for now.