-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Linking to a static library does not always include exported symbols #99721
Copy link
Copy link
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Similarly to #47384, statics in a static library that are marked as
usedare not included in the resulting binary if a non-inlined function is used in the same module.Example
This code can be found at
mkroening/rust-issue-99721.staticlib.rs:bin.rs:Build using:
Display static library notes:
Display binary notes:
If
note::dummyis madeinline(never), the symbol is included in the resulting binary: