linkers: Fix detection of link arguments to Clang(-cl) + MSVC#12144
Merged
jpakkane merged 4 commits intomesonbuild:masterfrom Apr 4, 2024
Merged
Conversation
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
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
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.