Skip to content

fix(core): avoid GLIBC_2.29 requirement in linux prebuilds - #1065

Merged
simonklee merged 1 commit into
anomalyco:mainfrom
kevinchappell:fix/glibc-compatibility
May 14, 2026
Merged

simonklee merged 1 commit into
anomalyco:mainfrom
kevinchappell:fix/glibc-compatibility

Conversation

@kevinchappell

@kevinchappell kevinchappell commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Pin Linux native prebuild targets to glibc 2.28.

After the native audio change, miniaudio pulls in libm symbols. With
unpinned linux-gnu targets, builds on newer hosts bound against
GLIBC_2.29, preventing the prebuilt library from loading on systems
with older glibc (e.g. RHEL/AlmaLinux 8).

Pinning x86_64-linux-gnu.2.28 and aarch64-linux-gnu.2.28 caps the
maximum referenced symbol version at GLIBC_2.28 while preserving
GNU/glibc dynamic linking. Verified via dlopen(RTLD_NOW) on
AlmaLinux 8 (glibc 2.28) and Ubuntu 18.04 (glibc 2.27)

Pin Linux native prebuild targets to glibc 2.28 instead of using
unpinned linux-gnu targets.

After the native audio change, miniaudio pulls in libm symbols. When
built on newer hosts, the unpinned linux-gnu target can bind against
newer libm symbol versions such as GLIBC_2.29, which prevents the
prebuilt library from loading on RHEL/AlmaLinux 8 systems.

Building with x86_64-linux-gnu.2.28 and aarch64-linux-gnu.2.28 keeps
the GNU/glibc dynamic linking behavior while preserving compatibility
with glibc 2.28 environments.
Copilot AI review requested due to automatic review settings May 14, 2026 08:22
@simonklee
simonklee enabled auto-merge (squash) May 14, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Pins the Linux Zig build targets to a specific glibc baseline to prevent native prebuilds from accidentally requiring newer GLIBC symbol versions (e.g., GLIBC_2.29) when built on newer hosts, improving runtime compatibility on older Linux distributions.

Changes:

  • Pin Linux targets from *-linux-gnu to *-linux-gnu.2.28 in the Zig build target matrix.
  • Add a clarifying comment about unpinned targets picking up newer host GLIBC/libm symbol versions.
  • Update the -Dtarget help text example to use the new pinned target format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +23
// Unpinned linux-gnu targets can bind host libm symbols such as GLIBC_2.29.
const SUPPORTED_TARGETS = [_]SupportedTarget{
.{ .zig_target = "x86_64-linux-gnu", .output_name = "x86_64-linux", .description = "Linux x86_64" },
.{ .zig_target = "aarch64-linux-gnu", .output_name = "aarch64-linux", .description = "Linux aarch64" },
.{ .zig_target = "x86_64-linux-gnu.2.28", .output_name = "x86_64-linux", .description = "Linux x86_64" },
.{ .zig_target = "aarch64-linux-gnu.2.28", .output_name = "aarch64-linux", .description = "Linux aarch64" },

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.

This is technically correct but GLIBC should still resolve to 2.27 on Ubuntu 18.04 instead of being not found.

docker-compose.almalinux_8.yml

$ docker compose -f docker-compose.almalinux_8.yml up
>>>> Executing external compose provider "/home/kevin/.local/bin/podman-compose". Please refer to the documentation for details. <<<<

Error: no container with name or ID "core_test-glibc228_1" found: no such container
Error: no container with ID or name "core_test-glibc228_1" found: no such container
b2192c89d6cb6ebafd3863c1fc0752418501b7f7ec773f802b6b7b9c9cbe5b97
core_default
6d43d158d806585c7198a43ae6de299a608ca078089c2a7953e7bd164ea52e1f
3b3e5896e917cf8f1889080334367f1518f9472434bd8a03399a06acf19a8517
[test-glibc228] | === GLIBC version ===
[test-glibc228] | ldd (GNU libc) 2.28
[test-glibc228] |
[test-glibc228] | === ldd libopentui.so ===
[test-glibc228] |       linux-vdso.so.1 (0x00007a1056ace000)
[test-glibc228] |       libm.so.6 => /lib64/libm.so.6 (0x00007a1055e7e000)
[test-glibc228] |       libpthread.so.0 => /lib64/libpthread.so.0 (0x00007a1055c5e000)
[test-glibc228] |       libc.so.6 => /lib64/libc.so.6 (0x00007a1055888000)
[test-glibc228] |       libdl.so.2 => /lib64/libdl.so.2 (0x00007a1055684000)
[test-glibc228] |       /lib64/ld-linux-x86-64.so.2 (0x00007a1056800000)
[test-glibc228] |
[test-glibc228] | === Required GLIBC symbol versions ===
[test-glibc228] | GLIBC_2.10
[test-glibc228] | GLIBC_2.17
[test-glibc228] | GLIBC_2.2.5
[test-glibc228] | GLIBC_2.27
[test-glibc228] | GLIBC_2.3
[test-glibc228] | GLIBC_2.3.2
[test-glibc228] | GLIBC_2.4
[test-glibc228] | GLIBC_2.7
[test-glibc228] |
[test-glibc228] | === Attempting dlopen + reporting runtime glibc ===
[test-glibc228] | runtime glibc: 2.28
[test-glibc228] |
[test-glibc228] | === SUCCESS: Binary actually loads on GLIBC 2.28 ===

docker-compose.ubuntu-18_04.yml

$ docker compose -f docker-compose.ubuntu-18_04.yml up
>>>> Executing external compose provider "/home/kevin/.local/bin/podman-compose". Please refer to the documentation for details. <<<<

core_test-glibc227_1
core_test-glibc227_1
3d33819ae2b9cd6a17d64477fc27eef628d1b4b722cceca80c4fd387ac639abf
core_default
b2192c89d6cb6ebafd3863c1fc0752418501b7f7ec773f802b6b7b9c9cbe5b97
804408ecbb0fa40135486d3563ea507e692238d05cc00e9c42073f916f5212f0
[test-glibc227] | debconf: delaying package configuration, since apt-utils is not installed
[test-glibc227] | === GLIBC version ===
[test-glibc227] | ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
[test-glibc227] |
[test-glibc227] | === ldd libopentui.so ===
[test-glibc227] |       linux-vdso.so.1 (0x000078abeb8f5000)
[test-glibc227] |       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000078abeac62000)
[test-glibc227] |       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x000078abeaa43000)
[test-glibc227] |       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000078abea652000)
[test-glibc227] |       libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000078abea44e000)
[test-glibc227] |       /lib64/ld-linux-x86-64.so.2 (0x000078abeb600000)
[test-glibc227] |
[test-glibc227] | === Required GLIBC symbol versions ===
[test-glibc227] | GLIBC_2.10
[test-glibc227] | GLIBC_2.17
[test-glibc227] | GLIBC_2.2.5
[test-glibc227] | GLIBC_2.27
[test-glibc227] | GLIBC_2.3
[test-glibc227] | GLIBC_2.3.2
[test-glibc227] | GLIBC_2.4
[test-glibc227] | GLIBC_2.7
[test-glibc227] |
[test-glibc227] | === Attempting dlopen + reporting runtime glibc ===
[test-glibc227] | runtime glibc: 2.27
[test-glibc227] |
[test-glibc227] | === SUCCESS: Binary actually loads on GLIBC 2.27 ===

@simonklee
simonklee merged commit 80f22b4 into anomalyco:main May 14, 2026
20 of 21 checks passed
@kevinchappell
kevinchappell deleted the fix/glibc-compatibility branch May 14, 2026 20:17
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.

3 participants