Stream: git-wasmtime

Topic: wasmtime / issue #6221 How to compile wasmtime to generat...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2023 at 15:45):

knowonething opened issue #6221:

I'm interested in the mechanism of wasmtime, so i want to get the llvm bitcode file corresponding to the wasmtime executable file, which contains all the needed functions (except glibc functions, just like in executable file). For C/C++ projects, I can utilize wllvm to do this. However, wasmtime is written in rust. I have tried to add some parameters, such as --emit=llvm-bc, and then use llvm-link to merge the bitcode files in the target/release/deps/directory, but the functions in external crates are not included in the merged bitcode file, for example, functions in capstone or zstd_sys. When I use lli to execute the bitcode file, it will prompt that many symbols cannot be found. So I would like to ask if there is a way to get this all-in-one bitcode file?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2023 at 21:13):

bjorn3 commented on issue #6221:

This was cross posted to https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Generate.20all-in-one.20llvm.20bitcode.20file.20for.20projects

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2023 at 23:14):

cfallin commented on issue #6221:

@knowonething it might be useful to add more context for what you're asking, because there may be a different way to answer your underlying question(s) without generating a bitcode file for all of Wasmtime. In particular, are you trying to do some sort of analysis or transform on the codebase? Interest in the "mechanism of wasmtime" is fairly vague; I could also imagine that meaning just interested in how the engine works, in which case, the source code is the best material to study. I imagine you have some more particular idea in mind though, or else you wouldn't be asking this!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 19 2023 at 11:13):

knowonething commented on issue #6221:

@cfallin
I want to use llvm IR to do some simple analysis, such as function call relationship. It is very convenient to use llvm IR to do this kind of thing. But I have been unable to find how to get the complete llvm IR in the rust documentation, for example, the functions in the dependent external crate are missing. Fortunately, in this page, I got some useful advice, and I think I can continue my work. Also, thanks for your suggestion. : )

view this post on Zulip Wasmtime GitHub notifications bot (Apr 19 2023 at 11:13):

knowonething closed issue #6221:

I'm interested in the mechanism of wasmtime, so i want to get the llvm bitcode file corresponding to the wasmtime executable file, which contains all the needed functions (except glibc functions, just like in executable file). For C/C++ projects, I can utilize wllvm to do this. However, wasmtime is written in rust. I have tried to add some parameters, such as --emit=llvm-bc, and then use llvm-link to merge the bitcode files in the target/release/deps/directory, but the functions in external crates are not included in the merged bitcode file, for example, functions in capstone or zstd_sys. When I use lli to execute the bitcode file, it will prompt that many symbols cannot be found. So I would like to ask if there is a way to get this all-in-one bitcode file?


Last updated: Oct 23 2024 at 20:03 UTC