@@ -100,7 +100,6 @@ function(darwin_get_toolchain_supported_archs output_var)
100
100
message (WARNING "Detecting supported architectures from 'ld -v' failed. Returning default set." )
101
101
set (ARCHES "i386;x86_64;armv7;armv7s;arm64" )
102
102
endif ()
103
-
104
103
set (${output_var} ${ARCHES} PARENT_SCOPE )
105
104
endfunction ()
106
105
@@ -135,7 +134,7 @@ function(darwin_test_archs os valid_archs)
135
134
endif ()
136
135
endif ()
137
136
138
- # The simple program will build for x86_64h on the simulator because it is
137
+ # The simple program will build for x86_64h on the simulator because it is
139
138
# compatible with x86_64 libraries (mostly), but since x86_64h isn't actually
140
139
# a valid or useful architecture for the iOS simulator we should drop it.
141
140
if (${os} MATCHES "^(iossim|tvossim|watchossim)$" )
@@ -154,7 +153,7 @@ function(darwin_test_archs os valid_archs)
154
153
155
154
set (working_archs )
156
155
foreach (arch ${archs} )
157
-
156
+
158
157
set (arch_linker_flags "-arch ${arch} ${os_linker_flags} " )
159
158
if (TEST_COMPILE_ONLY )
160
159
# `-w` is used to surpress compiler warnings which `try_compile_only()` treats as an error.
@@ -269,7 +268,7 @@ function(darwin_find_excluded_builtins_list output_var)
269
268
${DARWIN_EXCLUDE_DIR} /${LIB_OS}${smallest_version}-${LIB_ARCH}.txt )
270
269
endif ()
271
270
endif ()
272
-
271
+
273
272
set (${output_var}
274
273
${${LIB_ARCH}_${LIB_OS}_BUILTINS}
275
274
${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS}
@@ -447,7 +446,15 @@ macro(darwin_add_builtin_libraries)
447
446
OS ${os}
448
447
ARCH ${arch}
449
448
MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER} )
450
-
449
+ check_c_source_compiles ("_Float16 foo(_Float16 x) { return x; }"
450
+ COMPILER_RT_HAS_${arch}_FLOAT16 )
451
+ append_list_if (COMPILER_RT_HAS_${arch}_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch} )
452
+ check_c_source_compiles ("__bf16 foo(__bf16 x) { return x; }"
453
+ COMPILER_RT_HAS_${arch}_BFLOAT16 )
454
+ # Build BF16 files only when "__bf16" is available.
455
+ if (COMPILER_RT_HAS_${arch}_BFLOAT16 )
456
+ list (APPEND ${arch} _SOURCES ${BF16_SOURCES} )
457
+ endif ()
451
458
darwin_filter_builtin_sources (filtered_sources
452
459
${os} _${arch}
453
460
EXCLUDE ${arch} _${os}_EXCLUDED_BUILTINS
@@ -548,7 +555,7 @@ macro(darwin_add_embedded_builtin_libraries)
548
555
${COMPILER_RT_OUTPUT_LIBRARY_DIR} /macho_embedded )
549
556
set (DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
550
557
${COMPILER_RT_INSTALL_LIBRARY_DIR} /macho_embedded )
551
-
558
+
552
559
set (CFLAGS_armv7 -target thumbv7-apple-darwin-eabi )
553
560
set (CFLAGS_i386 -march=pentium )
554
561
0 commit comments