Skip to content

Commit 3061564

Browse files
committed
[embedded] Disable autolinking in embedded Swift
1 parent 151d740 commit 3061564

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,9 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
14591459
// emit it into the IR of debugger expressions.
14601460
if (Context.LangOpts.DebuggerSupport)
14611461
return;
1462+
1463+
if (Context.LangOpts.hasFeature(Feature::Embedded))
1464+
return;
14621465

14631466
switch (linkLib.getKind()) {
14641467
case LibraryKind::Library: {

test/embedded/no-autolink.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
3+
// REQUIRES: VENDOR=apple
4+
// REQUIRES: OS=macosx
5+
6+
public func staticstring() -> StaticString {
7+
return "hello"
8+
}
9+
10+
// CHECK: !llvm.linker.options = !{}
11+
// CHECK-NOT: -lswiftCore

0 commit comments

Comments
 (0)