Skip to content

Commit 72427ee

Browse files
committed
Build: create static libraries explicitly with libtool.
This matches the implementation of the static linker in swift-driver, which always adds the explicit `-static`. https://github.com/apple/swift-driver/blob/caa81e560362a4e14034cd4502114d03e45ea261/Sources/SwiftDriver/Jobs/DarwinToolchain%2BLinkerSupport.swift#L95-L102
1 parent bd6487b commit 72427ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Build/BuildPlan.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
13871387
return [librarian, "/LIB", "/OUT:\(binaryPath.pathString)", "@\(linkFileListPath.pathString)"]
13881388
}
13891389
if triple.isDarwin(), librarian.hasSuffix("libtool") {
1390-
return [librarian, "-o", binaryPath.pathString, "@\(linkFileListPath.pathString)"]
1390+
return [librarian, "-static", "-o", binaryPath.pathString, "@\(linkFileListPath.pathString)"]
13911391
}
13921392
return [librarian, "crs", binaryPath.pathString, "@\(linkFileListPath.pathString)"]
13931393
}

0 commit comments

Comments
 (0)