Use Default visibility for rustc-generated C symbol declarations by davidlattimore · Pull Request #131519 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation7 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Non-default visibilities should only be used for definitions, not declarations, otherwise linking can fail.
This is based on #123994.
Issue #123427
When I changed default-hidden-visibility
to default-visibility
in #130005, I updated all places in the code that used default-hidden-visibility
, replicating the hidden-visibility bug to also happen for protected visibility.
Without this change, trying to build rustc with -Z default-visibility=protected
fails with a link error.
r? @Nadrieril
rustbot has assigned @Nadrieril.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Non-default visibilities should only be used for definitions, not declarations, otherwise linking can fail.
Co-authored-by: Collin Baker collinbaker@chromium.org
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no expert but this makes sense to me.
It's also what clang is doing, godbolt.
📌 Commit 42c0494 has been approved by Urgau
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 6 pull requests
Successful merges:
- rust-lang#129079 (Create
_imp__
symbols also when doing ThinLTO) - rust-lang#131208 (ABI: Pass aggregates by value on AIX)
- rust-lang#131394 (fix(rustdoc): add space between struct fields and their descriptions)
- rust-lang#131519 (Use Default visibility for rustc-generated C symbol declarations)
- rust-lang#131541 (compiletest: Extract auxiliary-crate properties to their own module/struct)
- rust-lang#131542 (next-solver: remove outdated FIXMEs)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#131519 - davidlattimore:intrinsics-default-vis, r=Urgau
Use Default visibility for rustc-generated C symbol declarations
Non-default visibilities should only be used for definitions, not declarations, otherwise linking can fail.
This is based on rust-lang#123994.
Issue rust-lang#123427
When I changed default-hidden-visibility
to default-visibility
in rust-lang#130005, I updated all places in the code that used default-hidden-visibility
, replicating the hidden-visibility bug to also happen for protected visibility.
Without this change, trying to build rustc with -Z default-visibility=protected
fails with a link error.
This was referenced
Oct 25, 2024
github-actions bot pushed a commit to kaidokert/chrome_base_mirror that referenced this pull request
This depended on rust-lang/rust#131519 rolling into the Rust compiler to fix builtins/intrinisics, which was merged in 33b1264540b.
Remove ASAN ODR exceptions for Rust globals as they are no longer walked twice incorrectly when they are hidden.
Disable the rust logging test in component builds for all platforms not just for Windows, now that symbol visibility is the same for all platforms. See https://crbug.com/374023535#comment13
Bug: 41484256, 40274892, 374023535 Fixed: 40278279 Cq-Include-Trybots: luci.chromium.try:linux-official,mac-official,win-official,win32-official Cq-Include-Trybots: luci.chromium.try:linux-asan-rel,mac-asan-rel,win-asan-rel Cq-Include-Trybots: luci.chromium.try:linux_chromium_dbg_ng Change-Id: I976ef679961e9db5a91bcc74f559ebbcc0bf058b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5966273 Commit-Queue: danakj danakj@chromium.org Reviewed-by: Arthur Eubanks aeubanks@google.com Cr-Commit-Position: refs/heads/main@{#1375460} NOKEYCHECK=True GitOrigin-RevId: ee3900fd57b3c580aefff15c64052904d81b7760
jrguzman-ms pushed a commit to msft-mirror-aosp/platform.external.libchrome that referenced this pull request
This depended on rust-lang/rust#131519 rolling into the Rust compiler to fix builtins/intrinisics, which was merged in 33b1264540b.
Remove ASAN ODR exceptions for Rust globals as they are no longer walked twice incorrectly when they are hidden.
Disable the rust logging test in component builds for all platforms not just for Windows, now that symbol visibility is the same for all platforms. See https://crbug.com/374023535#comment13
Bug: 41484256, 40274892, 374023535 Fixed: 40278279 Cq-Include-Trybots: luci.chromium.try:linux-official,mac-official,win-official,win32-official Cq-Include-Trybots: luci.chromium.try:linux-asan-rel,mac-asan-rel,win-asan-rel Cq-Include-Trybots: luci.chromium.try:linux_chromium_dbg_ng Change-Id: I976ef679961e9db5a91bcc74f559ebbcc0bf058b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5966273 Commit-Queue: danakj danakj@chromium.org Reviewed-by: Arthur Eubanks aeubanks@google.com Cr-Commit-Position: refs/heads/main@{#1375460}
CrOS-Libchrome-Original-Commit: ee3900fd57b3c580aefff15c64052904d81b7760
ogsts pushed a commit to ubiquiti/ubnt_libjingle_component_src_build that referenced this pull request
This depended on rust-lang/rust#131519 rolling into the Rust compiler to fix builtins/intrinisics, which was merged in 33b1264540b.
Remove ASAN ODR exceptions for Rust globals as they are no longer walked twice incorrectly when they are hidden.
Disable the rust logging test in component builds for all platforms not just for Windows, now that symbol visibility is the same for all platforms. See https://crbug.com/374023535#comment13
Bug: 41484256, 40274892, 374023535 Fixed: 40278279 Cq-Include-Trybots: luci.chromium.try:linux-official,mac-official,win-official,win32-official Cq-Include-Trybots: luci.chromium.try:linux-asan-rel,mac-asan-rel,win-asan-rel Cq-Include-Trybots: luci.chromium.try:linux_chromium_dbg_ng Change-Id: I976ef679961e9db5a91bcc74f559ebbcc0bf058b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5966273 Commit-Queue: danakj danakj@chromium.org Reviewed-by: Arthur Eubanks aeubanks@google.com Cr-Commit-Position: refs/heads/main@{#1375460} NOKEYCHECK=True GitOrigin-RevId: ee3900fd57b3c580aefff15c64052904d81b7760
adalessandro added a commit to adalessandro/meta-browser that referenced this pull request
adalessandro added a commit to adalessandro/meta-browser that referenced this pull request
adalessandro added a commit to adalessandro/meta-browser that referenced this pull request
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.