Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/out.txt text eol=lf
*.ll text eol=lf
*.sh text eol=lf
dev/patches/wamr-*.patch text eol=lf
_demo/go/export/libexport.h.want text eol=lf
13 changes: 11 additions & 2 deletions dev/build_iwasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ IWASM_BUILD_ID=$(
"${LLGO_WINDOWS_ABI:-}" "${MINGW_PREFIX:-}" "${CC:-}" "${CXX:-}" \
"$(git hash-object "${SCRIPT_DIR}/build_iwasm.sh")" \
"$(git hash-object "${SCRIPT_DIR}/patches/wamr-2.4.5-threaded-eh.patch")" \
"$(git hash-object "${SCRIPT_DIR}/patches/wamr-2.4.5-classic-simd.patch")" \
"$(git hash-object "${SCRIPT_DIR}/patches/wamr-2.4.5-posix-signal.patch")" \
"$(git hash-object "${SCRIPT_DIR}/patches/wamr-2.4.5-mingw.patch")" \
| git hash-object --stdin
Expand Down Expand Up @@ -55,14 +56,20 @@ trap 'rm -rf "${TEMP_DIR}"' EXIT
cd "${TEMP_DIR}"

echo "Cloning wasm-micro-runtime ${WAMR_VERSION}..."
git clone --branch "${WAMR_VERSION}" --depth 1 https://github.com/wasm-micro-runtime/wasm-micro-runtime.git
# Keep source line endings aligned with the LF patches on Windows as well.
git -c core.autocrlf=false -c core.eol=lf clone \
--branch "${WAMR_VERSION}" --depth 1 https://github.com/wasm-micro-runtime/wasm-micro-runtime.git

# Keep exception propagation within one interpreter thread until it escapes
# the Wasm invocation. Otherwise a caught longjmp can terminate sibling Gs.
git -C wasm-micro-runtime apply \
"${SCRIPT_DIR}/patches/wamr-2.4.5-threaded-eh.patch"
git -C wasm-micro-runtime apply \
"${SCRIPT_DIR}/patches/wamr-2.4.5-posix-signal.patch"
# Keep legacy EH and pthreads on the classic interpreter, and reuse WAMR's
# SIMDe-backed SIMD operations with its value stack and bytecode decoder.
git -C wasm-micro-runtime apply \
"${SCRIPT_DIR}/patches/wamr-2.4.5-classic-simd.patch"

CMAKE_GENERATOR_ARGS=()
case "$(uname -s)" in
Expand Down Expand Up @@ -146,10 +153,12 @@ cd wasm-micro-runtime/product-mini/platforms/${PLATFORM}/build
# generated modules require reference-types support. WAMR 2.4.5's debug
# interpreter leaves a termination signal after a caught Wasm exception;
# a later branch then aborts LLVM's SjLj path for Go panic/recover.
cmake "${CMAKE_GENERATOR_ARGS[@]}" \
# The conditional expansion also works with nounset on macOS's Bash 3.2.
cmake ${CMAKE_GENERATOR_ARGS[@]+"${CMAKE_GENERATOR_ARGS[@]}"} \
-D WAMR_BUILD_EXCE_HANDLING=1 \
-D WAMR_BUILD_AOT=0 \
-D WAMR_BUILD_FAST_INTERP=0 \
-D WAMR_BUILD_SIMD=1 \
-D WAMR_BUILD_REF_TYPES=1 \
-D WAMR_BUILD_SHARED_MEMORY=1 \
-D WAMR_BUILD_LIB_WASI_THREADS=1 \
Expand Down
Loading
Loading