Does wamrc call GCC or Clang in order to make AOT files? #4235
Replies: 3 comments
-
I noticed that a lot of the compilation from WASM to AOT is done in aot_llvm.c, which is 4000 lines long. Is this LLVM code? So it's fully contained within the aotclib static library then? |
Beta Was this translation helpful? Give feedback.
-
Hmm, I don't understand. It seems like a lot of the LLVM stuff is inside the aotclib static library, but there is a separate copy of llvm in core/deps/ folder:
I don't get it, so even though the original compilation from C or C++ uses Clang/LLVM to compile to WASM, LLVM is needed again to compile from WASM to AOT? Why is there so much LLVM stuff in the aotclib compiler static library then? |
Beta Was this translation helpful? Give feedback.
-
Have you heard of Zig? The whole package is smaller than LLVM, like a 40 to 50 MB download, although it compiles extra files and becomes a bit bigger, and it can compile Zig, C and C++ to WASM just by default. Would it be hard to modify the CMakeLists.txt of wamr-compiler to exclude LLVM and use the Zig compiler? The Zig LLVM compiler can be called with zig cc or zig c++ and then do something like:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm just wondering whether it has this dependency. Because if not then I can just distribute WASM files and then the user will be able to create AOT files on their own without requiring either compiler toolchain. Also, what are the difference between an AOT file and a dynamic library? The runtime can load either WASM files or AOT files. If it loads an AOT file is that kind of like loading a DLL/SO or something?
Beta Was this translation helpful? Give feedback.
All reactions