fix(build): prefer llvm-nm for symbol version checks #2087

Merged
HumanBean merged 2 commits from 0xadb/Longshot:fix/linux-versioned-nm-imports into main 2026-11-21 17:00:28 +00:00
Contributor

Summary

On openSUSE, GNU nm omits libc symbol version suffixes in the import output used by the VK symbol check. The build then treats valid libc imports as unresolved and stops with hundreds of false errors. Prefer llvm-nm when available, retaining GNU nm as the fallback. The added regression test covers both tool selection and fallback behavior. See #267 for an earlier, broader readelf-first approach to the same symbol-version issue; this PR records the successful launcher build using llvm-nm.

Testing

Tested: openSUSE Tumbleweed-Slowroll, NVIDIA GeForce RTX 4090, NVIDIA 620.70.06: built the stable v3.0.0 game with llvm-nm selected, then launched it successfully. The launcher build completed and the game process started.

Still to test:

  • Other Linux distributions/toolchain combinations: run the VK symbol check and build, expecting the preferred tool or GNU fallback to recognize imports correctly (by hand).
  • Full mise run test suite: rerun on this branch and current main to identify pre-existing failures (by hand).

Focused regression test: python3 -I -B tests/test_vk_symbol_check.py (2 tests passed). The regression test was also run against current main and reproduced the false unresolved malloc import.

Measurements

Verdict: no runtime or performance change; this only selects which symbol-inspection utility runs during the build. The regression test reproduces the false positive on main and passes with this fix.

Before: main @ 1dbf91508e After: this PR @ c5da5834
VK symbol check Falsely reports versioned libc import malloc unresolved with GNU nm output Uses llvm-nm output preserving malloc@GLIBC_2.2.5; GNU nm remains a fallback

Risks

The build uses llvm-nm when installed; systems without it continue using nm. The selected utility only affects the build-time symbol check. It does not change game code, output binaries, saves, options or runtime behavior. If a platform's llvm-nm output differs unexpectedly, the regression check will need to be adjusted for that supported output.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary On openSUSE, GNU `nm` omits libc symbol version suffixes in the import output used by the VK symbol check. The build then treats valid libc imports as unresolved and stops with hundreds of false errors. Prefer `llvm-nm` when available, retaining GNU `nm` as the fallback. The added regression test covers both tool selection and fallback behavior. See #267 for an earlier, broader `readelf`-first approach to the same symbol-version issue; this PR records the successful launcher build using `llvm-nm`. ## Testing **Tested:** openSUSE Tumbleweed-Slowroll, NVIDIA GeForce RTX 4090, NVIDIA 620.70.06: built the stable v3.0.0 game with `llvm-nm` selected, then launched it successfully. The launcher build completed and the game process started. **Still to test:** - Other Linux distributions/toolchain combinations: run the VK symbol check and build, expecting the preferred tool or GNU fallback to recognize imports correctly (by hand). - Full `mise run test` suite: rerun on this branch and current `main` to identify pre-existing failures (by hand). Focused regression test: `python3 -I -B tests/test_vk_symbol_check.py` (2 tests passed). The regression test was also run against current `main` and reproduced the false unresolved `malloc` import. ## Measurements Verdict: no runtime or performance change; this only selects which symbol-inspection utility runs during the build. The regression test reproduces the false positive on `main` and passes with this fix. | | Before: main @ 1dbf91508e9c4d0b24c2c6c28b7dc7415d37606f | After: this PR @ c5da5834 | |---|---|---| | VK symbol check | Falsely reports versioned libc import `malloc` unresolved with GNU `nm` output | Uses `llvm-nm` output preserving `malloc@GLIBC_2.2.5`; GNU `nm` remains a fallback | ## Risks The build uses `llvm-nm` when installed; systems without it continue using `nm`. The selected utility only affects the build-time symbol check. It does not change game code, output binaries, saves, options or runtime behavior. If a platform's `llvm-nm` output differs unexpectedly, the regression check will need to be adjusted for that supported output. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
fix(build): prefer llvm-nm for symbol version checks
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
ed2860e554
Author
Contributor

Tested in game: openSUSE Tumbleweed-Slowroll, NVIDIA GeForce RTX 4090, NVIDIA 620.70.06: Launcher stable v3.0.0 build completed with llvm-nm selected, and the game process started successfully.

Tested in game: openSUSE Tumbleweed-Slowroll, NVIDIA GeForce RTX 4090, NVIDIA 620.70.06: Launcher stable v3.0.0 build completed with llvm-nm selected, and the game process started successfully.
Member

Possibly related, for context:

  • PR #267 WIP: fix(build): preserve runtime symbol versions in the Linux renderer check — Overlapping Linux symbol-check fix
Possibly related, for context: - PR #267 WIP: fix(build): preserve runtime symbol versions in the Linux renderer check — Overlapping Linux symbol-check fix
0xadb force-pushed fix/linux-versioned-nm-imports from ed2860e554
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to c5da58344d
Some checks failed
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 4s
2026-11-21 16:26:17 +00:00
Compare
HumanBean changed title from WIP: fix(build): prefer llvm-nm for symbol version checks to fix(build): prefer llvm-nm for symbol version checks 2026-11-21 17:00:22 +00:00
HumanBean deleted branch fix/linux-versioned-nm-imports 2026-11-21 17:00:28 +00:00
Some checks failed
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 4s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2087
No description provided.