Skip to content

Update list of Swift runtime libraries to be de-duplicated, so the autolink-extract tool doesn't repeat them over and over again #76224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024
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
7 changes: 2 additions & 5 deletions lib/DriverTool/autolink_extract_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
"-lswiftCore",
"-lswift_Concurrency",
"-lswift_StringProcessing",
"-lswift_RegexBuilder",
"-lswiftRegexBuilder",
"-lswift_RegexParser",
"-lswift_Backtracing",
"-lswiftGlibc",
Expand All @@ -246,12 +246,9 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
"-lcurl",
"-lxml2",
"-luuid",
"-lTesting",
// XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432)
"-lXCTest",
// ICU Swift runtime libs
"-licui18nswift",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note - I did not remove ICU from the swift 6 toolchain, so if we do end up cherry picking this back to swift 6 we'll likely want to keep these in

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should go the other way and cherry-pick your #75262 also with these pulls for Swift 6.0. 😄

Those libraries are now entirely unused, with nothing linking to them:

> ag --search-binary libicu swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9
Binary file swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicui18nswift.so.69.1 matches.

Binary file swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicudataswift.so.69.1 matches.

Binary file swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicuucswift.so.69.1 matches.

and we can shave 35 MB, about 1%, off the size of the Swift toolchain by cleaning that out:

> du -sk swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicu*1
28004   swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicudataswift.so.69.1
4228    swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicui18nswift.so.69.1
2452    swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a-ubi9/usr/lib/swift/linux/libicuucswift.so.69.1

"-licuucswift",
"-licudataswift",
// Common-use ordering-agnostic Linux system libs
"-lm",
"-lpthread",
Expand Down