@@ -243,50 +243,16 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
243
243
std::vector<std::string> LinkerFlags;
244
244
245
245
// 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 },
285
255
};
286
- std::unordered_map<std::string, bool > SwiftRuntimeLibraries;
287
- for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) {
288
- SwiftRuntimeLibraries[RuntimeLib] = false ;
289
- }
290
256
291
257
// Extract the linker flags from the objects.
292
258
for (const auto &BinaryFileName : Invocation.getInputFilenames ()) {
@@ -323,11 +289,9 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
323
289
OutOS << Flag << ' \n ' ;
324
290
}
325
291
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 ' ;
331
295
}
332
296
333
297
0 commit comments