[Autolink Extract] Keep a set of linker flags instead of vector

Otherwise we can duplicate linker flags across input binaries, which can result in very large linkerr invocation commands.

Resolves https://github.com/apple/swift/issues/58380
This commit is contained in:
Artem Chikin
2022-05-10 14:05:03 -07:00
parent 415c5c133d
commit 10a187d2ad
2 changed files with 35 additions and 9 deletions

View File

@@ -1,10 +1,16 @@
// RUN: %empty-directory(%t)
// RUN: %target-swiftc_driver -emit-module -emit-module-path %t/empty.swiftmodule -module-name empty -module-link-name empty %S/empty.swift
// RUN: %target-swiftc_driver -c %s -I %t -o %t/import_experimental.o
// RUN: %target-swift-autolink-extract %t/import_experimental.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
// RUN: %target-swiftc_driver -c %s -I %t -o %t/import_experimental_again.o
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix UNIQUE %s
// REQUIRES: autolink-extract
// UNIQUE-COUNT-1: -lempty
// UNIQUE-COUNT-1: -lswiftCore
// CHECK-elf-DAG: -lswiftCore
// CHECK-elf-DAG: -lempty