diff --git a/Makefile b/Makefile index 171ac2f..21226a0 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ TARGET = sqlite3 CC = /bin/clang SYSROOT = /share/wasi-sysroot TARGET_TRIPLE = wasm32-wasi -CFLAGS = -nostartfiles -fvisibility=hidden +CFLAGS = -fvisibility=hidden SDK = sdk/logger.h -LDFLAGS = -Wl,--no-entry,--demangle,--allow-undefined +LDFLAGS = -Wl,--demangle,--allow-undefined EXPORT_FUNCS = \ --export=allocate,$\ --export=deallocate,$\ diff --git a/src/wrapper.c b/src/wrapper.c index a249677..8158d9a 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -27,3 +27,8 @@ int get_result_size(void) { const char *get_result_ptr() { return RESULT_PTR; } + +int main() { + // the main purpose of this empty main is to initialize WASi subsystem + return 0; +} \ No newline at end of file