-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Description
Code
fn main() {}:/
Meta
I'm building rustc on the current master (bcd0683) with LLVM assertions enabled. I'm compiling the program above like this:
RUSTFLAGS="-C panic=unwind" cargo +stage1 build --target wasm32-wasip1 -Z build-std
I'm using the 23.0 WASI sysroot, downloaded from their GitHub releases, if that matters.
Error output
rustc: /checkout/src/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1378: void mapWasmLandingPadIndex(MachineBasicBlock *, const CatchPadInst *): Assertion `IntrFound && "wasm.landingpad.index intrinsic not found!"' failed.
like, everywhere, on all sorts of standard crates like libc and unwind.
Disabling assertions hides the bug, and user code works fine. This also does not reproduce on rustup's nightly, probably for the same reason. I have no idea, really. Please tell me I'm doing something wrong.
For context, this seems more important because Emscripten is supposed to switch to Wasm exceptions soon-ish, and I imagine the same problem occurs there (but I haven't checked). Unlike wasm32-wasip1, unwinding is enabled there by default.
@rustbot label +A-LLVM