ARM64 Support

Comments, questions, bug reports, etc.
synchronicity
Site Admin
Posts: 472
Joined: Sun Aug 02, 2015 10:31 pm

Re: ARM64 Support

Post by synchronicity »

Edit: File too large (27 MB at maximum compression). How may I submit the package?
Is there a source code patch to look at? I don't necessarily need the binaries.
joveler
Posts: 11
Joined: Wed Jan 31, 2018 2:45 pm

Re: ARM64 Support

Post by joveler »

I succeeded in building libwim-15.dll on MSYS2 with llvm-mingw toolchain.

Even the latest MinGW-w64 toolchain available on MSYS2 does not support aarch64-w64-mingw32 target.
However, LLVM/Clang does support ARM64 Windows target, and MSYS2 community was testing clang toolchain (ref) for it.
Thus I tried my best to compile wimlib with llvm based mingw-w64 toolchain, llvm-mingw.


[Used tools]
- MSYS2: latest update
- llvm-mingw: 20201020 with LLVM stable 11.0.0

[Build Instructions]
I adapted official windows cross compile build script to be used in MSYS2.
I also had to patch sources to make them compilable on LLVM/Clang.

- libxml2: linker detection of configure.ac had to be patched.
- wimlib: __declspec(dllexport) had to be added to every extern function prototypes of wimlib.h.

Read attached wimlib-llvm-aarch64-manual.7z for details.

[Binary]
Attached as wimlib-1.13.3-bin-aarch64.7z.

LLVM linker could not link wimlib-imagex.exe, so I could obtain only libwim-15.dll.

Code: Select all

CCLD     libwim.la
CCLD     wimlib-imagex.exe
lld-link: error: undefined symbol: __declspec(dllimport) __winitenv
>>> referenced by C:\Joveler\llvm-mingw\aarch64-w64-mingw32\lib\crt2u.o:(.refptr.__imp___winitenv)
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:1318: wimlib-imagex.exe] Error 1
I have tested the ARM64 dll with my C# wimlib wrapper on Raspberry Pi 4B, and it worked without any issues.

The instruction, patches, and binaries are also available on GitHub repo of ManagedWimLib.
Attachments
wimlib-1.13.3-bin-aarch64.7z
(312.42 KiB) Downloaded 1067 times
wimlib-llvm-aarch64-manual.7z
(8.26 KiB) Downloaded 750 times
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: ARM64 Support

Post by zipmagic »

joveler wrote: Wed Apr 07, 2021 4:58 pm I succeeded in building libwim-15.dll on MSYS2 with llvm-mingw toolchain.

Even the latest MinGW-w64 toolchain available on MSYS2 does not support aarch64-w64-mingw32 target.
However, LLVM/Clang does support ARM64 Windows target, and MSYS2 community was testing clang toolchain (ref) for it.
Thus I tried my best to compile wimlib with llvm based mingw-w64 toolchain, llvm-mingw.


[Used tools]
- MSYS2: latest update
- llvm-mingw: 20201020 with LLVM stable 11.0.0

[Build Instructions]
I adapted official windows cross compile build script to be used in MSYS2.
I also had to patch sources to make them compilable on LLVM/Clang.

- libxml2: linker detection of configure.ac had to be patched.
- wimlib: __declspec(dllexport) had to be added to every extern function prototypes of wimlib.h.

Read attached wimlib-llvm-aarch64-manual.7z for details.

[Binary]
Attached as wimlib-1.13.3-bin-aarch64.7z.

LLVM linker could not link wimlib-imagex.exe, so I could obtain only libwim-15.dll.

Code: Select all

CCLD     libwim.la
CCLD     wimlib-imagex.exe
lld-link: error: undefined symbol: __declspec(dllimport) __winitenv
>>> referenced by C:\Joveler\llvm-mingw\aarch64-w64-mingw32\lib\crt2u.o:(.refptr.__imp___winitenv)
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:1318: wimlib-imagex.exe] Error 1
I have tested the ARM64 dll with my C# wimlib wrapper on Raspberry Pi 4B, and it worked without any issues.

The instruction, patches, and binaries are also available on GitHub repo of ManagedWimLib.
Wow, great work!

Thank you :)
JFX
Posts: 40
Joined: Tue Aug 18, 2015 3:59 pm

Re: ARM64 Support

Post by JFX »

@zipmagic
could you share some details about your creation of ARM64 wimib-imagex.exe?
I mean thanks to joveler we have a simple way of creating libwim-15.dll from the current version.
All that's left is a non static linked version of wimib-imagex.exe.
JFX
Posts: 40
Joined: Tue Aug 18, 2015 3:59 pm

Re: ARM64 Support

Post by JFX »

Hmm, I have no clue why this error disappeared, but it compiles fine now.
A quick test in QEMU did also gone well. Will test in next week on real ARM64 hardware.
Last edited by JFX on Mon Mar 06, 2023 12:34 pm, edited 1 time in total.
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: ARM64 Support

Post by zipmagic »

Glad you got it working. My effort was some time ago so I'm not sure I would have been much help today. At any rate the WIMBOOT driver for ARM64 just doesn't work and Microsoft has no plans to fix it considering it a deprecated technology, so this was an area of abandoned research effort for us here. Unless you know of an open source alternative to the stock WIMBOOT driver, of course :lol:
JFX
Posts: 40
Joined: Tue Aug 18, 2015 3:59 pm

Re: ARM64 Support

Post by JFX »

Oh, did notice this topic is from 2018.
Your right about WIMBOOT not working on ARM64, but don't think the driver is the problem.
It's more like there is no early boot support through bootmgr.efi and winload.efi.

My test on a Surface Pro X were successful.
5 minutes faster than emulated x86_64 and still 3 minutes faster than imagex while capture a ~20GB installation using LZX compression.

I'm attaching a new binary, the last wasn't compiled with optimization.
Attachments
wimlib-1.13.6-windows-aarch64-bin.zip
(410.77 KiB) Downloaded 518 times
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: ARM64 Support

Post by zipmagic »

JFX wrote: Mon Mar 06, 2023 12:39 pm Oh, did notice this topic is from 2018.
Your right about WIMBOOT not working on ARM64, but don't think the driver is the problem.
It's more like there is no early boot support through bootmgr.efi and winload.efi.
There's isn't any chance we might be able to address that as a third party, is there?
JFX
Posts: 40
Joined: Tue Aug 18, 2015 3:59 pm

Re: ARM64 Support

Post by JFX »

No, it requires a (much bigger) exclusion list,
simular to a Windows 7 release using wimboot.

This also seems to be hardware depending, so for an end-user
who does not like experiments, it's just not suited.
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: ARM64 Support

Post by zipmagic »

JFX wrote: Wed Mar 22, 2023 11:15 am No, it requires a (much bigger) exclusion list,
simular to a Windows 7 release using wimboot.
Very interesting - are you sure a large enough exclusion list would address this problem? Do you have any lists of files you are willing to share?
JFX wrote: Wed Mar 22, 2023 11:15 am This also seems to be hardware depending, so for an end-user
who does not like experiments, it's just not suited.
We already did a lot of work to build the core Windows 7 exclusion lists (the file enumeration is part of our publicly accessible patent), but the bootup process never worked entirely consistently across devices/VMs.

Is this what you mean by hardware depending - inconsistencies in the boot process from device to device, despite having the same exclusion list?

Can you clarify which devices in particular you actually tested on? The only ARM Windows devices we have access to are Surface Pro X's and, of course, Parallels VMs running on macOS with M1/M2 hardware.

Have you also tested on other kinds of hardware? Our job is to make this easy for end-users so we're here to do the legwork and research.
Post Reply