Compiling Windows application for ARM64 using winelib

Questions about Wine on Linux
Post Reply
JinShil
Newbie
Newbie
Posts: 3
Joined: Tue Apr 08, 2025 8:00 pm

Compiling Windows application for ARM64 using winelib

Post by JinShil »

I have a bunch of Windows C/C++ software that I'd like to try to get running on an ARM64 Linux embedded PC. Winelib seems like the perfect tool for such a task, but I have not been able to get very far.

I built and installed Wine 10.7 on the ARM64 Linux device. I ran winecfg, and that seems to run successfully creating a ~/.wine directory.

I then created the following simple Windows program...

Code: Select all

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
    MessageBox(NULL, "Hello from Winelib on ARM64!", "Test", MB_OK);
    return 0;
}
... and attempted to build it with winegcc -o test test.c -mwindows. Unfortunately, that resulted in the following error:

Code: Select all

winebuild: tools/winebuild/import.c:677: output_import_thunk: Assertion `0' failed.
winegcc: /usr/local/bin/winebuild failed
A quick glance at the import.c source code, reveals that there is no ARM64 support.

Is building Windows applications for ARM64 Linux using Winelib not a supported use case?
JinShil
Newbie
Newbie
Posts: 3
Joined: Tue Apr 08, 2025 8:00 pm

Re: Compiling Windows application for ARM64 using winelib

Post by JinShil »

I just tried this compiling the test program again in v10.8 and now I'm getting this error:

Code: Select all

$ winegcc -o test test.c -mwindows
tmp6830b5d8/test-00000001.spec-00000001.s: Assembler messages:
tmp6830b5d8/test-00000001.spec-00000001.s:6: Error: unknown mnemonic `jmp' -- `jmp 1f'
winebuild: /usr/bin/gcc failed with status 1
winegcc: /usr/local/bin/winebuild failed
So it looks like its trying to generate x86/x64 code.

However, if I compile with winegcc -b aarch64-windows -o test test.c -mwindows I get a test.exe file that I can execute with wine test.exe. But I was hoping to get a Linux executable, not a Windows executable.
Post Reply