-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
dylib shared libraries will not make public symbols that may be necessary to link inlined code #65610
Copy link
Copy link
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When a
dylibcrate has a publicinline(always)functions in it that use, as an implementation, other, private functions, using these public functions from other crates will fail with linkage errors because we fail to "export" the private functions.An example project can be seen here. In this example the
driverdylib crate privatelyexterns a symbol from a static C library and uses it to implement aninline(always)interface/wrapper. Theusercrate then attempts to use theinline(always)wrapper, but linking fails with an error such as this:When inspecting the
libdriver.sowe can see that the extern symbol does indeed exist but is "private":I think we might be un-exporting items too aggressively here. cc @michaelwoerister @oli-obk
Blocks #55617
Regression from 1.36.0 (example builds successfully) to 1.37 (example fails to build).