-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
linkers: Fix detection of link arguments to Clang(-cl) + MSVC #12144
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
Merged
jpakkane
merged 4 commits into
mesonbuild:master
from
amyspark:fix-msvc-clangcl-linker-flag-detection
Apr 4, 2024
Merged
linkers: Fix detection of link arguments to Clang(-cl) + MSVC #12144
jpakkane
merged 4 commits into
mesonbuild:master
from
amyspark:fix-msvc-clangcl-linker-flag-detection
Apr 4, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nirbheek
reviewed
Aug 21, 2023
Member
|
LGTM otherwise, but maybe @eli-schwartz or @xclaesse will want to comment since they're more up-to-date on the compilers/linkers classes. |
9af1bdb to
26f31cc
Compare
tristan957
reviewed
Aug 21, 2023
Member
|
@amyspark could you please add a test for this? I'm surprised this wasn't already caught by CI. |
xclaesse
reviewed
Aug 23, 2023
a8ef6de to
8cf2fb3
Compare
eli-schwartz
reviewed
Sep 1, 2023
2507ef5 to
c052d08
Compare
c052d08 to
4f8945e
Compare
Member
|
@bruchar1 can you test this? |
Currently, not only Meson lacks a way to induce a "--fatal-warnings" on LINK.exe, it is also unable to pass flags appropriately when using clang-cl or Microsoft's stock clang. This commit fixes it by implementing `fatal_warnings()` in the MSVCDynamicLinker and ClangCLDynamicLinker classes, and by implementing the requisite conversion steps in linker_to_compiler_args for ClangCompiler.
The latter prefers LINK.exe by default, which rejects GNU-like linker flags.
4f8945e to
f3fad6c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes passing and detection of link arguments when using Microsoft's linker in combination with clang-cl or stock clang.
Currently, not only Meson lacks a way to induce a
--fatal-warningson LINK.exe, thus rendering all flag detection morose, it is also unable to pass flags appropriately by wrapping them in-Wl,.This commit fixes it by implementing
fatal_warnings()in the MSVCDynamicLinker and ClangCLDynamicLinker classes, and by implementing the requisite conversion steps in linker_to_compiler_args for ClangCompiler.