From c6e4a30f406c21f4f291994467e5fd05519a5174 Mon Sep 17 00:00:00 2001 From: vms Date: Thu, 4 Mar 2021 14:04:48 +0300 Subject: [PATCH] enable WASI --- Makefile | 4 ++-- src/wrapper.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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