Back in July 2020, Arm published a blog showcasing a concept example of compiling an application for Windows on Arm laptop devices with clang. The concept was a big success, with our research showing that developers could compile twice as fast on Windows on Arm with a native clang compiler. This was then bought forward to Arm’s partners in the laptop market, with our good friends at Linaro taking a keen interest. This initial engagement has eventually led to Linaro working with the upstream LLVM community to release a Windows on Arm variant of the LLVM toolchain. This was announced on 20 April 2021.
The new LLVM toolchain variant for Windows on Arm means developers can now develop and compile a C/C++ application on a Windows on Arm laptop with a native AArch64 LLVM toolchain. Essentially, developing on Arm for Arm. As I indicated in the introduction, compiling for Arm on Arm speeds up the compilation speed. Our figures showed speed increases of 2x, with Linaro independently confirming this speed up.
This is because being able to compile on the actual device leads to a faster workflow. Before the new LLVM toolchain variant for Windows on Arm, if developers wanted to compile on the Windows on Arm device itself, then they had to run the x86 toolchain under emulation and cross-compile. Running under emulation restricts the application’s use of modern compiler technologies (such as link-time optimization) because only 4GB of memory can be used by the 32-bit toolchain supported under emulation. Both of these issues slowed down the whole development process. However, native binaries are AArch64 binaries and do not require emulation, speeding up the entire process for developers.
As part of this Linaro release, LLVM supports clang-cl. This means most developers can use clang-cl to compile their C/ C++ applications straight away on Visual Studio/MSBuild on the Windows on Arm device without needing to change the command line. In fact, it is highly likely that the LLVM release paves the way for more natively supported developer tools. Elements of the Windows on Arm ecosystem are already evaluating what they can do following this announcement.
LLVM is aiming to offer a native toolchain featuring Windows on Arm binaries, which includes a compiler, linker and compiler libraries that are available to download. Arm is also going to be releasing information about how to compile with native Windows on Arm clang-cl. Back in 2019, we published a blog about porting the PuTTY open-source terminal emulation application to Windows on Arm. We are repeating the process described in the blog, but this time using a native Windows on Arm clang-cl compiler on an Arm-based laptop to compare the results. We expect the results to be impressive, so stay tuned for a future blog about this.
The new LLVM toolchain variant for Windows on Arm is great news for developers. We are increasingly seeing more developers targeting their applications for Windows on Arm laptops, such as StaffPad and Tweeten. This new Linaro release makes the process faster than ever before through Arm on Arm development. We encourage all developers to look at this new toolchain variant and see how Windows on Arm could benefit your applications.
[CTAToken URL = "https://developer.arm.com/solutions/os/windows-on-arm" target="_blank" text="Learn more about developing for Windows on Arm" class ="green"]