-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
-Zdefault-hidden-visibility causes linking errors due to intrinsic-related calls #123427
Copy link
Copy link
Open
Open
Copy link
Labels
A-intrinsicsArea: IntrinsicsArea: IntrinsicsA-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.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.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-intrinsicsArea: IntrinsicsArea: IntrinsicsA-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.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.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
-Zdefault-hidden-visibilityshould affect symbols defined in a crate. References to externally-defined symbols should not have hidden visibility.Certain intrinsics such as
compare_bytesmay emit calls tolibc.sofunctions (e.g.memcmp). When-Zdefault-hidden-visibilityis used, these symbol references are hidden. This leads to linking errors since an undefined hidden symbol cannot be resolved to a symbol in a dynamic library.Repro:
error:
The flag was added in #118417; MCP rust-lang/compiler-team#656
While this flag isn't really intended for use on
bincrates, I suspect crates downstream of anrliborstaticlibwould have the same errors.