-
Notifications
You must be signed in to change notification settings - Fork 46
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
Set linker script from build.rs file #88
Conversation
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.
Thanks @jwnrt.
How can we make it clear where the linker script is added? Maybe we could document on each Cargo.toml
or print a println!
on build.rs?
This has two advantages: 1. It adds a `cargo:rerun-if-changed` command to ensure we rebuild crates if the linker script changes. 2. The path to the linker script does not depend on the directory that Cargo is executed from, so `cargo build` can be done from anywhere. Signed-off-by: James Wainwright <[email protected]>
b9ccd89
to
0acffd2
Compare
I have added a comment to the demo |
I think this one is not true, but rerun-if-changed is still a plus. |
You're right - I was mistaken about the error message you get with I've added an extra commit to enable optimizations for debug builds (level 1 for the crate and 2 for dependencies) so that |
@alees24 Have increased the total SRAM to 128 kB, When it gets merged we won't have this issue for a while. |
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.
This looks reasonable to me. I have not tested it so it would be good to have someone with more Rust knowledge to approve it as well.
This has two advantages:
cargo:rerun-if-changed
command to ensure we rebuild crates if the linker script changes.cargo build
can be done from anywhere.