This website requires JavaScript.
About
Status
₊˚⊹Discord
Explore
Register
Sign in
Reference in a new issue
Blame
Copy permalink
Reference in a new issue
Copy permalink
DKB
/
zml
Star
0
Fork
You've already forked zml
0
mirror of
https://github.com/zml/zml.git
synced
2026-11-16 19:11:09 +00:00
Code
Issues
23
Releases
1
Packages
Activity
raphael/decoder-buffer
zml
/
bazel
/
runfiles_init.c
15 lines
776 B
Raw
Permalink
Normal View
History
bazel: register runfiles initialization from C (#1005) ZML initializes runfiles before `main` so its loaders can locate packaged libraries and data. When using `-fno-llvm -fincremental` and linking with the incremental ELF linker, declaring the registration pointer in Zig produces incorrect `.init_array` data. See https://codeberg.org/ziglang/zig/issues/37453 Use a C constructor on Linux and macOS so the C compiler emits the platform-specific startup registration, while Zig exports the existing runfiles initialization function directly. We can revert when https://codeberg.org/ziglang/zig/issues/37453 is fixed. With this fix, we bypass the wrong behavior in incremental ELF linker and get closer to ZML compliance with zig incremental using their incremental linker. The registration is shared by the `use_cc_common_link=true` and `false` paths. Keep the explicit linker retention so the constructor is included even when its object is in a static archive.
2026-11-03 22:45:23 +09:00