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 }})

davidlattimore

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.

@rustbot

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 rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Oct 10, 2024

Urgau

@davidlattimore @chbaker0

Non-default visibilities should only be used for definitions, not declarations, otherwise linking can fail.

Co-authored-by: Collin Baker collinbaker@chromium.org

@Nadrieril

Urgau

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.

@Urgau

@bors

📌 Commit 42c0494 has been approved by Urgau

It is now in the queue for this repository.

@bors 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

Oct 11, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Oct 11, 2024

@bors

…iaskrgr

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Oct 11, 2024

@rust-timer

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

Oct 30, 2024

@danakj @copybara-github

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

Nov 20, 2024

@danakj

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

Jan 12, 2025

@danakj @copybara-github

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

Feb 7, 2025

@adalessandro

adalessandro added a commit to adalessandro/meta-browser that referenced this pull request

Feb 10, 2025

@adalessandro

adalessandro added a commit to adalessandro/meta-browser that referenced this pull request

Feb 11, 2025

@adalessandro

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.