Martin Storsjö via llvm-dev
2018-May-21 10:38 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
On Mon, 21 May 2018, Hayden Livingston wrote:> So are you saying that LLVM can be built as ARM64 on Windows now? > CMake doesn't show me an option for ARM64 when using MSVC on Windows. > I have the latest CMake.I'm saying that LLVM can produce code for the Windows/ARM64 target. As for compiling LLVM itself to run on ARM64 on Windows, I don't know how to configure MSVC to do that; MSVC doesn't install the ARM64 compiler by default but you manually need to check a box in the installer (available since 15.4, and more intended for actual public use since the 15.8 preview). No idea how you configure that in CMake. You can build LLVM+Clang for ARM64 with Clang/mingw-w64/libcxx though, with the same toolchain used to build VLC in that demo. // Martin
Hayden Livingston via llvm-dev
2018-May-21 10:40 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
Ok. How much work was it to enable ARM64 codegen? Is it is significantly more work than for Linux targets? Are there any special relocations in ARM64 land? On Mon, May 21, 2018 at 3:38 AM, Martin Storsjö <martin at martin.st> wrote:> On Mon, 21 May 2018, Hayden Livingston wrote: > >> So are you saying that LLVM can be built as ARM64 on Windows now? >> CMake doesn't show me an option for ARM64 when using MSVC on Windows. >> I have the latest CMake. > > > I'm saying that LLVM can produce code for the Windows/ARM64 target. > > As for compiling LLVM itself to run on ARM64 on Windows, I don't know how to > configure MSVC to do that; MSVC doesn't install the ARM64 compiler by > default but you manually need to check a box in the installer (available > since 15.4, and more intended for actual public use since the 15.8 preview). > No idea how you configure that in CMake. > > You can build LLVM+Clang for ARM64 with Clang/mingw-w64/libcxx though, with > the same toolchain used to build VLC in that demo. > > // Martin
Martin Storsjö via llvm-dev
2018-May-21 10:53 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
On Mon, 21 May 2018, Hayden Livingston wrote:> Ok. How much work was it to enable ARM64 codegen? Is it is > significantly more work than for Linux targets? Are there any special > relocations in ARM64 land?It was surprisingly little work, I'd say. Yes, Windows uses COFF, and there's a separate set of relocations for each architecture. Probably not more work than for Linux targets, but just new things to implement. The initial commits for ARM64 in COFF were done by Mandeep Singh Grang, and after that, there were a few details to fill in about how the relocations are supposed to behave. The public documentation only names them, but luckily link.exe supported those relocations since long ago, so I was able to use llvm-mc together with link.exe to figure out how e.g. the IMAGE_REL_ARM64_REL21/IMAGE_REL_ARM64_PAGEOFFSET_12A relocation pairs are supposed to handle overflow/carry. Other than relocations, the main bits were varargs handling, hooking up small flags and bits here and there as you find what's missing, minor windows/coff specific details like linker directives and dllimport handling, and slightly larger things such as stack probing and TLS. // Martin