Skip to content
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

Add "-Zrandomize-layout" flag #11

Merged
merged 1 commit into from Nov 7, 2022

Conversation

Jules-Bertholet
Copy link
Contributor

Adds the -Zrandomize-layout flag to CAREFUL_FLAGS. This flag randomizes the layout of repr(Rust) types, to help catch code relying on unatable details of that layout.

@RalfJung
Copy link
Owner

RalfJung commented Nov 7, 2022

Yeah I think this makes sense... though we don't even set this flag in Miri and maybe we should?

@RalfJung RalfJung merged commit af56051 into RalfJung:master Nov 7, 2022
@RalfJung
Copy link
Owner

RalfJung commented Nov 7, 2022

Hm, a potential problem here is that people might have size assertions in their code which would fail now.

@Jules-Bertholet Jules-Bertholet deleted the randomize-layout branch November 7, 2022 13:03
@RalfJung
Copy link
Owner

RalfJung commented Nov 7, 2022

Judging from this comment I think we want to disable the flag again, and instead make it easier for users to set their own rustflags (also for the sysroot build). Which is basically #8.

@RalfJung RalfJung mentioned this pull request Nov 7, 2022
@RalfJung
Copy link
Owner

FYI I reverted this PR, but you can now set RUSTFLAGS yourself to achieve the same effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants