-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add x86_64-w64-windows-gnu/aarch64-w64-windows-gnu/i686-w64-windows-gnu aot triple support #4103
Comments
I guess allow pass triple from arguments for wamrc will be a lot easy, and support all future arch & target. if pass triple, then arch and target can be infered. |
You can use option
|
I guess it must be ./wamrc.exe --target-abi=gnu --target=x86_64 --enable-tail-call --format=aot -o fib.win fib.wasm
Create AoT compiler with:
target: x86_64
target cpu:
target triple: x86_64-pc-linux-gnu
cpu features:
opt level: 3
size level: 3
output format: AoT file
Compile success, file fib.win was generated. crashed when load aot ./tests_wamr.exe
=================================================================
==3320==ERROR: AddressSanitizer: access-violation on unknown address 0x01cf501c0004 (pc 0x7ff8f68f4678 bp 0x006411efb8b0 sp 0x006411efb828 T0)
==3320==The signal is caused by a WRITE memory access.
#0 0x7ff8f68f4677 in memset+0x77 (C:\Windows\SYSTEM32\ntdll.dll+0x1800a4677)
#1 0x7ff8b3ff2cc0 in _asan_memset+0x90 (C:\Users\admin\libclang_rt.asan_dynamic-x86_64.dll+0x180042cc0)
#2 0x7ff7f0b34206 (C:\Users\admin\tests_wamr.exe+0x140214206)
#3 0x7ff7f0b34c67 (C:\Users\admin\tests_wamr.exe+0x140214c67)
#4 0x7ff7f0ac02ec (C:\Users\admin\tests_wamr.exe+0x1401a02ec)
#5 0x7ff7f0a5f2d5 (C:\Users\admin\tests_wamr.exe+0x14013f2d5)
#6 0x7ff7f0a5303a (C:\Users\admin\tests_wamr.exe+0x14013303a)
#7 0x7ff7f0a5033a (C:\Users\admin\tests_wamr.exe+0x14013033a)
#8 0x7ff7f0999403 (C:\Users\admin\tests_wamr.exe+0x140079403)
#9 0x7ff7f0999493 (C:\Users\admin\tests_wamr.exe+0x140079493)
#10 0x7ff7f097a5e7 (C:\Users\admin\tests_wamr.exe+0x14005a5e7)
#11 0x7ff7f092133b (C:\Users\admin\tests_wamr.exe+0x14000133b)
#12 0x7ff7f0921395 (C:\Users\admin\tests_wamr.exe+0x140001395)
#13 0x7ff8f5597373 in BaseThreadInitThunk+0x13 (C:\Windows\System32\KERNEL32.DLL+0x180017373)
#14 0x7ff8f689cc90 in RtlUserThreadStart+0x20 (C:\Windows\SYSTEM32\ntdll.dll+0x18004cc90)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation (C:\Windows\SYSTEM32\ntdll.dll+0x1800a4677) in memset+0x77
==3320==ABORTING
|
This is due to |
The wamrc.exec default is ./wamrc.exe --target-abi=msvc --enable-tail-call --format=aot -o fib.win fib.wasm
Create AoT compiler with:
target: x86_64
target cpu:
target triple: x86_64-pc-windows-msvc
cpu features:
opt level: 3
size level: 1
output format: AoT file
Compile success, file fib.win was generated. I guess problem is from here, allow user set vendor_sys|triple from arguments will be much simple and prevent more questions(like require android/ios/musl triple). /**
* Set <vendor>-<sys> according to abi to generate the object file
* with the correct file format which might be different from the
* default object file format of the host, e.g., generating AOT file
* for Windows/MacOS under Linux host, or generating AOT file for
* Linux/MacOS under Windows host.
*/
if (!strcmp(abi, "msvc")) {
if (!strcmp(arch1, "i386"))
vendor_sys = "-pc-win32-";
else
vendor_sys = "-pc-windows-";
}
else {
if (is_baremetal_target(arch, cpu, abi))
vendor_sys = "-unknown-none-";
else
vendor_sys = "-pc-linux-";
} |
You are right, the correct way is to add the command line option to control vendor_sys(add some extra check to make sure triple is compatible too) |
use * thread #1, stop reason = Exception 0xc0000005 encountered at address 0x1647bf83edc: User-mode data execution prevention (DEP) violation at location 0x1647bf83edc
* frame #0: 0x000001647bf83edc
frame #1: 0x00007ff7de9a64ea tests_wamr.exe`invoke_ii_i
frame #2: 0x00007ff7de9ede12 tests_wamr.exe`invoke_native_internal
frame #3: 0x00007ff7de9ed762 tests_wamr.exe`aot_call_function
frame #4: 0x00007ff7de92d495 tests_wamr.exe`wasm_runtime_call_wasm
frame #5: 0x00007ff7de92f77b tests_wamr.exe`wasm_runtime_call_wasm_a
frame #6: 0x00007ff7de90aab2 tests_wamr.exe`main
frame #7: 0x00007ff7de8b133c tests_wamr.exe`__tmainCRTStartup at crtexe.c:266:15
frame #8: 0x00007ff7de8b1396 tests_wamr.exe`mainCRTStartup at crtexe.c:186:9
frame #9: 0x00007ff8f5597374 kernel32.dll`BaseThreadInitThunk + 20
frame #10: 0x00007ff8f689cc91 ntdll.dll`RtlUserThreadStart + 33 |
and armv7a-unknown-linux-android will not work for any target, report expect arm32, but get armv7. also try thumbv7 not work |
current wamrc only support mscv triple, can not made it work with x86_64-w64-windows-gnu. (you can get this from https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64.tar.xz)
The text was updated successfully, but these errors were encountered: