Skip to content

Commit dfc5218

Browse files
committed
rustc_session: default to -Z plt=yes on non-x86_64
Per the discussion in #106380 plt=no isn't a great default, and rust-lang/compiler-team#581 decided that the default should be PLT=yes for everything except x86_64. Not everyone agrees about the x86_64 part of this change, but this at least is an improvement in the state of things without changing the x86_64 situation, so I've attempted making this change in the name of not letting the perfect be the enemy of the good.
1 parent 2efe091 commit dfc5218

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ options! {
16131613
plt: Option<bool> = (None, parse_opt_bool, [TRACKED],
16141614
"whether to use the PLT when calling into shared libraries;
16151615
only has effect for PIC code on systems with ELF binaries
1616-
(default: PLT is disabled if full relro is enabled)"),
1616+
(default: PLT is disabled if full relro is enabled on x86_64)"),
16171617
polonius: bool = (false, parse_bool, [TRACKED],
16181618
"enable polonius-based borrow-checker (default: no)"),
16191619
polymorphize: bool = (false, parse_bool, [TRACKED],

compiler/rustc_session/src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ impl Session {
10131013
pub fn needs_plt(&self) -> bool {
10141014
// Check if the current target usually needs PLT to be enabled.
10151015
// The user can use the command line flag to override it.
1016-
let needs_plt = self.target.needs_plt;
1016+
let needs_plt = self.target.arch != "x86_64";
10171017

10181018
let dbg_opts = &self.opts.unstable_opts;
10191019

0 commit comments

Comments
 (0)