diff options
author | Changqing Jing <changqing.jing@bmw.com> | 2024-01-20 13:30:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 21:30:47 -0800 |
commit | cb76e5cd81312e4dba52a06cfc6bc35f795e05bb (patch) | |
tree | abc6a7e805c72b0f0f7f0123c53d45e2f4d82c3f | |
parent | 0c3b5ac16daf929ca018ad3cdac08123b4d2bedc (diff) | |
download | wabt-cb76e5cd81312e4dba52a06cfc6bc35f795e05bb.tar.gz wabt-cb76e5cd81312e4dba52a06cfc6bc35f795e05bb.tar.bz2 wabt-cb76e5cd81312e4dba52a06cfc6bc35f795e05bb.zip |
Fix emscripten build warning and add missing export (#2367)
-rw-r--r-- | .github/workflows/build.yml | 5 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/c-writer.cc | 2 | ||||
-rw-r--r-- | wasm2c/wasm-rt-impl.c | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b086ccf..cf0b710f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,8 +78,9 @@ jobs: run: | docker run -di --name emscripten -v $(pwd):/src emscripten/emsdk:latest bash docker exec emscripten emcc -v - docker exec emscripten emcmake cmake . - docker exec emscripten make -j 2 VERBOSE=1 + docker exec emscripten emcmake cmake -B emscripten -DWERROR=ON + docker exec -w /src/emscripten emscripten make -j $(nproc) + wasi: name: wasi runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 63f971f7..5b90b50b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -823,6 +823,7 @@ if (EMSCRIPTEN) -sMODULARIZE=1 -sEXPORT_NAME=WabtModule -sWASM=0 + -sEXPORTED_RUNTIME_METHODS=writeAsciiToMemory -Oz ) string(REPLACE ";" " " LIBWABT_LINK_FLAGS_STR "${LIBWABT_LINK_FLAGS}") diff --git a/src/c-writer.cc b/src/c-writer.cc index 0a7cfe3a..0326c886 100644 --- a/src/c-writer.cc +++ b/src/c-writer.cc @@ -1633,7 +1633,7 @@ void CWriter::SerializeFuncType(const FuncType& func_type, *next_byte++ = MangleType(func_type.GetResultType(i)); } - assert(next_byte - mangled_signature == len); + assert(next_byte - mangled_signature == static_cast<ptrdiff_t>(len)); // step 4: SHA-256 the whole string sha256({mangled_signature, len}, serialized_type); diff --git a/wasm2c/wasm-rt-impl.c b/wasm2c/wasm-rt-impl.c index 09a28726..57bd74cf 100644 --- a/wasm2c/wasm-rt-impl.c +++ b/wasm2c/wasm-rt-impl.c @@ -148,6 +148,7 @@ static void os_cleanup_signal_handler(void) { #endif #else +#if WASM_RT_USE_MMAP static void* os_mmap(size_t size) { int map_prot = PROT_NONE; int map_flags = MAP_ANONYMOUS | MAP_PRIVATE; @@ -168,6 +169,7 @@ static int os_mprotect(void* addr, size_t size) { static void os_print_last_error(const char* msg) { perror(msg); } +#endif #if WASM_RT_INSTALL_SIGNAL_HANDLER static void os_signal_handler(int sig, siginfo_t* si, void* unused) { |