Skip to content

Commit e929ce7

Browse files
alexcrichtonbongjunj
authored andcommitted
Build C API release artifacts with unwind tables (bytecodealliance#11383)
In bytecodealliance#11344 it was found that if Wasmtime had a frame on the stack then an application's previous unwinding was broken. This was due to the fact that Wasmtime's C API artifacts do not have unwind information built-in due to being build with `-Cpanic=abort`. This change updates to building the C API artifacts with `-Cforce-unwind-tables` even though Rust itself won't use them to assist with embedders that want to unwind. These should in theory be easily strippable if desired and additionally embedders always have the option to build their own version of the C API too. Closes bytecodealliance#11344
1 parent a056081 commit e929ce7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ci/build-release-artifacts.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ fi
7171

7272
cargo build --release $flags --target $target -p wasmtime-cli $bin_flags --features run
7373

74+
# For the C API force unwind tables to be emitted to make the generated objects
75+
# more flexible. Embedders can always build without this but this enables
76+
# libunwind to produce better backtraces by default when Wasmtime is linked into
77+
# a different project that wants to unwind.
78+
export RUSTFLAGS="$RUSTFLAGS -C force-unwind-tables"
79+
7480
mkdir -p target/c-api-build
7581
cd target/c-api-build
7682
cmake \

0 commit comments

Comments
 (0)