Repository navigation
RISC-V: enable relax target feature by default - #164378
TechnoPorg wants to merge 2 commits into
Conversation
|
Target features are being changed; ensure all ABI effects are being accounted for cc @RalfJung These commits modify compiler targets. |
|
I'm not sure whether it would make sense to enable this in |
|
I would suggest adding a check in |
|
Pinging riscv target maintainers. |
|
The |
|
Typo: Missing comma in RISC-V target features File: compiler/rustc_target/src/spec/targets/riscv64gc_unknown_redox.rs There seems to be a missing comma in the feature string: base.features = "+m,+a,+f,+d,+c+relax".into(); It should be: base.features = "+m,+a,+f,+d,+c,+relax".into(); Otherwise, +c+relax will be parsed as a single invalid feature instead of two separate features. |
a21143c to
3a08377
Compare
|
Target consistency checks are being changed cc @RalfJung |
|
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 reroll |
This PR adds
+relaxto the default target features for all RISC-V targets to enable emission of linker relaxations by LLVM. It does not enable "global pointer" relaxations; see #163890 for more context and discussion on how those relaxations work.relaxis then marked as an internal-only target feature so that it can't be modified with-Ctarget-feature=±relaxor used with#[cfg(target_feature = "relax")],#[target_feature = "relax"], none of which make sense.When building wild for
riscv64gc-unknown-linux-gnu, it reduces binary size by 1.2%. When building my work project forriscv32i-unknown-none-elf, it reduces binary size by 1.9%, or by 2.1% if global pointer relaxations are enabled with--relax-gp.This is an alternative to #163890 which will supersede that one if merged.
cc @RalfJung, @romancardenas, @bjorn3 as participants on the previous thread.
r? compiler