mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-16 05:00:59 +08:00
* feat: support multi-instance library mode via runtime symbol localization - Add the abi.localize_runtime profile field: the archive build combines the program object with exactly the runtime/vendor members it reaches and demotes every external definition except the profile-declared symbols to a local symbol (darwin: one ld -r pass with -exported_symbols_list; linux: ld -r then objcopy --keep-global-symbols) - N archives built under pairwise-distinct prefixes now link into one process with no symbol collisions and no shared mutable runtime state: each instance owns a private copy of the allocator, collector, result arena, and panic sink, so sinks register per instance and a trap poisons only the instance it fired in - Document the embedder contract beside the profile spec: one thread per instance (an instance is never entered from two threads), and values cross instances only through the embedder's own byte/record marshalling - Refuse cross-target localized builds with SC3002 (the step runs the host toolchain's ld/objcopy over host-format objects); absent or false keeps the classic single-archive artifact byte-for-byte - Add the two-instance acceptance probe (two archives, two embedder threads, independent collects, a trap delivered to its own sink exactly once while the other instance keeps answering) plus symbol-exactness, profile-shape, and target-posture suites, and schedule the artifact contracts on the gate host * fix: tighten runtime localization validation * fix: harden localized library publication
19 lines
506 B
JSON
19 lines
506 B
JSON
{
|
|
"profile_format": 1,
|
|
"name": "conformance-multi-b",
|
|
"entry": "lib_b.ts",
|
|
"emission": "llvm",
|
|
"abi": {
|
|
"prefix": "mb_",
|
|
"init_symbol": "mb_init",
|
|
"sink_register_symbol": "mb_set_panic_sink",
|
|
"collect_symbol": "mb_collect",
|
|
"result_reset_symbol": null,
|
|
"localize_runtime": true
|
|
},
|
|
"exports": [
|
|
{ "export": "sumTo", "symbol": "mb_sum_to", "params": ["f64"], "returns": "f64" },
|
|
{ "export": "add", "symbol": "mb_add", "params": ["f64"], "returns": "f64" }
|
|
]
|
|
}
|