Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

C ABI profile — Link-time linking

Platform spec article

C ABI profile — Link-time linking

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

For Standard tier-1 conformance (System V AMD64 ELF hosts), user Extern symbols must be resolved at link time using:

  1. Library strings on contracts (logical names).
  2. Project link manifest metadata (see project link libraries).
  3. Driver-supplied linker inputs from beskid link / build commands and optional foreign library import mapping.

JIT and AOT backends must emit undefined symbols compatible with the platform linker for imports collected in ExternImport.

Link symbols use the method Symbol override when present; otherwise the Beskid method name. Name mangling must not apply to user extern symbols.

Link drivers may enforce BESKID_EXTERN_ALLOW / BESKID_EXTERN_DENY against resolved (library, symbol) pairs before producing a runnable artifact.

Reference JIT paths that relied on runtime dlopen are not the Standard story in v0.3. See dynamic resolution profile for the non-Standard appendix.

AOT object emission must surface the same import set as JIT for a given artifact. Unresolved imports must fail at link time with actionable diagnostics listing missing symbols/libraries.

On Linux tier-1, the AOT driver passes project link.libraries and discovered ExternImport.library values through AotBuildRequest::external_libraries (compiler/crates/beskid_aot/src/api.rs) and appends -l<library> / -L<path> in compiler/crates/beskid_aot/src/linker.rs. The engine consumer merges manifest link metadata in compiler/crates/beskid_engine/src/link_libraries.rs. Verification: compiler/crates/beskid_engine/tests/ffi_v03_link_time.rs::link_time_extern_getpid_matches_platform_spec.