summaryrefslogtreecommitdiffhomepage
path: root/.agents/rules/link-order.md
blob: 466f6b3fb4237ca2a161a7411c7dad5da394c779 (plain)
1
2
3
4
5
6
7
8
9
10
# RULE: link order — libmruby.a first

`libmruby.a` contains the `Rl::`/`Rml::`/`Flecs::` binding objects, which
reference symbols in libraylib.a, librmlui.a, and libflecs.a. So libmruby.a must
come **before** those native libs on the link line (it does, in `build.zig` and
`build_web.sh`). Getting this wrong = "undefined reference" at final link.

C++/unwinder note: link `/usr/lib/libstdc++.so` and `/usr/lib/libgcc_s.so.1`
directly. Do NOT use `linkSystemLibrary("stdc++")` — zig 0.16 substitutes its own
LLVM libc++ (wrong ABI; RmlUi/mruby-cxx-exceptions need GNU libstdc++).