Skip to content

Commit 37d11c9

Browse files
[wasm][build] Skip wasi-libc symbol check step to support LLVM 17
1 parent c143d1e commit 37d11c9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

utils/swift_build_support/swift_build_support/products/wasisysroot.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,23 @@ def build(self, host_target):
4848
llvm_build_dir = os.path.join('..', build_root, '%s-%s' % ('llvm', host_target))
4949
build_jobs = self.args.build_jobs or multiprocessing.cpu_count()
5050

51+
sysroot_build_dir = WASILibc.sysroot_build_path(build_root, host_target)
52+
# FIXME: Manually create an empty dir that is usually created during
53+
# check-symbols. The directory is required during sysroot installation step.
54+
os.makedirs(os.path.join(sysroot_build_dir, "share"), exist_ok=True)
55+
5156
shell.call([
5257
'make', 'install',
5358
'-j', str(build_jobs),
59+
# FIXME: wasi-libc's pre-defined macro list does not expect
60+
# `__FPCLASS_XXX`, which is introduced by the LLVM 17, yet.
61+
# So skip the symbol check step by treating the phony target
62+
# as very old file.
63+
# https://github.com/llvm/llvm-project/commit/7dd387d2971d7759cadfffeb2082439f6c7ddd49
64+
'--old-file=check-symbols',
5465
'-C', self.source_dir,
5566
'OBJDIR=' + os.path.join(self.build_dir, 'obj'),
56-
'SYSROOT=' + WASILibc.sysroot_build_path(build_root, host_target),
67+
'SYSROOT=' + sysroot_build_dir,
5768
'INSTALL_DIR=' + WASILibc.sysroot_install_path(build_root),
5869
'CC=' + os.path.join(llvm_build_dir, 'bin', 'clang'),
5970
'AR=' + os.path.join(llvm_build_dir, 'bin', 'llvm-ar'),

0 commit comments

Comments
 (0)