22 lines
891 B
C
22 lines
891 B
C
|
|
// hako_llvmc_ffi.c — Minimal FFI bridge that forwards to hako_aot.c
|
||
|
|
// Exports functions that hako_aot.c dlopens when HAKO_AOT_USE_FFI=1.
|
||
|
|
// Initial implementation simply delegates to the shell-based AOT helpers.
|
||
|
|
|
||
|
|
#include <stddef.h>
|
||
|
|
|
||
|
|
// hako_aot.h provides hako_aot_compile_json / hako_aot_link_obj
|
||
|
|
#include "../include/hako_aot.h"
|
||
|
|
|
||
|
|
// Exported symbols expected by hako_aot.c when loading libhako_llvmc_ffi.so
|
||
|
|
// Signature must match: int (*)(const char*, const char*, char**)
|
||
|
|
__attribute__((visibility("default")))
|
||
|
|
int hako_llvmc_compile_json(const char* json_in, const char* obj_out, char** err_out) {
|
||
|
|
return hako_aot_compile_json(json_in, obj_out, err_out);
|
||
|
|
}
|
||
|
|
|
||
|
|
__attribute__((visibility("default")))
|
||
|
|
int hako_llvmc_link_obj(const char* obj_in, const char* exe_out, const char* extra_ldflags, char** err_out) {
|
||
|
|
return hako_aot_link_obj(obj_in, exe_out, extra_ldflags, err_out);
|
||
|
|
}
|
||
|
|
|