Skip to content

Commit 91a2bf7

Browse files
author
Alessandro Patti
committed
Do not force multi-threaded mode with wmo
When multi-threaded mode is enabled, the compiler tries to generate one object file per source file. This makes us hit a known issue where linking static libraries fails in loading types metadata, raising `"failed to demangle superclass of MyClass from mangled name '<mangled name>'"`. Using single thread wmo makes the compiler generate a single object file, so all symbols are linked. Ref. https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes/swift_5_release_notes_for_xcode_10_2#3136859
1 parent f7f4c14 commit 91a2bf7

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

swift/internal/api.bzl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,6 @@ def _compile(
476476
* `swiftmodule`: The `.swiftmodule` file that was produced by the compiler.
477477
"""
478478

479-
# Force threaded mode for WMO builds, using the same number of cores that is
480-
# on a Mac Pro for historical reasons.
481-
# TODO(b/32571265): Generalize this based on platform and core count when an
482-
# API to obtain this is available.
483-
if _is_wmo(copts + swift_toolchain.command_line_copts, feature_configuration):
484-
# We intentionally don't use `+=` or `extend` here to ensure that a
485-
# copy is made instead of extending the original.
486-
copts = copts + ["-num-threads", "12"]
487-
488479
compile_reqs = declare_compile_outputs(
489480
actions = actions,
490481
copts = copts + swift_toolchain.command_line_copts,

0 commit comments

Comments
 (0)