Skip to content

Commit dbf2c15

Browse files
committed
Revert "Merge pull request #64312 from gwynne/patch-2"
This reverts commit 1b64e76, reversing changes made to 5ef25e7.
1 parent dd813af commit dbf2c15

File tree

1 file changed

+12
-48
lines changed

1 file changed

+12
-48
lines changed

lib/DriverTool/autolink_extract_main.cpp

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -243,50 +243,16 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
243243
std::vector<std::string> LinkerFlags;
244244

245245
// Keep track of whether we've already added the common
246-
// Swift libraries that usually have autolink directives
247-
// in most object files
248-
249-
std::vector<std::string> SwiftRuntimeLibsOrdered = {
250-
// Common Swift runtime libs
251-
"-lswiftSwiftOnoneSupport",
252-
"-lswiftCore",
253-
"-lswift_Concurrency",
254-
"-lswift_StringProcessing",
255-
"-lswift_RegexBuilder",
256-
"-lswift_RegexParser",
257-
"-lswift_Backtracing",
258-
"-lswiftGlibc",
259-
"-lBlocksRuntime",
260-
// Dispatch-specific Swift runtime libs
261-
"-ldispatch",
262-
"-lDispatchStubs",
263-
"-lswiftDispatch",
264-
// CoreFoundation and Foundation Swift runtime libs
265-
"-lCoreFoundation",
266-
"-lFoundation",
267-
"-lFoundationNetworking",
268-
"-lFoundationXML",
269-
// Foundation support libs
270-
"-lcurl",
271-
"-lxml2",
272-
"-luuid",
273-
// XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432)
274-
"-lXCTest",
275-
// ICU Swift runtime libs
276-
"-licui18nswift",
277-
"-licuucswift",
278-
"-licudataswift",
279-
// Common-use ordering-agnostic Linux system libs
280-
"-lm",
281-
"-lpthread",
282-
"-lutil",
283-
"-ldl",
284-
"-lz",
246+
// Swift libraries that ususally have autolink directives
247+
// in most object fiels
248+
std::unordered_map<std::string, bool> SwiftRuntimeLibraries = {
249+
{"-lswiftSwiftOnoneSupport", false},
250+
{"-lswiftCore", false},
251+
{"-lswift_Concurrency", false},
252+
{"-lswift_StringProcessing", false},
253+
{"-lswift_RegexParser", false},
254+
{"-lswift_Backtracing", false},
285255
};
286-
std::unordered_map<std::string, bool> SwiftRuntimeLibraries;
287-
for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) {
288-
SwiftRuntimeLibraries[RuntimeLib] = false;
289-
}
290256

291257
// Extract the linker flags from the objects.
292258
for (const auto &BinaryFileName : Invocation.getInputFilenames()) {
@@ -323,11 +289,9 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
323289
OutOS << Flag << '\n';
324290
}
325291

326-
for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) {
327-
auto entry = SwiftRuntimeLibraries.find(RuntimeLib);
328-
if (entry != SwiftRuntimeLibraries.end() && entry->second) {
329-
OutOS << entry->first << '\n';
330-
}
292+
for (const auto &RuntimeLib : SwiftRuntimeLibraries) {
293+
if (RuntimeLib.second)
294+
OutOS << RuntimeLib.first << '\n';
331295
}
332296

333297

0 commit comments

Comments
 (0)