Conversation
b821797 to
db3dc0d
Compare
db3dc0d to
3aa4d86
Compare
|
Link error on Windows. Some warnings, then an error linking ErrorHandler.obj |
|
@frasercrmck have you ever seen something like that compiling |
|
It seems that we have unresolved symbols because some link options have been ignored. From what I understand those options are using a unix-like syntax that is supported by clang, but not by MSVC. Most probably, libclc cmake is using it because most of its targets are built with clang to generate bc files. But |
3aa4d86 to
79ca1f5
Compare
79ca1f5 to
8e89c0c
Compare
8e89c0c to
2b90124
Compare
2b90124 to
8cc086d
Compare
8cc086d to
1e4a2d9
Compare
8ef6ff1 to
91e6b82
Compare
91e6b82 to
f8dc721
Compare
f8dc721 to
b16af97
Compare
libclc has to be built through the runtimes feature of LLVM. It needs the native target to build. Disabling zlib as build is failing on libclc when enabled. Add patches to llvm while we wait for them to get merged Fix google#1519
b16af97 to
15c0206
Compare
|
Discussed the Windows build situation with @rjodinchr:
Overall, we're in a state where the Windows/msbuild flow is broken upstream: anybody working on libclc on windows with MSBuild will have this problem. Also it seems the libclc CI is disabled upstream, so others are not catching it. It's unreasonable for our clspv project to support this configuration as a blocker, so I will not block PRs based on the Windows build. I'll apply Required bits to the linux and macos builds, and not add them to the windows builds. |
|
I'm sorry that you're experiencing these problems. You're right that we unfortunately don't have CI, I believe due to a fairly recent change which silently dropped libclc from testing. It was unlucky timing with the push towards using a runtimes build. I was under the impression that libclc was to be forced into the runtimes build but perhaps I misread the situation and we could have left it as it was. It's unlikely I'm going to be able to look into any of these issues in the future. CC @wenju-he who might want to look into this for our downstream? Am I right in thinking that this will affect DPC++ in time? |
Right, in second-stage runtime build libclc uses in-tree just-built clang. The first stage LLVM build is using MSVC compiler.
I haven't seen this issue in our downstream GPU compiler.
I'm currently working on enabling libclc as runtime build in our downstream GPU compiler. I haven't seen any issues with libclc, except that we can't set CLANG_BUILD_TOOLS to OFF. We used to set CLANG_BUILD_TOOLS to OFF to reduce build time. CLANG_BUILD_TOOLS is ON by default, and clang target is available in libclc runtime build because clang target is globally registered at https://github.com/llvm/llvm-project/blob/a5bff94ffd1b81a3562f02f05980ee87cc4164df/clang/cmake/modules/AddClang.cmake#L198 Enabling libclc as runtime in DPC++ compiler build is my next step. Not sure if I'll see the same issue as in this PR. |
I reproduced the fail using MSVC generator: The error is not reproducible with Ninja generator. |
|
prepare_builtins link error on windows is probably a mix of two different issues which are not related to libclc. Issue 1: MSVC generator is multi-configuration generator, and LLVM_RUNTIME_OUTPUT_INTDIR contains Workaround for the link error is to use 2nd stage runtime build should use freshly built clang, so the proper fix is to resolve $(Configuration) correctly. I can only think of writing |
|
Configuring It feels that when using the visual studio generator, it ignores hints on
Is this an idea, or did you try it and see it working? If it works, it can be good enough for |
Yes, all binaries are available in runtime cmake configure and build stage. I find that all binaries in https://github.com/llvm/llvm-project/blob/dfa5bbeafaff2bbb211cde2980cc5f29906d8fac/llvm/cmake/modules/LLVMExternalProjectUtils.cmake#L228-L283 are correctly found by cmake except for CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.
You're right, see https://gitlab.kitware.com/cmake/cmake/-/issues/23385#note_1166850 : "Visual Studio generators do not support setting
Yes, I tried it and it works. Ninja generator (not Ninja Multi-Config) also works and it can find and use the freshly built clang as compiler. |
I'm having trouble understanding how it can work if Am I missing something? |
|
|
|
Yes, this is correct per my understanding. |
|
Thanks a lot @wenju-he for all that information. |
|
Windows bots are back working in clspv by settings |
libclc has to be built through the runtimes feature of LLVM. It needs the native target to build.
Disabling zlib as build is failing on libclc when enabled.
Add patches to llvm while we wait for them to get merged
Fix #1519