Compile OTP 28 on Windows ARM Chip

Hello!

just a short question to compile OTP 28 on Windows ARM Chip for aarch64.
I don’t see, that the documentation otp/HOWTO/INSTALL-WIN32.md at master · erlang/otp · GitHub is up to date for compiling it on Windows ARM.

But I see you need WSL for Windows ARM, do you have any tips for compiling it. Because directly on my Apple Chip Mac with virtualization for Windows ARM i can not start WSL because Hyper-V needs nested virtualization and this is not possible.
Do you compile it on a native Windows ARM device or can i use some other technology?

Use WSL-1 that doesn’t need Hyper-V does it?

You could try building a github actions workflow that builds it? Not sure if WSL works there or not.

Okay, thank you for some ideas.
WSL-1 i tested, but i could not make a fallback from WSL-2 to version 1, i got an error but i don’t know the message anymore. i will install Windows 11 on arm chip new and test again to setup WSL 1

Github actions workflow i must try.

WSL 1 with Windows 11 ARM (Ubuntu 22.04) is running + I tested Visual Studio 2022 and 2026 version for compiling, because it uses cl.exe.

after

eval `./otp_build env_win32 arm64`

./otp_build configure \

–with-ssl=/mnt/c/OpenSSL-Win64 \

--without-wx \\

--without-javac

./otp_build boot -a

I am running into a problem with zstd which is used for compression:

“nichtdeklarierter Bezeichner” in german means “undeclared identifier”.

CC /mnt/c/src/otp-28.5.0.5/erts/emulator/zstd/obj/win32/opt/zstd_double_fast.o
zstd\compress\zstd_double_fast.c(225): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(225): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(225): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
zstd\compress\zstd_double_fast.c(226): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(226): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(226): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
zstd\compress\zstd_double_fast.c(237): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(237): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(237): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
zstd\compress\zstd_double_fast.c(371): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(371): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(371): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
zstd\compress\zstd_double_fast.c(372): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(372): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(372): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
zstd\compress\zstd_double_fast.c(452): error C2065: “asm”: nichtdeklarierter Bezeichner
zstd\compress\zstd_double_fast.c(452): error C2146: Syntaxfehler: Fehlendes “;” vor Bezeichner “volatile
zstd\compress\zstd_double_fast.c(452): error C2143: Syntaxfehler: Es fehlt “)” vor “:”
Failed: cl.exe -nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE -D__aarch64__ -MD -Ox -Z7 -I"C:\src\otp-28.5.0.5\erts\win32" -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 -DERTS_MIXED_VC -DHAVE_CONFIG_H -DUSE_THREADS -DWIN32_THREADS /FS -c -FoC:\src\otp-28.5.0.5\erts\emulator\zstd\obj\win32\opt\zstd_double_fast.o zstd\compress\zstd_double_fast.c
make[4]: *** [zstd/zstd.mk:85: /mnt/c/src/otp-28.5.0.5/erts/emulator/zstd/obj/win32/opt/zstd_double_fast.o] Error 2
make[4]: Leaving directory ‘/mnt/c/src/otp-28.5.0.5/erts/emulator’
make[3]: *** [/mnt/c/src/otp-28.5.0.5/make/run_make.mk:37: opt] Error 2

If you pass -DNO_PREFETCH to CFLAGS during configure it might fix that issue.

The problem seems to be that we pass -D__aarch64__ to cl.exe in order to simulate GCC/clang behaviour in our code, but the vendored zstd does not like that. So by disabling prefetching in zstd it will hopefully fix that.

There might be other issues down the line though as we don’t build nor test Windows on arm and rely on opensource users to find and fix issues here, so it is not surprising that it breaks.

If someone wants it to not break, figuring out how to setup github actions for it to build arm windows would be a great way to help.

Hi garazdawi,

I will look forward, maybe I can help with an GitHub action / workflow. Currently they have a new image available.

Windows 11 Arm with Visual Studio 2026 is now available for GitHub Actions.
You can use the windows-11-vs2026-arm image label in your YAML to select this image.

jobs:
jobName:
runs-on: windows-11-vs2026-arm