forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 334
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
[compiler-rt] Fix detecting _Float16 support for secondary targets (#117813) #10366
Merged
etcwilde
merged 2 commits into
swiftlang:stable/20240723
from
etcwilde:ewilde/fix-float16-detection
Apr 7, 2025
Merged
[compiler-rt] Fix detecting _Float16 support for secondary targets (#117813) #10366
etcwilde
merged 2 commits into
swiftlang:stable/20240723
from
etcwilde:ewilde/fix-float16-detection
Apr 7, 2025
Conversation
This file contains 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
@swift-ci please test |
macOS failure:
|
@swift-ci please test macOS |
The cherry-pick doesn't pass all of the flags, only the first two. I have llvm#133952 posted to LLVM upstream that will pass all of the flags to the try-compile. I'll cherry-pick that one onto this PR once I get it landed. |
…lvm#117813) It turns out we were not passing -m32 to the check_c_source_compiles() invocation since CMAKE_REQUIRE_FLAGS needs to be string separated list and we were passing a ;-separated CMake list which appears to be parsed by CMake as 'ignore all arguments beyond the first'. Fix this by transforming the list to a command line first. With this change, Clang 17 no longer claims to support _Float16 for i386. (cherry picked from commit a4c8ef0)
) The try-compile mechanism requires that `CMAKE_REQUIRED_FLAGS` is a space-separated string instead of a list of flags. The original code expanded `BUILTIN_FLAGS` into `CMAKE_REQUIRED_FLAGS` as a space-separated string and then would overwrite `CMAKE_REQUIRED_FLAGS` with `TARGET_${arch}_CFLAGS` prepended to the unexpanded `BUILTIN_CFLAGS_${arch}`. This resulted in the first two arguments being passed into the try-compile invocation, but dropping the other arguments listed in `BUILTIN_CFLAGS_${arch}`. This patch appends `TARGET_${arch}_CFLAGS` and `BUILTIN_CFLAGS_${arch}` to `CMAKE_REQUIRED_FLAGS` before expanding CMAKE_REQUIRED_FLAGS as a space-separated string. This passes any pre-set required flags, in addition to all of the builtin and target flags to the Float16 detection. (cherry picked from commit 0d3f5ec)
e5eae76
to
e958952
Compare
@swift-ci please test |
edymtt
approved these changes
Apr 7, 2025
compnerd
approved these changes
Apr 7, 2025
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.
Cherry-picking from llvm#117813 and llvm#133952
And to pass all of the required flags:
(cherry picked from commit a4c8ef0 and commit 0d3f5ec)