Skip to content

Add exception-handling and shared-memory feature flags#178

Open
jurgelenas wants to merge 1 commit intobytecodealliance:mainfrom
jurgelenas:exception-handling-and-shared-memory
Open

Add exception-handling and shared-memory feature flags#178
jurgelenas wants to merge 1 commit intobytecodealliance:mainfrom
jurgelenas:exception-handling-and-shared-memory

Conversation

@jurgelenas
Copy link
Copy Markdown

@jurgelenas jurgelenas commented Mar 15, 2026

Fix WASI path pointer cast and add new feature flags.

Fix a bug in set_wasi_context where Vec was cast directly to *const c_char. CString is a 24-byte struct, not an 8-byte pointer, so WAMR received garbage pointers for preopened directory paths, causing segfaults in os_realpath during module instantiation.

The fix collects CString pointers into a separate Vec<*const c_char> stored on the Module struct, matching how env and args are already handled.

New configurable feature flags:

  • exception-handling: WAMR_BUILD_EXCE_HANDLING
  • shared-memory: WAMR_BUILD_SHARED_MEMORY + WAMR_BUILD_THREAD_MGR
  • wasi-threads: WAMR_BUILD_LIB_WASI_THREADS (implies shared-memory)
  • fast-interp: WAMR_BUILD_FAST_INTERP

Also makes wamrc (AOT compiler) build conditional on the llvmjit feature, so users without LLVM can build for interpreter-only use.

@jurgelenas jurgelenas force-pushed the exception-handling-and-shared-memory branch 2 times, most recently from b91ba01 to 2d2c631 Compare March 15, 2026 13:51
Fix a bug in set_wasi_context where Vec<CString> was cast directly
to *const c_char. CString is a 24-byte struct, not an 8-byte pointer,
so WAMR received garbage pointers for preopened directory paths,
causing segfaults in os_realpath during module instantiation.

The fix collects CString pointers into a separate Vec<*const c_char>
stored on the Module struct, matching how env and args are already
handled.

New configurable feature flags:
- exception-handling: WAMR_BUILD_EXCE_HANDLING
- shared-memory: WAMR_BUILD_SHARED_MEMORY + WAMR_BUILD_THREAD_MGR
- wasi-threads: WAMR_BUILD_LIB_WASI_THREADS (implies shared-memory)
- fast-interp: WAMR_BUILD_FAST_INTERP

Also makes wamrc (AOT compiler) build conditional on the llvmjit
feature, so users without LLVM can build for interpreter-only use.
@jurgelenas jurgelenas force-pushed the exception-handling-and-shared-memory branch from 171dca2 to 9de5c85 Compare March 15, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant