-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm][cmake] Properly place clang runtime directory on linker command line when WinMsvc.cmake is involved #110084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d line when WinMsvc.cmake is involved WinMsvc.cmake, used for cross-compiling LLVM, targetting Windows, puts -libpath flags on the linker command line for the MSVC directories. Those may contain clang runtime libraries that come from MSVC, and may be incompatible with the clang compiler in use when it doesn't come from MSVC (which is obviously the case on cross-compiles). By prioritizing the clang runtime directory on the linker command line, we avoid those libraries being picked up by the linker.
The only thing that bothers me here is that in the end, we have two (potentially) different libs accessible from the libpaths. Prioritizing one against the other may be the right approach, but I'd feel more confident if we only have one. Have you tried removing the |
Adding Tom to the review (hey o/) for his expertise on packaging. |
The directory that contains the clang runtime in MSVC also contains the MSVC runtime, which is also required. |
ok, thanks for the extra info. I assume the clang runtime bundled with MSVC is not used at all in your context? |
no, and it better not for the reasons outlined in the top comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked the other appends, and they look fine wrt. -libpath
. LGTM then.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/151/builds/2503 Here is the relevant piece of the build log for the reference
|
…d line when WinMsvc.cmake is involved (llvm#110084) WinMsvc.cmake, used for cross-compiling LLVM, targetting Windows, puts -libpath flags on the linker command line for the MSVC directories. Those may contain clang runtime libraries that come from MSVC, and may be incompatible with the clang compiler in use when it doesn't come from MSVC (which is obviously the case on cross-compiles). By prioritizing the clang runtime directory on the linker command line, we avoid those libraries being picked up by the linker.
…dc53f6a77 Local branch amd-gfx c94dc53 Merged main:09cd5a86733a362f12542a11ffd834cac885eb32 into amd-gfx:a6a072505de2 Remote branch main 631bcbe [llvm][cmake] Properly place clang runtime directory on linker command line when WinMsvc.cmake is involved (llvm#110084)
WinMsvc.cmake, used for cross-compiling LLVM, targetting Windows, puts -libpath flags on the linker command line for the MSVC directories. Those may contain clang runtime libraries that come from MSVC, and may be incompatible with the clang compiler in use when it doesn't come from MSVC (which is obviously the case on cross-compiles). By prioritizing the clang runtime directory on the linker command line, we avoid those libraries being picked up by the linker.