Skip to content

Linux linking - #10

Open
lucasw wants to merge 3 commits into
SecondHalfGames:mainfrom
lucasw:linux_linking
Open

Linux linking#10
lucasw wants to merge 3 commits into
SecondHalfGames:mainfrom
lucasw:linux_linking

Conversation

@lucasw

@lucasw lucasw commented Aug 29, 2025

Copy link
Copy Markdown

I've got linux building with a build.rs per hello world, and also cargo test needs linking to happen right where I've moved it to (not sure why).

Fixes #9 and #5

@lucasw

lucasw commented Aug 29, 2025

Copy link
Copy Markdown
Author

I thought maybe a PR would override the github action restriction on only running on main, but given it doesn't there's another very similar branch modified to do actions on all branches that shows success: https://github.com/lucasw/jolt-rust/actions/runs/17313804077

@5unekku

5unekku commented Jun 8, 2026

Copy link
Copy Markdown

the link order fix (joltc before Jolt) and lib64 search path are now in main. the hello-world build.rs additions weren't needed since joltc-sys handles linking for downstream crates. closing in favor of the direct fix.

Bantarus added a commit to Bantarus/jolt-rust that referenced this pull request Jun 22, 2026
Fork of SecondHalfGames/jolt-rust@40c3aac with JoltPhysics v5.3.0
submodule for xtreme-game-engine v0.22 (E13 engine-plugin-physics).
This is the Step 1 build-spike deliverable: prove the floor of the
deterministic Jolt stack on WSL2 Linux Clang 18, then carry the
engine-side patches the engine workspace consumes via path-dep.

Two day-one patches (documented in vendor.diff.md):

(1) cross-platform-deterministic cargo feature on joltc-sys plumbs
through to JoltPhysics's CMake CROSS_PLATFORM_DETERMINISTIC=ON
(via CMake subdirectory-scope inheritance:
JoltC/CMakeLists.txt:83 add_subdirectory + Build/CMakeLists.txt:547).
Mirrors the flag into bindgen with -DJPH_CROSS_PLATFORM_DETERMINISTIC=1
so header parsing matches compiled lib layout. Verified via
CMakeCache.txt CROSS_PLATFORM_DETERMINISTIC:BOOL=ON.

(2) build.rs check_no_fast_math() panics if CFLAGS / CXXFLAGS /
RUSTFLAGS / CARGO_ENCODED_RUSTFLAGS contain -ffast-math or
-march=native. Both enable FMA contraction and silently break
cross-platform determinism. Other layers don't catch this.

Notes on patches NOT applied:
- Linux undefined-references fix (joltc-sys issues SecondHalfGames#5/SecondHalfGames#9/SecondHalfGames#10): the
  baseline build succeeded cleanly on WSL2 Linux Clang 18 with no
  patches. The issues apparently landed upstream between when the
  engine v0.22 synthesis ran and this spike.
- JoltPhysics version bump to 5.3.0: not needed -- the joltc-sys
  0.3.1 submodule already resolves to JoltPhysics v5.3.0 (the
  joltc-sys 0.3.1 "+Jolt-5.0.0" semver build-metadata is just stale).

Two new crates added:
- crates/joltc-sys/examples/hello_jolt.rs: the deterministic 10-box
  drop smoke. Drops 10 dynamic boxes onto a static floor, runs 64
  ticks at dt=1/64 substeps=1 on JPC_JobSystemSingleThreaded, then
  runs the same simulation a SECOND time and asserts bit-identical
  positions. Run: `cargo run -p joltc-sys --release --example
  hello_jolt --features cross-platform-deterministic`. Output:
  "determinism OK -- run A and run B are bit-identical across all
  10 bodies". This is the floor of v0.22's determinism contract,
  proven on WSL2 Linux. Cross-platform validation (Win-MSVC /
  macOS-ARM64) defers to the 4090 relay per engine Rule 16.
- crates/engine-jolt/ skeleton: Bevy-agnostic safe wrapper, empty
  for now (the actual surface -- World, drive_step, ShapeDef,
  ContactSink, WorldSnapshot -- lands in v0.22 Step 2). Feature
  graph wired: default = []; native = [dep:joltc-sys];
  cross_deterministic = [native, joltc-sys/cross-platform-deterministic];
  double_precision / object_layer_u32 / asserts pass through.
  Exists at Step 1 so engine-plugin-physics' path-dep can resolve
  during Step 3's plugin-skeleton work. Lints clippy::needless_update
  + new_without_default match rolt's tolerances.

Verifications: cargo check -p engine-jolt 2.86s clean (stub mode,
no C++); cargo build -p engine-jolt --release --features
cross_deterministic 17s clean; cargo test -p engine-jolt --features
cross_deterministic feature_flags_consistent passes;
cargo run -p joltc-sys --release --example hello_jolt --features
cross-platform-deterministic determinism OK across two runs.

vendor.diff.md documents both patches with re-apply checklists for
quarterly subtree pulls.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

linux build fails with manty undefined references

2 participants