On 4 Mar 2021, at 19:55, Maxim Kuvyrkov maxim.kuvyrkov@linaro.org wrote:
Hi Joel,
Indeed, LLD is not configured to be used by default in LLVM-12.0.0-rc1. You need to add -fuse-ld=lld option for it to work. We’ll fix this in the final LLVM-12 release for WoA, which is expected in around 2 weeks.
Thanks for catching this!
c:\Users\tcwg\source\maxim>..\llvm-12.0.0-rc1\bin\clang-cl.exe hello.c clang-cl: error: unable to execute command: Couldn't execute program 'C:\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\arm64\link.exe': Unknown error (0xD8) clang-cl: error: linker command failed with exit code 1 (use -v to see invocation)
I also should note that I configure MSVC environment with
C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=x86 -arch=arm64 … and it’s unclear why it is trying to use x86_64 MSVC linker instead of x86_32 version. Of course, LLD should be the one actually used with Clang, but this may indicate a bug in MSVC environment setup script.
-- Maxim Kuvyrkov https://www.linaro.org
c:\Users\tcwg\source\maxim>..\llvm-12.0.0-rc1\bin\clang-cl.exe -fuse-ld=lld hello.c
c:\Users\tcwg\source\maxim>hello.exe Hello
c:\Users\tcwg\source\maxim>..\llvm-12.0.0-rc1\bin\clang.exe -fuse-ld=lld hello.c
c:\Users\tcwg\source\maxim>hello.exe Hello
-- Maxim Kuvyrkov https://www.linaro.org
On 4 Mar 2021, at 19:43, Joel Cox Joel.Cox@arm.com wrote:
Hi
I was trying "clang hello.c" from command line, but "clang-cl hello.c" gives me the same error. I am unsure if this is what you mean but neither work.
Thanks, Joel
-----Original Message----- From: Maxim Kuvyrkov maxim.kuvyrkov@linaro.org Sent: 04 March 2021 16:40 To: Joel Cox Joel.Cox@arm.com Cc: linaro-toolchain@lists.linaro.org Subject: Re: Clang targetting x64 linker
Hi Joel,
Are you using clang-cl.exe as compiler/linker driver? It’s easiest to use clang-cl.exe as it aims to be a direct replacement for MSVC’s cl.exe, but will use LLVM tools. In particular, when clang-cl.exe uses LLVM Linker (LLD) by default.
If you are using linux-style clang.exe as the driver, then you need to specify -fuse-ld=lld to use LLD.
Does this help?
Regards,
-- Maxim Kuvyrkov https://www.linaro.org
On 4 Mar 2021, at 19:11, Joel Cox Joel.Cox@arm.com wrote:
Hi
I've been trying to run clang on a Windows on Arm machine, but it keeps trying to using the link.exe located in "Visual studio/..../Host64/arm64", which is (seemingly) an x64 tool and as such doesn't run, and crashes the process. Is there a way to set clang to look at VS's x86 link.exe? Or if there is an arm64 version that clang should be using instead?
Thanks, Joel IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.