Skip to content

Conversation

@zmodem
Copy link

@zmodem zmodem commented Feb 3, 2026

to ensure that compiler-builtins doesn't expose any symbols with default visibility. See discussion on rust-lang/rust#151998

@zmodem
Copy link
Author

zmodem commented Feb 3, 2026

Lots of red on the CI, but that means the patch is working :-)

It's flagging the outline atomics targeted by the Rust-side PR. Also __aeabi_idivmod etc. which I'm assuming are similarly defined as naked_asm functions. Also __rust_probestack.

RSQRT_TAB is a variable though, so I guess that will need another patch to hide.

@tgross35
Copy link
Contributor

tgross35 commented Feb 3, 2026

Looking through the failures, all the naked functions fail as expected. But it seems like static RSQRT_TAB is also exposed? Any idea what's happening there?

@tgross35
Copy link
Contributor

tgross35 commented Feb 3, 2026

Oh sorry, you mentioned that in a comment already and I missed it :) Is that something that could also be fixed in rust-lang/rust#151998?

@zmodem
Copy link
Author

zmodem commented Feb 4, 2026

Yes, I've updated that PR.

@tgross35
Copy link
Contributor

I recently added some tests for symcheck, would you be able to add one to crates/symbol-check/tests/all.rs as well? It should look a bit like

#[test]
fn test_core_symbols() {
let t = TestTarget::from_env();
let dir = tempdir().unwrap();
let lib_out = dir.path().join("libfoo.rlib");
t.rustc_build(&input_dir().join("core_symbols.rs"), &lib_out, |cmd| cmd);
let assert = t.symcheck_exe().arg(&lib_out).assert();
assert
.failure()
.stderr_contains("found 1 undefined symbols from core")
.stderr_contains("from_utf8");
}
.

@zmodem
Copy link
Author

zmodem commented Feb 12, 2026

I recently added some tests for symcheck,

Hmm, those tests don't play well with my visibility check :-)

The main issue is that the test is building things which are not compiler-builtins, such as executables and rust libraries, and those will have plenty of visible symbols.

I can avoid some of it by ignoring executables in my check, but for example the good function in good_lib.rs will be visible, and I can't fix that with -Zdefault-visibility=hidden because that's not available with stable rustc.

(I tried adding #![compiler_builtins] to good_lib.rs, but rustc didn't like that either.)

@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@zmodem
Copy link
Author

zmodem commented Feb 12, 2026

I added a --no-visibility flag which the tests that don't care about visibility checking can pass. Does that sound like a reasonable solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants