It looks like these flags are no longer necessary and can be removed from %build_rustflags:
%build_rustflags
-Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn
Metadata Update from @decathorpe: - Issue set to the milestone: 26.0 (was: 25.3)
The only references to RELRO I could find wrt/ Rust was this issue: https://github.com/rust-lang/rust/issues/29877
And this Pull Request: https://github.com/rust-lang/rust/pull/43170
This didn't enable RELRO by default on all architectures (ppc64 was excluded, but ppc64le was not?), but this no longer seems to be the case in rust-lang/rust as of today. It's hard to get a history for this, because the files where those target specifics are defined have been renamed / moved since (partial) RELRO was enabled.
I don't know whether -Wl,-z,now is the default in Rust now, I couldn't find anything related to this linker flag in the rust-lang/rust project on GitHub.
-Wl,-z,now
As for the last one, I think it's safe to drop --cap-lints=warn ...
--cap-lints=warn
@jistone anything you can add here?
In rustc's terminology, RelroLevel::Full enables both RELRO and BIND_NOW, while RelroLevel::Partial is only RELRO. Full is currently the default for all Linux targets. The actual flags are applied here: https://github.com/rust-lang/rust/blob/d2e8ecd8bd26a22111cdebfb813258450b07fbf0/compiler/rustc_codegen_ssa/src/back/linker.rs#L535
RelroLevel::Full
RELRO
BIND_NOW
RelroLevel::Partial
Full
ppc64 (BE) was excluded because of RHEL6-era toolchain issues, which you can see I commented about in 43170. After we raised the platform baseline, I removed that exception here: https://github.com/rust-lang/rust/pull/102112
ppc64
Thanks for the clarification! Sounds like I can drop all three flags from the defaults. I'll prepare a PR tomorrow.
Fixed with https://pagure.io/fedora-rust/rust-packaging/pull-request/26
Metadata Update from @decathorpe: - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.