[🍒6.2]: [compiler-rt] Fix detecting _Float16 support for secondary targets #10446
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-picked from: #10366
Which is a cherry-pick of: llvm#117813 and llvm#133952
This fixes the float16 detection when building compiler-rt, which is required for building on FreeBSD.
This change fixes how arguments are passed into the try-compile used to determine whether the platform that compiler-rt is being built for has Float16 capabilities. This ensures that all of the required flags are actually passed into the try-compile instead of only passing the first.
This impacts how compiler-rt detects whether the platform has support for Float16 and BFloat16.
This affects how the build system detects Float16 support when compiling for the specified platform. If this is wrong, compiler-rt fails to compile.
LLVM Testing. Local verification that compiler-rt builds.
Verified that the compiler-rt build as part of the Swift build reports that the Float16/BFloat16 type check fails for arm64, arm64e, x86_64h, x86_64, and i386, as it does prior to this change. Given that the configuration is the same, this has no impact on the Apple builds.