Skip to content

Commit b554839

Browse files
al45tairMaxDesiatov
authored andcommitted
[Concurrency][Embedded] Add some extra Concurrency functions.
We need to explicitly link `swift_asyncMainDrainQueueImpl` and `swift_createDefaultExecutors` since those two do not have Concurrency hooks and so aren't linked automatically by the macro-processing code.
1 parent 5339dbf commit b554839

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/SILOptimizer/UtilityPasses/Link.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class SILLinker : public SILModuleTransform {
4848
// (swift_retain, etc.). Link them in so they can be referenced in IRGen.
4949
if (M.getOptions().EmbeddedSwift && LinkEmbeddedRuntime) {
5050
linkEmbeddedRuntimeFromStdlib();
51-
linkEmbeddedConcurrencyHookImpls();
51+
linkEmbeddedConcurrency();
5252
}
5353

5454
// In embedded Swift, we need to explicitly link any @_used globals and
@@ -81,7 +81,7 @@ class SILLinker : public SILModuleTransform {
8181
linkEmbeddedRuntimeFunctionByName("swift_retainCount", { RefCounting });
8282
}
8383

84-
void linkEmbeddedConcurrencyHookImpls() {
84+
void linkEmbeddedConcurrency() {
8585
using namespace RuntimeConstants;
8686

8787
// Note: we ignore errors here, because, depending on the exact situation
@@ -99,6 +99,11 @@ class SILLinker : public SILModuleTransform {
9999
linkUsedFunctionByName(#NAME "Impl", SILLinkage::HiddenExternal)
100100

101101
#include "swift/Runtime/ConcurrencyHooks.def"
102+
103+
linkUsedFunctionByName("swift_task_asyncMainDrainQueueImpl",
104+
SILLinkage::HiddenExternal);
105+
linkUsedFunctionByName("swift_createDefaultExecutors",
106+
SILLinkage::HiddenExternal);
102107
}
103108

104109
void linkEmbeddedRuntimeFunctionByName(StringRef name,

0 commit comments

Comments
 (0)