You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an object file is in the Frameworks build phase of a static library target, don't add it to both the command line and the link-file-list of the libtool task.
This matches the behavior for ld of only putting it in the link-file-list.
Also modify some tests to check this behavior.
rdar://136958525
Copy file name to clipboardExpand all lines: Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
+2-3
Original file line number
Diff line number
Diff line change
@@ -1530,9 +1530,8 @@ public final class LibtoolLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @u
1530
1530
}
1531
1531
1532
1532
case.object:
1533
-
// A static library can bring in the contents of a .o file.
1534
-
inputPaths.append(specifier.path)
1535
-
return[specifier.path.str]
1533
+
// Object files are added to linker inputs in the sources task producer and so end up in the link-file-list.
1534
+
return[]
1536
1535
1537
1536
case.framework:
1538
1537
// A static library can build against a framework, since the library in the framework could be a static library, which is valid, and we can't tell here whether it is or not. So we leave it to libtool to do the right thing here.
// Check that the task does *not* declare libStaticLib2.a as an input, since it is located via search paths. Some projects may have a file reference whose path does not refer to a file, but which relies on finding the library via search paths anyway.
// Check that the task does *not* contain a command line option to link Object.o (it will be in the LinkFileList instead, checked below), but that it *does* declare it as an input.
// Check that the task does *not* have a command line option to find libDynamicLib1.dylib, nor does it declare it as an input, because static libraries can't link against dynamic libraries. We presently don't emit a diagnostic for this - see LibtoolLinkerSpec.constructLinkerTasks() and <rdar://problem/34314195> for more.
0 commit comments