-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Wasm bundle for sys crate with FFI exports is empty #63629
Copy link
Copy link
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I'm trying to compile mruby-sys to wasm. mruby-sys builds a C static library using the cc crate. cc generates two wasm files, one of which I can't read with 0000004: error: bad magic value error. The other looks like valid wasm and I can read it with wasm2wat.
crate mruby-sys exports:
- all FFI bindings to
extern "C"functions - several Rust functions that are annotated with
#[inline].
The resulting wasm bundle for mruby-sys is empty:
(module
(type (;0;) (func))
(func $__wasm_call_ctors (type 0))
(table (;0;) 1 1 anyfunc)
(memory (;0;) 17)
(global (;0;) (mut i32) (i32.const 1048576))
(global (;1;) i32 (i32.const 1048610))
(global (;2;) i32 (i32.const 1048610))
(global (;3;) i32 (i32.const 1048576))
(export "memory" (memory 0))
(export "__heap_base" (global 1))
(export "__data_end" (global 2))
(export "__rustc_debug_gdb_scripts_section__" (global 3))
(data (;0;) (i32.const 1048576) "\01gdb_load_rust_pretty_printers.py\00"))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.