Skip to content

Commit 0588956

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 a0f0ff2 commit 0588956

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
@@ -477,15 +477,6 @@ def _compile(
477477
* `swiftmodule`: The `.swiftmodule` file that was produced by the compiler.
478478
"""
479479

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

0 commit comments

Comments
 (0)