[Explicit Module Builds] Adopt dependency scanner Link Libraries support#1622
[Explicit Module Builds] Adopt dependency scanner Link Libraries support#1622artemcm merged 1 commit intoswiftlang:mainfrom
Conversation
artemcm
commented
May 24, 2024
- Adopt new libSwiftScan API to query link libraries for each module dependency
- Introduce '-explicit-auto-linking' to turn explicit dependency link library information into flags passed directly to the linker invocation
efa6ef1 to
34ce383
Compare
34ce383 to
9354e07
Compare
|
@swift-ci test |
cachemeifyoucan
left a comment
There was a problem hiding this comment.
Looks good in general from swift-driver side. Need to double check the swift side.
| #include <stdint.h> | ||
|
|
||
| #define SWIFTSCAN_VERSION_MAJOR 0 | ||
| #define SWIFTSCAN_VERSION_MINOR 6 |
There was a problem hiding this comment.
Can we check if we bump this, we are not missing any APIs that in the range of 7-9?
| } | ||
| } | ||
|
|
||
| for linkLibrary in allLinkLibraries { |
There was a problem hiding this comment.
I don't know the corresponding scanner change. Does the library here guaranteed to be found by linker? Also does force-linking does anything in the link here in logics? Maybe considering just pass force-linked library with full path (so linker can't drop them) and stop emitting force-linking symbols.
There was a problem hiding this comment.
The library is not guaranteed to be found, no. On Darwin the linker treats load directives for auto-linked libraries and frameworks as essentially "optional".
On non-Darwin today we just end up with a collection of -l flags via swift-autolink-extract, so the behavior introduced here would be identical.
I'd like to still add this new behavior behind a flag in this PR, and consider the optionality of load directives and determining whether the linked binary exists separately.
Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift
Outdated
Show resolved
Hide resolved
9354e07 to
34f60a2
Compare
|
@swift-ci test |
- Adopt new libSwiftScan API to query link libraries for each module dependency - Introduce '-explicit-auto-linking' to turn explicit dependency link library information into flags passed directly to the linker invocation
34f60a2 to
6646c38
Compare
|
@swift-ci test |
|
@swift-ci test Windows platform |