blob: 474c9fdae0a737a2150eb98bdc706f1e61c81bb5 [file] [log] [blame]
Chris Bieneman19c84512015-08-13 20:38:16 +00001# On OS X SDKs can be installed anywhere on the base system and xcode-select can
2# set the default Xcode to use. This function finds the SDKs that are present in
3# the current Xcode.
4function(find_darwin_sdk_dir var sdk_name)
5 # Let's first try the internal SDK, otherwise use the public SDK.
6 execute_process(
7 COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path
8 OUTPUT_VARIABLE var_internal
9 OUTPUT_STRIP_TRAILING_WHITESPACE
10 ERROR_FILE /dev/null
11 )
12 if("" STREQUAL "${var_internal}")
13 execute_process(
14 COMMAND xcodebuild -version -sdk ${sdk_name} Path
15 OUTPUT_VARIABLE var_internal
16 OUTPUT_STRIP_TRAILING_WHITESPACE
17 ERROR_FILE /dev/null
18 )
19 endif()
20 set(${var} ${var_internal} PARENT_SCOPE)
21endfunction()
22
23# There isn't a clear mapping of what architectures are supported with a given
24# target platform, but ld's version output does list the architectures it can
25# link for.
26function(darwin_get_toolchain_supported_archs output_var)
27 execute_process(
28 COMMAND ld -v
29 ERROR_VARIABLE LINKER_VERSION)
30
31 string(REGEX MATCH "configured to support archs: ([^\n]+)"
32 ARCHES_MATCHED "${LINKER_VERSION}")
33 if(ARCHES_MATCHED)
34 set(ARCHES "${CMAKE_MATCH_1}")
Filipe Cabecinhasd5e075d2015-08-19 16:23:19 +000035 message(STATUS "Got ld supported ARCHES: ${ARCHES}")
Chris Bieneman19c84512015-08-13 20:38:16 +000036 string(REPLACE " " ";" ARCHES ${ARCHES})
37 else()
38 # If auto-detecting fails, fall back to a default set
39 message(WARNING "Detecting supported architectures from 'ld -v' failed. Returning default set.")
40 set(ARCHES "i386;x86_64;armv7;armv7s;arm64")
41 endif()
42
43 set(${output_var} ${ARCHES} PARENT_SCOPE)
44endfunction()
45
46# This function takes an OS and a list of architectures and identifies the
47# subset of the architectures list that the installed toolchain can target.
48function(darwin_test_archs os valid_archs)
49 set(archs ${ARGN})
50 message(STATUS "Finding valid architectures for ${os}...")
51 set(SIMPLE_CPP ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.cpp)
Chris Bienemand4626792015-09-16 18:29:52 +000052 file(WRITE ${SIMPLE_CPP} "#include <iostream>\nint main() { std::cout << std::endl; return 0; }\n")
Chris Bieneman19c84512015-08-13 20:38:16 +000053
54 set(os_linker_flags)
55 foreach(flag ${DARWIN_${os}_LINKFLAGS})
56 set(os_linker_flags "${os_linker_flags} ${flag}")
57 endforeach()
58
59 # The simple program will build for x86_64h on the simulator because it is
60 # compatible with x86_64 libraries (mostly), but since x86_64h isn't actually
61 # a valid or useful architecture for the iOS simulator we should drop it.
62 if(${os} STREQUAL "iossim")
63 list(REMOVE_ITEM archs "x86_64h")
64 endif()
65
66 set(working_archs)
67 foreach(arch ${archs})
68
69 set(arch_linker_flags "-arch ${arch} ${os_linker_flags}")
70 try_compile(CAN_TARGET_${os}_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_CPP}
71 COMPILE_DEFINITIONS "-v -arch ${arch}" ${DARWIN_${os}_CFLAGS}
72 CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${arch_linker_flags}"
73 OUTPUT_VARIABLE TEST_OUTPUT)
74 if(${CAN_TARGET_${os}_${arch}})
75 list(APPEND working_archs ${arch})
76 endif()
77 endforeach()
78 set(${valid_archs} ${working_archs} PARENT_SCOPE)
79endfunction()
Chris Bienemanb0607602015-08-20 17:32:06 +000080
81# This function checks the host cpusubtype to see if it is post-haswell. Haswell
82# and later machines can run x86_64h binaries. Haswell is cpusubtype 8.
83function(darwin_filter_host_archs input output)
84 list_union(tmp_var DARWIN_osx_ARCHS ${input})
85 execute_process(
86 COMMAND sysctl hw.cpusubtype
87 OUTPUT_VARIABLE SUBTYPE)
88
89 string(REGEX MATCH "hw.cpusubtype: ([0-9]*)"
90 SUBTYPE_MATCHED "${SUBTYPE}")
91 set(HASWELL_SUPPORTED Off)
Chris Bieneman76d68912015-08-21 18:05:57 +000092 if(SUBTYPE_MATCHED)
93 if(${CMAKE_MATCH_1} GREATER 7)
Chris Bienemanb0607602015-08-20 17:32:06 +000094 set(HASWELL_SUPPORTED On)
95 endif()
96 endif()
97 if(NOT HASWELL_SUPPORTED)
98 list(REMOVE_ITEM tmp_var x86_64h)
99 endif()
100 set(${output} ${tmp_var} PARENT_SCOPE)
101endfunction()
Chris Bieneman66e02f02015-09-23 15:18:17 +0000102
Chris Bieneman66e02f02015-09-23 15:18:17 +0000103# Read and process the exclude file into a list of symbols
Chris Bieneman648eafc2015-09-25 23:29:03 +0000104function(darwin_read_list_from_file output_var file)
105 if(EXISTS ${file})
106 file(READ ${file} EXCLUDES)
107 string(REPLACE "\n" ";" EXCLUDES ${EXCLUDES})
108 set(${output_var} ${EXCLUDES} PARENT_SCOPE)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000109 endif()
110endfunction()
111
112# this function takes an OS, architecture and minimum version and provides a
113# list of builtin functions to exclude
Chris Bieneman82ebe892015-09-24 21:51:09 +0000114function(darwin_find_excluded_builtins_list output_var)
115 cmake_parse_arguments(LIB
116 ""
117 "OS;ARCH;MIN_VERSION"
118 ""
119 ${ARGN})
Chris Bieneman66e02f02015-09-23 15:18:17 +0000120
Chris Bieneman82ebe892015-09-24 21:51:09 +0000121 if(NOT LIB_OS OR NOT LIB_ARCH)
122 message(FATAL_ERROR "Must specify OS and ARCH to darwin_find_excluded_builtins_list!")
123 endif()
124
Chris Bieneman648eafc2015-09-25 23:29:03 +0000125 darwin_read_list_from_file(${LIB_OS}_BUILTINS
126 ${DARWIN_EXCLUDE_DIR}/${LIB_OS}.txt)
127 darwin_read_list_from_file(${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS
128 ${DARWIN_EXCLUDE_DIR}/${LIB_OS}-${LIB_ARCH}.txt)
Chris Bieneman82ebe892015-09-24 21:51:09 +0000129
130 if(LIB_MIN_VERSION)
131 file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${LIB_OS}*-${LIB_ARCH}.txt)
132 foreach(builtin_list ${builtin_lists})
133 string(REGEX MATCH "${LIB_OS}([0-9\\.]*)-${LIB_ARCH}.txt" VERSION_MATCHED "${builtin_list}")
134 if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS LIB_MIN_VERSION)
135 if(NOT smallest_version)
136 set(smallest_version ${CMAKE_MATCH_1})
137 elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version)
138 set(smallest_version ${CMAKE_MATCH_1})
139 endif()
Chris Bieneman66e02f02015-09-23 15:18:17 +0000140 endif()
Chris Bieneman82ebe892015-09-24 21:51:09 +0000141 endforeach()
142
143 if(smallest_version)
Chris Bieneman648eafc2015-09-25 23:29:03 +0000144 darwin_read_list_from_file(${LIB_ARCH}_${LIB_OS}_BUILTINS
145 ${DARWIN_EXCLUDE_DIR}/${LIB_OS}${smallest_version}-${LIB_ARCH}.txt)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000146 endif()
Chris Bieneman66e02f02015-09-23 15:18:17 +0000147 endif()
148
Chris Bieneman82ebe892015-09-24 21:51:09 +0000149 set(${output_var}
150 ${${LIB_ARCH}_${LIB_OS}_BUILTINS}
151 ${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS}
152 ${${LIB_OS}_BUILTINS} PARENT_SCOPE)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000153endfunction()
154
155# adds a single builtin library for a single OS & ARCH
Chris Bieneman765d76e2015-09-23 23:05:32 +0000156macro(darwin_add_builtin_library name suffix)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000157 cmake_parse_arguments(LIB
158 ""
159 "PARENT_TARGET;OS;ARCH"
Chris Bieneman765d76e2015-09-23 23:05:32 +0000160 "SOURCES;CFLAGS;DEFS"
Chris Bieneman66e02f02015-09-23 15:18:17 +0000161 ${ARGN})
Chris Bieneman765d76e2015-09-23 23:05:32 +0000162 set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}")
Chris Bieneman66e02f02015-09-23 15:18:17 +0000163 add_library(${libname} STATIC ${LIB_SOURCES})
164 set_target_compile_flags(${libname}
165 -isysroot ${DARWIN_${LIB_OS}_SYSROOT}
166 ${DARWIN_${LIB_OS}_BUILTIN_MIN_VER_FLAG}
167 ${LIB_CFLAGS})
Chris Bieneman765d76e2015-09-23 23:05:32 +0000168 set_property(TARGET ${libname} APPEND PROPERTY
169 COMPILE_DEFINITIONS ${LIB_DEFS})
Chris Bieneman66e02f02015-09-23 15:18:17 +0000170 set_target_properties(${libname} PROPERTIES
171 OUTPUT_NAME ${libname}${COMPILER_RT_OS_SUFFIX})
172 set_target_properties(${libname} PROPERTIES
173 OSX_ARCHITECTURES ${LIB_ARCH})
174
175 if(LIB_PARENT_TARGET)
176 add_dependencies(${LIB_PARENT_TARGET} ${libname})
177 endif()
Chris Bieneman765d76e2015-09-23 23:05:32 +0000178
Chris Bieneman36235332015-09-25 22:31:17 +0000179 list(APPEND ${LIB_OS}_${suffix}_libs ${libname})
180 list(APPEND ${LIB_OS}_${suffix}_lipo_flags -arch ${arch} $<TARGET_FILE:${libname}>)
Chris Bieneman765d76e2015-09-23 23:05:32 +0000181endmacro()
182
183function(darwin_lipo_libs name)
184 cmake_parse_arguments(LIB
185 ""
Chris Bieneman2d320d02015-09-25 23:55:53 +0000186 "PARENT_TARGET;OUTPUT_DIR"
Chris Bieneman765d76e2015-09-23 23:05:32 +0000187 "LIPO_FLAGS;DEPENDS"
188 ${ARGN})
Chris Bieneman2d320d02015-09-25 23:55:53 +0000189 add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a
Chris Bieneman765d76e2015-09-23 23:05:32 +0000190 COMMAND lipo -output
Chris Bieneman2d320d02015-09-25 23:55:53 +0000191 ${LIB_OUTPUT_DIR}/lib${name}.a
Chris Bieneman765d76e2015-09-23 23:05:32 +0000192 -create ${LIB_LIPO_FLAGS}
193 DEPENDS ${LIB_DEPENDS}
194 )
195 add_custom_target(${name}
Chris Bieneman2d320d02015-09-25 23:55:53 +0000196 DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a)
Chris Bieneman765d76e2015-09-23 23:05:32 +0000197 add_dependencies(${LIB_PARENT_TARGET} ${name})
Chris Bieneman2d320d02015-09-25 23:55:53 +0000198 install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a
Chris Bieneman72cc28c2015-09-25 22:39:19 +0000199 DESTINATION ${COMPILER_RT_INSTALL_PATH})
Chris Bieneman66e02f02015-09-23 15:18:17 +0000200endfunction()
201
Chris Bieneman25e1bdf2015-09-24 21:40:06 +0000202# Filter out generic versions of routines that are re-implemented in
203# architecture specific manner. This prevents multiple definitions of the
204# same symbols, making the symbol selection non-deterministic.
Chris Bienemanb850f312015-09-28 17:38:44 +0000205function(darwin_filter_builtin_sources output_var exclude_or_include excluded_list)
206 if(exclude_or_include STREQUAL "EXCLUDE")
207 set(filter_action GREATER)
208 set(filter_value -1)
209 elseif(exclude_or_include STREQUAL "INCLUDE")
210 set(filter_action LESS)
211 set(filter_value 0)
212 else()
213 message(FATAL_ERROR "darwin_filter_builtin_sources called without EXCLUDE|INCLUDE")
214 endif()
215
Chris Bieneman25e1bdf2015-09-24 21:40:06 +0000216 set(intermediate ${ARGN})
217 foreach (_file ${intermediate})
218 get_filename_component(_name_we ${_file} NAME_WE)
219 list(FIND ${excluded_list} ${_name_we} _found)
Chris Bienemanb850f312015-09-28 17:38:44 +0000220 if(_found ${filter_action} ${filter_value})
Chris Bieneman25e1bdf2015-09-24 21:40:06 +0000221 list(REMOVE_ITEM intermediate ${_file})
222 elseif(${_file} MATCHES ".*/.*\\.S")
223 get_filename_component(_name ${_file} NAME)
224 string(REPLACE ".S" ".c" _cname "${_name}")
225 list(REMOVE_ITEM intermediate ${_cname})
226 endif ()
227 endforeach ()
228 set(${output_var} ${intermediate} PARENT_SCOPE)
229endfunction()
230
Chris Bieneman66e02f02015-09-23 15:18:17 +0000231# Generates builtin libraries for all operating systems specified in ARGN. Each
232# OS library is constructed by lipo-ing together single-architecture libraries.
233macro(darwin_add_builtin_libraries)
Chris Bienemanbcc4ac92015-09-29 23:13:45 +0000234 set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes)
235
Chris Bienemana6e02022015-09-24 18:26:34 +0000236 if(CMAKE_CONFIGURATION_TYPES)
237 foreach(type ${CMAKE_CONFIGURATION_TYPES})
238 set(CMAKE_C_FLAGS_${type} -O3)
239 set(CMAKE_CXX_FLAGS_${type} -O3)
240 endforeach()
241 else()
242 set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -O3)
243 endif()
244
245 set(CMAKE_C_FLAGS "-fPIC -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
246 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
247 set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})
Chris Bieneman64dab722015-09-24 22:29:58 +0000248
249 set(PROFILE_SOURCES ../profile/InstrProfiling
250 ../profile/InstrProfilingBuffer
251 ../profile/InstrProfilingPlatformDarwin)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000252 foreach (os ${ARGN})
253 list_union(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH)
Chris Bieneman3ff8cb22015-09-28 22:20:25 +0000254 foreach (arch ${DARWIN_BUILTIN_ARCHS})
Chris Bieneman82ebe892015-09-24 21:51:09 +0000255 darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS
256 OS ${os}
257 ARCH ${arch}
258 MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER})
259
Chris Bienemanb850f312015-09-28 17:38:44 +0000260 darwin_filter_builtin_sources(filtered_sources
261 EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS
262 ${${arch}_SOURCES})
Chris Bieneman66e02f02015-09-23 15:18:17 +0000263
Chris Bieneman765d76e2015-09-23 23:05:32 +0000264 darwin_add_builtin_library(clang_rt builtins
Chris Bieneman66e02f02015-09-23 15:18:17 +0000265 OS ${os}
266 ARCH ${arch}
Chris Bieneman25e1bdf2015-09-24 21:40:06 +0000267 SOURCES ${filtered_sources}
Chris Bienemana6e02022015-09-24 18:26:34 +0000268 CFLAGS -arch ${arch}
Chris Bieneman66e02f02015-09-23 15:18:17 +0000269 PARENT_TARGET builtins)
Chris Bieneman66e02f02015-09-23 15:18:17 +0000270 endforeach()
271
Chris Bienemanf77c6a02015-09-28 22:18:31 +0000272 # Don't build cc_kext libraries for simulator platforms
273 if(NOT ${os} MATCHES ".*sim$")
274 foreach (arch ${DARWIN_BUILTIN_ARCHS})
Chris Bienemanc959a0b2015-09-28 23:09:46 +0000275 # By not specifying MIN_VERSION this only reads the OS and OS-arch lists.
276 # We don't want to filter out the builtins that are present in libSystem
277 # because kexts can't link libSystem.
278 darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS
279 OS ${os}
280 ARCH ${arch})
281
282 darwin_filter_builtin_sources(filtered_sources
283 EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS
284 ${${arch}_SOURCES})
285
Chris Bienemanf77c6a02015-09-28 22:18:31 +0000286 # In addition to the builtins cc_kext includes some profile sources
287 darwin_add_builtin_library(clang_rt cc_kext
288 OS ${os}
289 ARCH ${arch}
Chris Bienemanc959a0b2015-09-28 23:09:46 +0000290 SOURCES ${filtered_sources} ${PROFILE_SOURCES}
Chris Bienemanf77c6a02015-09-28 22:18:31 +0000291 CFLAGS -arch ${arch} -mkernel
292 DEFS KERNEL_USE
293 PARENT_TARGET builtins)
294 endforeach()
295 darwin_lipo_libs(clang_rt.cc_kext_${os}
296 PARENT_TARGET builtins
297 LIPO_FLAGS ${${os}_cc_kext_lipo_flags}
298 DEPENDS ${${os}_cc_kext_libs}
299 OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
300 endif()
301 endforeach()
302
303 # We put the x86 sim slices into the archives for their base OS
304 foreach (os ${ARGN})
305 if(NOT ${os} MATCHES ".*sim$")
306 darwin_lipo_libs(clang_rt.${os}
307 PARENT_TARGET builtins
308 LIPO_FLAGS ${${os}_builtins_lipo_flags} ${${os}sim_builtins_lipo_flags}
309 DEPENDS ${${os}_builtins_libs} ${${os}sim_builtins_libs}
310 OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
311 endif()
Chris Bieneman66e02f02015-09-23 15:18:17 +0000312 endforeach()
Chris Bienemanbcc4ac92015-09-29 23:13:45 +0000313 darwin_add_embedded_builtin_libraries()
Chris Bieneman66e02f02015-09-23 15:18:17 +0000314endmacro()
315
Chris Bienemanbcc4ac92015-09-29 23:13:45 +0000316function(darwin_add_embedded_builtin_libraries)
317 set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded)
318 if(CMAKE_CONFIGURATION_TYPES)
319 foreach(type ${CMAKE_CONFIGURATION_TYPES})
320 set(CMAKE_C_FLAGS_${type} -Oz)
321 set(CMAKE_CXX_FLAGS_${type} -Oz)
322 endforeach()
323 else()
324 set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -Oz)
325 endif()
326
327 set(CMAKE_C_FLAGS "-Wall -fomit-frame-pointer -ffreestanding")
328 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
329 set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})
330
331 set(SOFT_FLOAT_FLAG -mfloat-abi=soft)
332 set(HARD_FLOAT_FLAG -mfloat-abi=hard)
333
334 set(PIC_FLAG_ -fPIC)
335 set(STATIC_FLAG -static)
336
337 set(DARWIN_macho_embedded_ARCHS armv6m armv7m armv7em armv7 i386 x86_64)
338
339 set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
340 ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
341
342 set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
343 set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7 i386 x86_64)
344
345 darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt)
346 darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt)
347 darwin_read_list_from_file(arm_FUNCTIONS ${MACHO_SYM_DIR}/arm.txt)
348 darwin_read_list_from_file(i386_FUNCTIONS ${MACHO_SYM_DIR}/i386.txt)
349
350
351 set(armv6m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS})
352 set(armv7m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS})
353 set(armv7em_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS})
354 set(armv7_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS})
355 set(i386_FUNCTIONS ${common_FUNCTIONS} ${i386_FUNCTIONS})
356 set(x86_64_FUNCTIONS ${common_FUNCTIONS})
357
358 foreach(arch ${DARWIN_macho_embedded_ARCHS})
359 darwin_filter_builtin_sources(${arch}_filtered_sources
360 INCLUDE ${arch}_FUNCTIONS
361 ${${arch}_SOURCES})
362 if(NOT ${arch}_filtered_sources)
363 message("${arch}_SOURCES: ${${arch}_SOURCES}")
364 message("${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}")
365 message(FATAL_ERROR "Empty filtered sources!")
366 endif()
367 endforeach()
368
369 foreach(float_type SOFT HARD)
370 foreach(type PIC STATIC)
371 string(TOLOWER "${float_type}_${type}" lib_suffix)
372 foreach(arch ${DARWIN_${float_type}_FLOAT_ARCHS})
373 set(DARWIN_macho_embedded_SYSROOT ${DARWIN_osx_SYSROOT})
374 if(${arch} MATCHES "^arm")
375 set(DARWIN_macho_embedded_SYSROOT ${DARWIN_ios_SYSROOT})
376 endif()
377 darwin_add_builtin_library(clang_rt ${lib_suffix}
378 OS macho_embedded
379 ARCH ${arch}
380 SOURCES ${${arch}_filtered_sources}
381 CFLAGS -arch ${arch} ${${type}_FLAG} ${${float_type}_FLOAT_FLAG}
382 PARENT_TARGET builtins)
383 endforeach()
384 foreach(lib ${macho_embedded_${lib_suffix}_libs})
385 set_target_properties(${lib} PROPERTIES LINKER_LANGUAGE C)
386 endforeach()
387 darwin_lipo_libs(clang_rt.${lib_suffix}
388 PARENT_TARGET builtins
389 LIPO_FLAGS ${macho_embedded_${lib_suffix}_lipo_flags}
390 DEPENDS ${macho_embedded_${lib_suffix}_libs}
391 OUTPUT_DIR ${DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR})
392 endforeach()
393 endforeach()
394endfunction()