-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only allow compiler_builtins to call LLVM intrinsics, not any link_name function #123347
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
r? compiler |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0e682e9): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 666.146s -> 667.665s (0.23%) |
This is another case of accidental reliance on
inline(never)
like I rooted out in #118770. Without this PR, attempting to build some large programs with-Zcross-crate-inline-threshold=yes
with a sysroot also compiled with that flag will result in linker errors like this:With
-Zcross-crate-inline-threshold=yes
we can inlinepanic_fmt
intocompiler_builtins
. Then we end up with a call to an upstream monomorphization, but one that has alink_name
set. But unlike LLVM's magic intrinsic names, this link name is going to make it to the linker, and then we have a problem.This logic looks scuffed, but also we're doing this in 4 other places. Don't know if that means it's good or bad.
rust/compiler/rustc_codegen_cranelift/src/abi/mod.rs
Line 386 in 1684a75
rust/compiler/rustc_ast_passes/src/feature_gate.rs
Line 306 in 1684a75
rust/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Line 609 in 1684a75
rust/compiler/rustc_codegen_gcc/src/declare.rs
Line 170 in 1684a75