Skip to content

Commit 6530236

Browse files
committed
Update wasmkit toolchain build to emit universal on macOS to fix #82390
[platform_args] has platform variants of SwiftPM wasmkit build command: - unchanged: non-macOS + set_installation_rpath -> rpath config - added: macOS -> universal binaries using --arch side effect ok?: binary path changes are captured by '--show-bin-path'
1 parent 374026f commit 6530236

File tree

1 file changed

+8
-5
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+8
-5
lines changed

utils/swift_build_support/swift_build_support/products/wasmkit.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,26 @@ def run_swift_build(host_target, product, swiftpm_package_product_name, set_inst
7777
# Building with the freshly-built SwiftPM
7878
swift_build = os.path.join(product.install_toolchain_path(host_target), "bin", "swift-build")
7979

80-
build_os = host_target.split('-')[0]
81-
if set_installation_rpath and not host_target.startswith('macos'):
80+
if host_target.startswith('macos'):
81+
# Universal binary on macOS
82+
platform_args = ['--arch', 'x86_64', '--arch', 'arm64']
83+
elif set_installation_rpath:
8284
# Library rpath for swift, dispatch, Foundation, etc. when installing
83-
rpath_args = [
85+
build_os = host_target.split('-')[0]
86+
platform_args = [
8487
'--disable-local-rpath', '-Xswiftc', '-no-toolchain-stdlib-rpath',
8588
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/' + build_os
8689
]
8790
else:
88-
rpath_args = []
91+
platform_args = []
8992

9093
build_args = [
9194
swift_build,
9295
'--product', swiftpm_package_product_name,
9396
'--package-path', os.path.join(product.source_dir),
9497
'--build-path', product.build_dir,
9598
'--configuration', 'release',
96-
] + rpath_args
99+
] + platform_args
97100

98101
if product.args.verbose_build:
99102
build_args.append('--verbose')

0 commit comments

Comments
 (0)