Commit e0ffaab
[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: #57224
Differential Revision: https://reviews.llvm.org/D145237
(cherry picked from commit 489bda6)1 parent c1949c6 commit e0ffaab
File tree
2 files changed
+18
-24
lines changed- compiler-rt
- cmake
- lib/builtins
2 files changed
+18
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 25 | | |
42 | 26 | | |
43 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 194 | + | |
| 195 | + | |
197 | 196 | | |
198 | 197 | | |
199 | | - | |
200 | | - | |
| 198 | + | |
201 | 199 | | |
202 | 200 | | |
203 | 201 | | |
| |||
747 | 745 | | |
748 | 746 | | |
749 | 747 | | |
750 | | - | |
751 | | - | |
752 | 748 | | |
753 | 749 | | |
754 | 750 | | |
| |||
780 | 776 | | |
781 | 777 | | |
782 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
783 | 782 | | |
| 783 | + | |
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
802 | 811 | | |
803 | 812 | | |
804 | 813 | | |
| |||
833 | 842 | | |
834 | 843 | | |
835 | 844 | | |
| 845 | + | |
836 | 846 | | |
837 | 847 | | |
838 | 848 | | |
| |||
0 commit comments