-
Notifications
You must be signed in to change notification settings - Fork 109
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
build/make: set the page size #503
Conversation
build.rs
Outdated
// Configure the alignment size for the linker. This prevents the linker | ||
// from assuming very large pages (i.e. 65536 bytes) and unnecessarily | ||
// inserting additional padding into the output ELF. | ||
println!("cargo:rustc-link-arg=-zmax-page-size=4096"); |
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.
Any reason not to include this in libtock_build_scripts::auto_layout
?
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.
My thinking was users may want this but not auto_layout.
We could add it to the build-scripts crate.
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.
I feel think this is part of configuring the layout for a libtock-rs
app, and therefore belongs in auto_layout
.
Otherwise lld seems to assume 0x10000 sized pages and tries to align the output segments to 0x10000. This often causes elfs with large padding regions before the first segment we actually want to load on the board.
c2e478f
to
6e1d0ca
Compare
Moved. I think when you spend too much time thinking about linkers it starts to change you and you start to think that others might also want to think about linkers but in reality they don't and I agree it's better to just fix this option for everyone and no one will ever notice or care. |
Without setting this, lld seems to assume 0x10000 sized pages and tries to align the output segments to 0x10000. This often causes elfs with large padding regions before the first segment we actually want to load on the board.
See tock/elf2tab#75 for further discussion.