-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
loongarch: Fix ELF header flags #112550
loongarch: Fix ELF header flags #112550
Conversation
r? @fee1-dead (rustbot has picked a reviewer for you, use r? to override) |
r? compiler |
cc target maintainer @zhaixiaojuan |
She (@zhaixiaojuan) has been completely preoccupied with other matters and is no longer responsible for Rust. I invite @xen0n to co-review as he is highly proficient in LoongArch's ABI. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is essentially incorporating similar logic for RISC-V, so given the similarities of the two arches' ABIs they look good.
Regarding the coding style, for now there isn't a need for e_flags
to be mutable, because the logic here is simpler in that it only checks the FP ABI. You can simply do this:
{
let features = &sess.target.options.features;
let e_flags = if features.contains("+d") {
elf::EF_LARCH_ABI_DOUBLE_FLOAT
} else if features.contains("+f") {
elf::EF_LARCH_ABI_SINGLE_FLOAT
} else {
elf::EF_LARCH_ABI_SOFT_FLOAT
};
e_flags | elf::EF_LARCH_OBJABI_V1
}
But this is purely personal preference and the current form is okay too.
@cjgillot A gentle ping. |
Regarding this, I want to keep the current form. Thanks. |
@rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7905eff): 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: 661.138s -> 661.475s (0.05%) |
This patch changes the ELF header flags so that the ABI matches the floating-point features. It also updates the link to the new official documentation.