bytecodealliance / lucet

Lucet, the Sandboxing WebAssembly Compiler.
Apache License 2.0
4.06k stars 164 forks source link

Rust runtime is unable to find symbol "main" of Hello World example #598

Closed goldkehlchen closed 3 years ago

goldkehlchen commented 3 years ago

I am currently trying to run the Hello World example from the documentation in the Rust runtime example. All tools are built from the current revision of the main branch.

Although running with lucet-wasi yields no errors ...

$ wasm32-wasi-clang -Ofast -o hello.wasm hello.c
$ lucetc-wasi -o hello.so hello.wasm
$ lucet-wasi hello.so
Hello world

my attempts at running the same .so file in the Rust runtime fails.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SymbolNotFound("main")', src/main.rs:17:31

Is there anything I might have missed?

jedisct1 commented 3 years ago

The documentation is not up to date.

In the Rust code, you should call the function named _start().