-
Notifications
You must be signed in to change notification settings - Fork 199
[Explicit Module Builds] Adopt dependency scanner Link Libraries support #1622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general from swift-driver side. Need to double check the swift side.
@@ -18,7 +18,7 @@ | |||
#include <stdint.h> | |||
|
|||
#define SWIFTSCAN_VERSION_MAJOR 0 | |||
#define SWIFTSCAN_VERSION_MINOR 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |