Skip to content

Commit bd0c903

Browse files
committed
[embedded] Ask LLVM to build armv6 armv6m armv7 armv7m armv7em Mach-O builtins
1 parent 22db563 commit bd0c903

File tree

1 file changed

+11
-0
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+11
-0
lines changed

utils/swift_build_support/swift_build_support/products/llvm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
142142
if not os.path.isfile(dest_lib_path):
143143
if os.path.isfile(host_lib_path):
144144
if _os == 'tvos':
145+
print('{} -> {} (stripping i386)'.format(host_lib_path, dest_lib_path))
145146
self.copy_lib_stripping_architecture(host_lib_path,
146147
dest_lib_path,
147148
'i386')
148149
else:
150+
print('{} -> {}'.format(host_lib_path, dest_lib_path))
149151
shutil.copy(host_lib_path, dest_lib_path)
150152
elif self.args.verbose_build:
151153
print('no file exists at {}'.format(host_lib_path))
@@ -161,9 +163,11 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
161163
if _os == 'tvos':
162164
# This is to avoid strip failures when generating
163165
# a toolchain
166+
print('{} -> {} (stripping i386)'.format(host_sim_lib_path, dest_sim_lib_path))
164167
self.copy_lib_stripping_architecture(
165168
host_sim_lib_path, dest_sim_lib_path, 'i386')
166169
else:
170+
print('{} -> {}'.format(host_sim_lib_path, dest_sim_lib_path))
167171
shutil.copy(host_sim_lib_path, dest_sim_lib_path)
168172

169173
elif os.path.isfile(host_lib_path):
@@ -181,6 +185,7 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
181185
shell.call(['lipo', '-remove', 'i386', host_lib_path,
182186
'-output', dest_sim_lib_path])
183187
else:
188+
print('{} -> {}'.format(host_lib_path, dest_sim_lib_path))
184189
shutil.copy(host_lib_path, dest_sim_lib_path)
185190
elif self.args.verbose_build:
186191
print('no file exists at {}', host_sim_lib_path)
@@ -195,6 +200,7 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain(
195200
dest_lib_path = os.path.join(dest_builtins_dir, lib_name)
196201
if not os.path.isfile(dest_lib_path):
197202
if os.path.isfile(host_lib_path):
203+
print('{} -> {}'.format(host_lib_path, dest_lib_path))
198204
shutil.copy(host_lib_path, dest_lib_path)
199205
elif self.args.verbose_build:
200206
print('no file exists at {}'.format(host_lib_path))
@@ -286,6 +292,11 @@ def build(self, host_target):
286292
llvm_cmake_options.define('LLVM_ENABLE_LTO:STRING', self.args.lto_type)
287293
llvm_cmake_options.define('COMPILER_RT_INTERCEPT_LIBDISPATCH', 'ON')
288294

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+
289300
llvm_enable_projects = ['clang']
290301

291302
if self.args.build_compiler_rt and \

0 commit comments

Comments
 (0)