File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -522,7 +522,8 @@ void SILLinkerVisitor::visitGlobalAddrInst(GlobalAddrInst *GAI) {
522522 // In Embedded Swift, we want to actually link globals from other modules too,
523523 // so strip "external" from the linkage.
524524 SILGlobalVariable *G = GAI->getReferencedGlobal ();
525- G->setLinkage (stripExternalFromLinkage (G->getLinkage ()));
525+ if (G->isDefinition ())
526+ G->setLinkage (stripExternalFromLinkage (G->getLinkage ()));
526527}
527528
528529// ===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change @@ -21,8 +21,12 @@ public func publicFuncInAModule() {
2121@usableFromInline
2222internal func internalFuncInAModule( ) {
2323 some_c_api ( )
24+ _ = globalVariable
2425}
2526
27+ @_extern ( c)
28+ var globalVariable : Int
29+
2630// BEGIN Main.swift
2731
2832import MyModule
You can’t perform that action at this time.
0 commit comments