996ccs added the bug label to Issue #7877.
996ccs added the cranelift label to Issue #7877.
996ccs opened issue #7877:
Thanks for filing an issue! Please fill out the TODOs below.
.clif
Test CaseTODO: paste .clif test case here. Ideally, a test case that has been reduced via the `clif-util bugpoint` command.
Steps to Reproduce
An error occurs when the c++ column in the examples/ directory is run
- TODO: First, ...
- TODO: Then, ...
- Etc...
Expected Results
TODO: What do you expect to happen?
Code compile throughActual Results
Undefined symbols for architecture arm64:
"_wasm_byte_vec_delete", referenced from:
(anonymous namespace)::compile_wat_module_from_file(wasm_engine_t*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in async-63399a.o
(anonymous namespace)::exit_with_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, wasmtime_error, wasm_trap_t) in async-63399a.o
TODO: What actually happens? Panic? Segfault? Incorrect result?Versions and Environment
Cranelift version or commit: TODO
Operating system: TODO
mac os 13.4
Architecture: TODOExtra Info
Anything else you'd like to add?
alexcrichton commented on issue #7877:
Thanks for the report, but can you fill out some more of the issue template? For example how do we reproduce this? You've pasted a linker-generated error but that could happen from a whole manner of causes. This could be as simple as a missing
-lwasmtime
on the linker command line and something as complex as the wrong version of the library being used.
996ccs commented on issue #7877:
Thanks for the report, but can you fill out some more of the issue template? For example how do we reproduce this? You've pasted a linker-generated error but that could happen from a whole manner of causes. This could be as simple as a missing
-lwasmtime
on the linker command line and something as complex as the wrong version of the library being used.Thank you for your reply.
I was under the https://github.com/bytecodealliance/wasmtime-cpp warehouse will include directory header file complete and implement a c + + examples/arg, 20 \ cc - STD = c + +
-I ./include \
-I ./include \
-lpthread -ldl -lm \
-o fuel
Then the compiler reported an error, the error message is as follows:
Undefined symbols for architecture arm64:
"_wasm_byte_vec_delete", referenced from:
__ZNK8wasmtime5Error7messageB5cxx11Ev in ccjBPpoF.o
__ZN8wasmtime8wat2wasmESt17basic_string_viewIcSt11char_traitsIcEE in ccjBPpoF.o
__ZNK8wasmtime4Trap7messageB5cxx11Ev in ccjBPpoF.o
"_wasm_config_delete", referenced from:...
996ccs edited a comment on issue #7877:
Thanks for the report, but can you fill out some more of the issue template? For example how do we reproduce this? You've pasted a linker-generated error but that could happen from a whole manner of causes. This could be as simple as a missing
-lwasmtime
on the linker command line and something as complex as the wrong version of the library being used.Thank you for your reply.
I was under the https://github.sheincorp.cn/bytecodealliance/wasmtime-cpp repository will include directory header file complete and implement a c + + examples/arg, 20 \ cc - STD = c + +
-I ./include \
-I ./include \
-lpthread -ldl -lm \
-o fuel
Then the compiler reported an error, the error message is as follows:
Undefined symbols for architecture arm64:
"_wasm_byte_vec_delete", referenced from:
__ZNK8wasmtime5Error7messageB5cxx11Ev in ccjBPpoF.o
__ZN8wasmtime8wat2wasmESt17basic_string_viewIcSt11char_traitsIcEE in ccjBPpoF.o
__ZNK8wasmtime4Trap7messageB5cxx11Ev in ccjBPpoF.o
"_wasm_config_delete", referenced from:...
996ccs edited a comment on issue #7877:
Thanks for the report, but can you fill out some more of the issue template? For example how do we reproduce this? You've pasted a linker-generated error but that could happen from a whole manner of causes. This could be as simple as a missing
-lwasmtime
on the linker command line and something as complex as the wrong version of the library being used.Thank you for your reply.
I was under the https://github.sheincorp.cn/bytecodealliance/wasmtime-cpp repository will include directory header file complete and implement a c++ examples/fuel.cc -std=c++20\
-I ./include \
-lpthread -ldl -lm \
-o fuel
Then the compiler reported an error, the error message is as follows:
Undefined symbols for architecture arm64:
"_wasm_byte_vec_delete", referenced from:
__ZNK8wasmtime5Error7messageB5cxx11Ev in ccjBPpoF.o
__ZN8wasmtime8wat2wasmESt17basic_string_viewIcSt11char_traitsIcEE in ccjBPpoF.o
__ZNK8wasmtime4Trap7messageB5cxx11Ev in ccjBPpoF.o
"_wasm_config_delete", referenced from:...
alexcrichton commented on issue #7877:
Your command line there is missing
-lwasmtime
or something equivalent to link the Wasmtime C API. You can find more documentation infuel.c
.
996ccs commented on issue #7877:
Your command line there is missing
-lwasmtime
or something equivalent to link the Wasmtime C API. You can find more documentation infuel.c
.When I run the above example, I get an error
wasmtime git:(main) cargo build --release -p wasmtime-c-api
cc examples/fuel.c \
-I crates/c-api/include \
-I crates/c-api/wasm-c-api/include \
-lpthread -ldl -lm \
-o fuel
./fuel
Updating crates.io index
error: failed to getwitx
as a dependency of packagewiggle v19.0.0 (/Users/mymac/Desktop/fe/wasmtime/crates/wiggle)
Caused by:
failed to load source for dependencywitx
Caused by:
Unable to update /Users/mymac/Desktop/fe/wasmtime/crates/wasi-common/WASI/tools/witxCaused by:
failed to read/Users/mymac/Desktop/fe/wasmtime/crates/wasi-common/WASI/tools/witx/Cargo.toml
Caused by:
No such file or directory (os error 2)
examples/fuel.c:27:10: fatal error: 'wasm.h' file not found
#include <wasm.h>
^~~~~~~~
1 error generated.
zsh: no such file or directory: ./fuel
➜ wasmtime git:(main) cargo build --release -p wasmtime-c-api
cc examples/fuel.c \
-I crates/c-api/include \
-I crates/c-api/wasm-c-api/include \
target/release/libwasmtime.a \
-lpthread -ldl -lm \
-o fuel
./fuel
Updating crates.io index
error: failed to getwitx
as a dependency of packagewiggle v19.0.0 (/Users/mymac/Desktop/fe/wasmtime/crates/wiggle)
Caused by:
failed to load source for dependencywitx
Caused by:
Unable to update /Users/mymac/Desktop/fe/wasmtime/crates/wasi-common/WASI/tools/witxCaused by:
failed to read/Users/mymac/Desktop/fe/wasmtime/crates/wasi-common/WASI/tools/witx/Cargo.toml
Caused by:
No such file or directory (os error 2)
clang: error: no such file or directory: 'target/release/libwasmtime.a'
zsh: no such file or directory: ./fuel
996ccs closed issue #7877:
Thanks for filing an issue! Please fill out the TODOs below.
.clif
Test CaseTODO: paste .clif test case here. Ideally, a test case that has been reduced via the `clif-util bugpoint` command.
Steps to Reproduce
An error occurs when the c++ column in the examples/ directory is run
- TODO: First, ...
- TODO: Then, ...
- Etc...
Expected Results
TODO: What do you expect to happen?
Code compile throughActual Results
Undefined symbols for architecture arm64:
"_wasm_byte_vec_delete", referenced from:
(anonymous namespace)::compile_wat_module_from_file(wasm_engine_t*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in async-63399a.o
(anonymous namespace)::exit_with_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, wasmtime_error, wasm_trap_t) in async-63399a.o
TODO: What actually happens? Panic? Segfault? Incorrect result?Versions and Environment
Cranelift version or commit: TODO
Operating system: TODO
mac os 13.4
Architecture: TODOExtra Info
Anything else you'd like to add?
996ccs commented on issue #7877:
The problem has been solved.
Last updated: Dec 23 2024 at 12:05 UTC