@@ -142,10 +142,12 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
142
142
if not os .path .isfile (dest_lib_path ):
143
143
if os .path .isfile (host_lib_path ):
144
144
if _os == 'tvos' :
145
+ print ('{} -> {} (stripping i386)' .format (host_lib_path , dest_lib_path ))
145
146
self .copy_lib_stripping_architecture (host_lib_path ,
146
147
dest_lib_path ,
147
148
'i386' )
148
149
else :
150
+ print ('{} -> {}' .format (host_lib_path , dest_lib_path ))
149
151
shutil .copy (host_lib_path , dest_lib_path )
150
152
elif self .args .verbose_build :
151
153
print ('no file exists at {}' .format (host_lib_path ))
@@ -161,9 +163,11 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
161
163
if _os == 'tvos' :
162
164
# This is to avoid strip failures when generating
163
165
# a toolchain
166
+ print ('{} -> {} (stripping i386)' .format (host_sim_lib_path , dest_sim_lib_path ))
164
167
self .copy_lib_stripping_architecture (
165
168
host_sim_lib_path , dest_sim_lib_path , 'i386' )
166
169
else :
170
+ print ('{} -> {}' .format (host_sim_lib_path , dest_sim_lib_path ))
167
171
shutil .copy (host_sim_lib_path , dest_sim_lib_path )
168
172
169
173
elif os .path .isfile (host_lib_path ):
@@ -181,6 +185,7 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
181
185
shell .call (['lipo' , '-remove' , 'i386' , host_lib_path ,
182
186
'-output' , dest_sim_lib_path ])
183
187
else :
188
+ print ('{} -> {}' .format (host_lib_path , dest_sim_lib_path ))
184
189
shutil .copy (host_lib_path , dest_sim_lib_path )
185
190
elif self .args .verbose_build :
186
191
print ('no file exists at {}' , host_sim_lib_path )
@@ -195,6 +200,7 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
195
200
dest_lib_path = os .path .join (dest_builtins_dir , lib_name )
196
201
if not os .path .isfile (dest_lib_path ):
197
202
if os .path .isfile (host_lib_path ):
203
+ print ('{} -> {}' .format (host_lib_path , dest_lib_path ))
198
204
shutil .copy (host_lib_path , dest_lib_path )
199
205
elif self .args .verbose_build :
200
206
print ('no file exists at {}' .format (host_lib_path ))
@@ -286,6 +292,11 @@ def build(self, host_target):
286
292
llvm_cmake_options .define ('LLVM_ENABLE_LTO:STRING' , self .args .lto_type )
287
293
llvm_cmake_options .define ('COMPILER_RT_INTERCEPT_LIBDISPATCH' , 'ON' )
288
294
295
+ if system () == 'Darwin' :
296
+ # Ask for Mach-O cross-compilation builtins (for Embedded Swift)
297
+ llvm_cmake_options .define ('COMPILER_RT_FORCE_BUILD_BAREMETAL_MACHO_BUILTINS_ARCHS:STRING' ,
298
+ 'armv6 armv6m armv7 armv7m armv7em' )
299
+
289
300
llvm_enable_projects = ['clang' ]
290
301
291
302
if self .args .build_compiler_rt and \
0 commit comments