Comments (5)
I think so, I have built an AOT file on Ubuntu20 and it can run on my Windows
from wasm-micro-runtime.
I think so, I have built an AOT file on Ubuntu20 and it can run on my Windows
Thank you! I'll try again.
from wasm-micro-runtime.
1、I created an AOT file on Windows, and when I run it on Ubuntu 22.04, it shows the error: wasm_runtime_load: AOT module load failed: invalid data relocation section name.
2、I created an AOT file on Ubuntu22.04 and run it on windows. error: wasm_runtime_load:AOT module load failed: relocation truncated to fit IMAGE_REL_AMD64_ADDR32 failed. Try using wamrc with --size-level=1 option.
But it runs well in wasm mode.
from wasm-micro-runtime.
My bad, I forgot to mention how to do cross-compilation for AOT. This error occurs because the relocation type in your two AOT files does not conform to the native compatible format. What you are trying to achieve is like cross-compilation, it will require some certain cross-compiling toolchain to be used.
PS: The following flags are just demoing my points, you should check what's right for your situation
Here is what you would do cross-compile normally:
# This package provides the necessary headers and libraries for Windows, and tools for cross-compilation.
sudo apt install mingw-w64
clang --target=x86_64-w64-mingw32 --sysroot=/usr/x86_64-w64-mingw32 -o myprogram.exe myprogram.c
And what you need to do in aot compilation is similar, something like:
WAMRC_LLC_COMPILER=clang WAMRC_LLC_FLAGS="--target=x86_64-w64-mingw32 --sysroot=/usr/x86_64-w64-mingw32" ./wamrc -o test.aot test.wasm
Here is what that environment variable means: https://github.com/bytecodealliance/wasm-micro-runtime/blob/591a20b91741c24cdb9c031d3c5eec1d80bd72dc/doc/build_wasm_app.md#aot-compilation-with-3rd-party-toolchains
BTW, Generally, I only do cross-compilation when I absolutely have to, otherwise I think it's just easier to set up development environment on the other platform
from wasm-micro-runtime.
Can you try wamrc --target=gnu
on windows to see whether it will work?
from wasm-micro-runtime.
Related Issues (20)
- [RFC] Core module Dynamic Linking HOT 54
- support multi-value from host
- memory may not be shared: threads not allowed HOT 21
- [RFC] wasm32-wasi-p2-module HOT 7
- [WASI] Should we overlook or restrict the access modes for stdin/stdout/stderr? HOT 4
- CI doesn't cover shared library
- Unable to run C++ program in esp32 HOT 9
- How to use the native API with int64 parameters? HOT 1
- Why do functions implemented in wasm require more than one parameter when calling CallFuncV? HOT 3
- Global mutex does not work HOT 1
- Have an issue while importing jump functions in runtime(iwasm) HOT 1
- File operations are not supporting HOT 6
- An invalid section specifier `.aot_stack_sizes` HOT 1
- AOT module load failed: resolve symbol __atomic_compare_exchange_4 failed HOT 10
- The qWasmStackValue command is missing during runtime debugging
- AOT_SECTION_TYPE_SIGNATURE HOT 2
- WASI sockets: POSIX platform `os_socket_recvfrom` unintended behavior HOT 7
- sysbench mutex workload is taking more execution time with iwasm than native x86_64 execution HOT 2
- sysbench memory and threads workload is giving less benchmarking results with iwasm than native aarch64 gcc execution HOT 12
- Updating Exception Handling in WAMR HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-micro-runtime.