Support somewhat recent clang versions on Windows #15324
Merged
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.
Prior to clang 10.0.0,
clang-cl -v
apparently always appended some fine grained version information in parentheses[1]; this is no longer the case, so the build fails early because the compiler version could not be detected. Since we never used this fine grained version info, we no longer check for it.As of clang 13.0.0, the
/fallback
command option has been removed[2], so we only set the flag for older clang versions.[1] #11313 (comment)
[2] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#removed-compiler-flags
With these changes I've managed to have a successful minimal build (
--with-toolset=clang --disable-all --enable-cli
) with clang 18.1.8 on x64 Windows (didn't try x86 so far), if I setCFLAGS=-Wno-implicit-function-declaration
. I'm going to follow up with a patch for the undeclared functions.