-
Notifications
You must be signed in to change notification settings - Fork 85
[RFC] remove build dependency on arm-none-eabi-gcc (binary blob alternative) #95
Conversation
Before this commit we used gcc to assemble external assembly files into object files that we linked into our Rust program. This commit drops the dependency on gcc by shipping the already assembled object files with this crate source code.
Very nice, I like it! |
I agree, this looks good! |
Nice idea! I think this is a great fix to get custom asm in for Rust 2018 without requiring end users have gcc installed, but I'm not sure it's the best long term solution compared to somehow having Rust generate these files. It does seem better than removing functionality ( Maybe we could have a |
we no longer need to test clang because this crate never invokes a compiler / assembler
IMO, the best long term solution is to have
I'm not too keen on adding a public Cargo feature that's only useful while developing (and not in all the cases). Mainly because of the maintenance effort. |
👍
That's fair. I'm still a little uneasy shipping binary images as part of a foundational crate with no easy way to say "please build these from the source actually". But it's not a show-stopper and this way is better than the alternatives. Is it possible to ensure the built binaries are up-to-date before |
@adamgreig done. See https://travis-ci.org/rust-embedded/cortex-m-rt/jobs/420519538#L541 |
Putting binaries in the source tree goes against all my principles, but actually, it may be the least bad option here. Provided we have those shell scripts for rebuilding, I don't see the need to bake it into the Cargo.toml because it's not something people will do often. |
Current vote count: Let's give @ithinuel some time to review proposal. |
@thejpster I agree that binaries are awkward, however since we ship the source and it's trivial to build yourself it's not too bad in this particular case. |
96: reduce the size of default handlers r=adamgreig a=japaric this commit replaces the two default handler (DefaultDefaultHandler and DefaultUserHardFault) by a single handler named `EndlessLoop`. This results in one less symbol being generated. Also this new handler uses `compiler_fence` to avoid the "infinite loops w/o side effects are undef values" bug in LLVM. `compiler_fence` is guaranteed to generate no code so this reduces the size of the handler (when compiler in release). --- As far as I could test this new handler doesn't generate abort instructions when optimized so it seems like a safe replacement. If we are feeling paranoid then once #95 we could implement EndlessLoop in assembly. r? @rust-embedded/cortex-m (anyone) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
This has a majority of approvals and no remaining concerns so I'm going to land this and open follow PRs to use this approach on the cortex-m and cortex-m-semihosting crates. Those PRs don't need to undergo voting because the approach will be the same. bors r+ |
95: [RFC] remove build dependency on arm-none-eabi-gcc (binary blob alternative) r=japaric a=japaric Before this commit we used gcc to assemble external assembly files into object files that we linked into our Rust program. This commit drops the dependency on gcc by shipping the already assembled object files with this crate source code. --- This is an alternative to RFC #91 that doesn't require a breaking change or adding a new Cargo feature and can be implemented right now. See #91 for the rationale of dropping the dependency on gcc. This approach can be applied to other Cortex-M crates like cortex-m-semihosting and cortex-m (would subsume RFC rust-embedded/cortex-m#107). This seems like an overall better approach to me, but before I go opening more PRs I want to hear your thoughts, @rust-embedded/cortex-m closes #91 Co-authored-by: Jorge Aparicio <jorge@japaric.io>
@dvc94ch you may want to use this trick in the riscv crates. Basically it gives you stable global_asm! w/o relying on gcc. |
Build succeeded |
Before this commit we used gcc to assemble external assembly files into object
files that we linked into our Rust program.
This commit drops the dependency on gcc by shipping the already assembled object
files with this crate source code.
This is an alternative to RFC #91 that doesn't require a breaking change or
adding a new Cargo feature and can be implemented right now.
See #91 for the rationale of dropping the dependency on gcc.
This approach can be applied to other Cortex-M crates like cortex-m-semihosting
and cortex-m (would subsume RFC rust-embedded/cortex-m#107).
This seems like an overall better approach to me, but before I go opening more
PRs I want to hear your thoughts, @rust-embedded/cortex-m
closes #91