Closed hmelder closed 10 months ago
Here the results from a GNUstep Base test run:
8299 Passed tests
65 Dashed hopes
8 Skipped sets
4 Failed tests
3 Failed files
Failed Tests:
Awesome! I’ll try to set up my WoA hardware this week to give this a try, as well as a self-hosted runner for CI.
Thanks for the PR! :) I tried building this on a Windows ARM machine in a "vcvarsall arm64" prompt but got this error – any idea? Feel free to ping me on Slack if you have time to take a look together. 🙏
###### libobjc2 ######
### Cleaning project
HEAD is now at ab23f14 Initial Windows on ARM (AArch64) Support (#249)
### Updating project
Already up to date.
Synchronizing submodule url for 'third_party/robin-map'
### Running cmake
-- The C compiler identification is Clang 17.0.5 with GNU-like command-line
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: C:/Program Files/LLVM/bin/clang.exe
-- The CXX compiler identification is Clang 17.0.5 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Program Files/LLVM/bin/clang.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/Users/frede/Dev/djayApp/External/GNUstep/tools-windows-msvc/src/libobjc2/build-arm64-Debug/CMakeFiles/CMakeScratch/TryCompile-5d9duk'
Run Build Command(s): C:/ProgramData/chocolatey/bin/ninja.exe -v cmTC_8aefb
[1/2] C:\PROGRA~1\LLVM\bin\clang.exe -m64 -m64 -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -MD -MT CMakeFiles/cmTC_8aefb.dir/testCCompiler.c.obj -MF CMakeFiles\cmTC_8aefb.dir\testCCompiler.c.obj.d -o CMakeFiles/cmTC_8aefb.dir/testCCompiler.c.obj -c C:/Users/frede/Dev/djayApp/External/GNUstep/tools-windows-msvc/src/libobjc2/build-arm64-Debug/CMakeFiles/CMakeScratch/TryCompile-5d9duk/testCCompiler.c
[2/2] cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -m64 -fuse-ld=lld-link -nostartfiles -nostdlib -m64 -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -fuse-ld=lld -Xlinker /subsystem:console CMakeFiles/cmTC_8aefb.dir/testCCompiler.c.obj -o cmTC_8aefb.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:cmTC_8aefb.lib -Xlinker /pdb:cmTC_8aefb.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
FAILED: cmTC_8aefb.exe
cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -m64 -fuse-ld=lld-link -nostartfiles -nostdlib -m64 -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -fuse-ld=lld -Xlinker /subsystem:console CMakeFiles/cmTC_8aefb.dir/testCCompiler.c.obj -o cmTC_8aefb.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:cmTC_8aefb.lib -Xlinker /pdb:cmTC_8aefb.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
lld-link: error: could not open 'oldnames.lib': no such file or directory
lld-link: error: could not open 'msvcrtd.lib': no such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Clang:
clang version 17.0.5
Target: aarch64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
These are the components I installed in Visual Studio:
That is weird. Can you provide the CMakeFiles/CMakeConfigureLog.yaml
which is located in the CMake build directory?
What CMake version do you have? Is it the native ARM64 version, the VS version, or an emulated x64 release?
On my machine:
C:\tools-windows-msvc>clang --version
clang version 17.0.5
Target: aarch64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM-woa64\bin
Feel free to ping me on Slack if you have time to take a look together
Alright!
I installed the arm64 version of CMake (I had the x64 one from Chocolatey), but that didn’t make a difference.
But I found out that the error is reproducible building a trivial C program, and that my LIB/LIBPATH environment variables are missing the path containing msvcrtd.lib et al. This is what I have in an "vcvarsall arm64" prompt:
LIB=C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\arm64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\arm64
LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22000.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22000.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Whereas in a "vcvarsall x64" prompt I get this, which adds the <VS>\VC\Tools\MSVC\14.38.33130\lib\x64
directory containing the library:
LIB=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64
LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22000.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22000.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
However if I manually add <VS>\VC\Tools\MSVC\14.38.33130\lib\arm
to LIB and LIBPATH I get this trying to build a trivial C program:
p>clang test.c -o test.exe
lld-link: error: libcmt.lib(exe_main.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(loadcfg.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(utility.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(gs_support.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(matherr.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(argv_mode.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(commit_mode.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(file_mode.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(new_mode.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(thread_locale.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(tncleanup.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(env_mode.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(invalid_parameter_handler.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(denormal_control.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(default_local_stdio_options.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(matherr_detection.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(dyn_tls_init.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(dyn_tls_dtor.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(utility_desktop.obj): machine type arm conflicts with arm64
lld-link: error: libcmt.lib(initsect.obj): machine type arm conflicts with arm64
lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Maybe interestingly when I build in a "x64 native tools command prompt" (aka vcvarsall x64
) I get machine type x64 conflicts with arm64
.
The fine folks at Linaro helped me figure out that I had incorrectly installed the build tools and ATL for (32-bit) "ARM" instead of "ARM64/ARM64EC".
The build is now running with these VC components – I’ll report back.
The fine folks at Linaro helped me figure out that I had incorrectly installed the build tools and ATL for (32-bit) "ARM" instead of "ARM64/ARM64EC".
The build is now running with these VC components – I’ll report back.
Weird. I do not have any ATL components installed and it works just fine. We are not using Active Template Library afaik.
Ahh that’s entirely possible that ATL is not required for the toolchain, I just installed it because I think our app needs them.
Ahh that’s entirely possible that ATL is not required for the toolchain, I just installed it because I think our app needs them.
That makes sense :)
This pull request adds initial support for the Windows on ARM platform.
The following build dependencies are required:
armasm64.exe
required by libffiMy Visual Studio Configuration for reference (17.9.0 Preview 1.1):
There are two pending pull requests, which fix some build system configuration issues:
Merged Pull Requests:
I have included the libdispatch patch, but it would be better to wait until the PR is merged.