Skip to content

[Dependency Scanning] Collect and report each module dependency's Link Libraries #73907

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

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 24, 2024

No description provided.

@artemcm artemcm force-pushed the ExplicitAutoLinkScanner branch from 2b24dae to 51fb270 Compare May 25, 2024 00:15
@artemcm artemcm marked this pull request as ready for review May 28, 2024 17:58
@artemcm
Copy link
Contributor Author

artemcm commented May 28, 2024

std::function<void(const LinkLibrary&)> RegistrationCallback) {
if (Target.isOSDarwin())
RegistrationCallback(LinkLibrary("c++", LibraryKind::Library));
else if (Target.isOSLinux())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought Android used libc++ and not libstdc++?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core logic here just moved from how it was in GenDecl.cpp. But @egorzhdan may know the answer.

@artemcm artemcm force-pushed the ExplicitAutoLinkScanner branch 2 times, most recently from 4fd42c8 to 04191c2 Compare May 28, 2024 19:55
@artemcm
Copy link
Contributor Author

artemcm commented May 28, 2024

@artemcm artemcm force-pushed the ExplicitAutoLinkScanner branch from 04191c2 to 6f5751a Compare May 29, 2024 18:21
@artemcm
Copy link
Contributor Author

artemcm commented May 29, 2024

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the idea that forceLinked library should be pass to linker as full path so linker will not drop it when nothing from it is referenced? (Might need to check linker semantics for all the supported platforms/linkers). Then we can drop FORCE_LINK symbols too when explicit auto link is used.

@@ -93,12 +95,10 @@ struct ModuleDependencyID {
std::string ModuleName;
ModuleDependencyKind Kind;
bool operator==(const ModuleDependencyID &Other) const {
return std::tie(ModuleName, Kind) ==
std::tie(Other.ModuleName, Other.Kind);
return std::tie(ModuleName, Kind) == std::tie(Other.ModuleName, Other.Kind);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: avoid re-formatting unchanged logic. This makes review and git blame hard.

@artemcm artemcm force-pushed the ExplicitAutoLinkScanner branch from 6f5751a to d064d30 Compare June 4, 2024 16:40
@artemcm
Copy link
Contributor Author

artemcm commented Jun 5, 2024

@artemcm artemcm force-pushed the ExplicitAutoLinkScanner branch from d064d30 to d708635 Compare June 5, 2024 17:59
@artemcm
Copy link
Contributor Author

artemcm commented Jun 5, 2024

@artemcm artemcm merged commit d2ed753 into swiftlang:main Jun 6, 2024
5 checks passed
@artemcm artemcm deleted the ExplicitAutoLinkScanner branch June 6, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants