Skip to content

Update wasmkit toolchain build to emit universal binary on macOS to fix #82390 #82393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,26 @@ def run_swift_build(host_target, product, swiftpm_package_product_name, set_inst
# Building with the freshly-built SwiftPM
swift_build = os.path.join(product.install_toolchain_path(host_target), "bin", "swift-build")

build_os = host_target.split('-')[0]
if set_installation_rpath and not host_target.startswith('macos'):
if host_target.startswith('macos'):
# Universal binary on macOS
platform_args = ['--arch', 'x86_64', '--arch', 'arm64']
elif set_installation_rpath:
# Library rpath for swift, dispatch, Foundation, etc. when installing
rpath_args = [
build_os = host_target.split('-')[0]
platform_args = [
'--disable-local-rpath', '-Xswiftc', '-no-toolchain-stdlib-rpath',
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/' + build_os
]
else:
rpath_args = []
platform_args = []

build_args = [
swift_build,
'--product', swiftpm_package_product_name,
'--package-path', os.path.join(product.source_dir),
'--build-path', product.build_dir,
'--configuration', 'release',
] + rpath_args
] + platform_args

if product.args.verbose_build:
build_args.append('--verbose')
Expand Down