summaryrefslogtreecommitdiff
path: root/compiler-rt/cmake
diff options
context:
space:
mode:
authorAlex Richardson <alexrichardson@google.com>2023-03-03 13:54:08 +0000
committerAlex Richardson <alexrichardson@google.com>2023-03-08 14:58:15 +0000
commit489bda6a9c0ec9d2644b7bb0c230294d38f7296e (patch)
treee3768c4afa6657e13bb6a07e8092778f86813bdf /compiler-rt/cmake
parentb7217a8fc94d33f44ec8a2e695e75f70a6eeea1e (diff)
downloadllvm-489bda6a9c0ec9d2644b7bb0c230294d38f7296e.tar.gz
[builtins] Only build float16/bfloat16 code if actually supported
When building compiler-rt builtins for x86_64 they library will by default also be built for i386. We unconditionally add the Float16 compile flags since the check for Float16 support will be done using x86_64 compiler flags, but i386 does not actually support it. Fix this by moving the COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_FLOAT16 checks to a per-target-architecture check inside the loop (using `check_c_source_compiles` and `cmake_{push,pop}_check_state`). Many of the checks in the builtin-config-ix file should probably also be changed to per-target-arch checks, but so far only the Float16 one has caused issues. This is an alternative to D136044 which added a special case for i386 FreeBSD. Fixes: https://github.com/llvm/llvm-project/issues/57224 Differential Revision: https://reviews.llvm.org/D145237
Diffstat (limited to 'compiler-rt/cmake')
-rw-r--r--compiler-rt/cmake/builtin-config-ix.cmake16
1 files changed, 0 insertions, 16 deletions
diff --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index 9f818499a076..e045c81a0f74 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -22,22 +22,6 @@ int foo(int x, int y) {
}
")
-builtin_check_c_compiler_source(COMPILER_RT_HAS_FLOAT16
-"
-_Float16 foo(_Float16 x) {
- return x;
-}
-"
-)
-
-builtin_check_c_compiler_source(COMPILER_RT_HAS_BFLOAT16
-"
-__bf16 foo(__bf16 x) {
- return x;
-}
-"
-)
-
builtin_check_c_compiler_source(COMPILER_RT_HAS_ASM_LSE
"
asm(\".arch armv8-a+lse\");