Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/DriverTool/autolink_extract_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
"-lswiftSynchronization",
"-lswiftGlibc",
"-lswiftAndroid",
"-lswiftWASILibc",
"-lBlocksRuntime",
// Dispatch-specific Swift runtime libs
"-ldispatch",
Expand All @@ -249,19 +250,30 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
"-lFoundationInternationalization",
"-lFoundationNetworking",
"-lFoundationXML",
"-l_CFXMLInterface",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a static-only CoreFoundation library: I thought we weren't supposed to publicly link these?

Copy link
Member Author

@kateinoigakukun kateinoigakukun Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, yes. They are static-only libraries and we static-link everything. They are not supposed to be imported at code, so they don't have their corresponding .swiftmodule but we still ship their archives. So those link options are embedded in the client of those private modules (in this case, FoundationXML.swiftmodule) through -public-autolink-library
https://github.com/swiftlang/swift-corelibs-foundation/blob/ec675206c8cd939fbd4783421ea07954dcb5e175/Sources/FoundationXML/CMakeLists.txt#L33-L47

"-l_FoundationCShims",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another static-only library, bit taken aback since the first time I'm seeing these listed here, sure you need this?

"-l_FoundationCollections",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, static-only, I guess you're static linking the runtime libraries much more for Wasm binaries?

// Foundation support libs
"-lcurl",
"-lxml2",
"-luuid",
"-lTesting",
// XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432)
"-lXCTest",
// swift-testing libraries
"-l_TestingInternals",
"-l_TestDiscovery",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see either of these in the linux SDK, Wasm only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are also static-only libraries, installed only when building swift-testing with BUILD_SHARED_LIBS=OFF.
https://github.com/swiftlang/swift-testing/blob/fa1e095b316b9925dd5cc7fafc5d67825a07cd52/Sources/_TestingInternals/CMakeLists.txt#L31

Other platform toolchains/SDKs don't have it because they always build it as shared libraries.

"-l_Testing_Foundation",
// Common-use ordering-agnostic Linux system libs
"-lm",
"-lpthread",
"-lutil",
"-ldl",
"-lz",
// Common-use ordering-agnostic WASI system libs
"-lwasi-emulated-getpid",
"-lwasi-emulated-mman",
"-lwasi-emulated-signal",
};
std::unordered_map<std::string, bool> SwiftRuntimeLibraries;
for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) {
Expand Down