[swift][AutoLinkExtract] Don't add autolink hint for frameworks. (#65051)

Default system linkers on non-Darwin platforms do not support the `-framework`
argument for framework linking. This change updates autolinking to not emit
`-framework` into the .o _swift1_autolink_entries metadata when there is no
native linker support.

This is related to rdar://106578342.
This commit is contained in:
Juergen Ributzka
2023-04-14 09:15:05 -07:00
committed by GitHub
parent 539fc69e1e
commit 17c5010d0b
5 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1 @@
extern int APIFromLinkFramework;

View File

@@ -0,0 +1,4 @@
framework module Link {
umbrella header "Link.h"
export *
}

View File

@@ -0,0 +1,11 @@
// RUN: %empty-directory(%t)
// RUN: %target-swiftc_driver -c %s -F %S/Inputs/Frameworks -o %t/import_framework.o
// RUN: %target-swift-autolink-extract %t/import_framework.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
// REQUIRES: autolink-extract
// CHECK-elf-NOT: Link
// CHECK-coff-NOT: Link
import Link
_ = Link.APIFromLinkFramework