Skip to content

fix(jolt): disable IPO so libJolt.a links on Linux/GCC (#44)#47

Merged
proggeramlug merged 1 commit intomainfrom
fix/jolt-linux-lto-44
May 1, 2026
Merged

fix(jolt): disable IPO so libJolt.a links on Linux/GCC (#44)#47
proggeramlug merged 1 commit intomainfrom
fix/jolt-linux-lto-44

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

  • Disables INTERPROCEDURAL_OPTIMIZATION in bloom_jolt's CMake config. Rust's link step on Linux routes through rust-lld which doesn't load gcc's lto-wrapper plugin, so libJolt.a's GIMPLE-bytecode archive members leave JPH::Free, BodyManager locks, vtables, etc unresolved at the final link.
  • Fixes a misnamed Jolt option: PROFILE_ENABLED is not a real Jolt CMake variable. Jolt's actual options are PROFILER_IN_DEBUG_AND_RELEASE and PROFILER_IN_DISTRIBUTION. The previous setting was a no-op, so Jolt was being built with the profiler ON despite the "no profile" intent. Same cleanup applied to DEBUG_RENDERER_IN_DISTRIBUTION.

Why Linux only

macOS Apple Clang produces LTO archives that Apple's linker handles transparently — that's why local macOS builds and the macOS CI job pass. The failure mode is specific to GCC's GIMPLE bitcode + a non-GCC-driven linker, which is exactly what the Rust toolchain does on Ubuntu.

Closes #44.

Test plan

  • cargo test --release in native/shared/ still green on macOS (66 passed locally)
  • CI's shared-tests (ubuntu-22.04) job goes green
  • CI's shared-tests (windows-latest) job stays green
  • CI's build-linux job goes green

Rust's link step routes through rust-lld on Linux, which doesn't load gcc's
lto-wrapper plugin. With INTERPROCEDURAL_OPTIMIZATION=ON, libJolt.a archive
members are GIMPLE bitcode and rust-lld leaves their implementations
unresolved — JPH::Free, BodyManager locks, vtables, etc all come up
undefined. macOS Apple Clang handles LTO archives transparently which is
why macOS was unaffected.

Also fix the Jolt option name typo: PROFILE_ENABLED is not a Jolt CMake
option (Jolt expects PROFILER_IN_DEBUG_AND_RELEASE / PROFILER_IN_DISTRIBUTION),
so the comment claiming "no profile" was a no-op and Jolt was actually being
built with the profiler enabled. Same for DEBUG_RENDERER_IN_DISTRIBUTION,
now explicitly forced off.
@proggeramlug proggeramlug merged commit a838551 into main May 1, 2026
8 checks passed
@proggeramlug proggeramlug deleted the fix/jolt-linux-lto-44 branch May 1, 2026 08:07
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.

Jolt linker errors on Linux: undefined JPH symbols

1 participant