Skip to content

Fix emscripten build warning and add missing export #2367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why drop the VERBOSE=1 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just VERBOSE level trace is not quite necessary in most cases, because build warning and error show by default. VERBOSE level trace some time makes warning and error message not quite visible inside a large mount of text.
But it's not a big issue, I can also add it back. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In think as long as we have -DWERROR=ON when its probably find to keep verbose build output when building during CI


wasi:
name: wasi
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion src/c-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions wasm2c/wasm-rt-impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithw @shravanrn WDYT about this change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this should be fine assuming the existing tests pass.


#if WASM_RT_INSTALL_SIGNAL_HANDLER
static void os_signal_handler(int sig, siginfo_t* si, void* unused) {
Expand Down