This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
13 changed files
with
71 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/*.rs.bk | ||
Cargo.lock | ||
bin/*.after | ||
bin/*.before | ||
bin/*.o | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.section .text.HardFault | ||
.global HardFault | ||
.thumb_func | ||
HardFault: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
# cflags taken from cc 1.0.22 | ||
|
||
crate=cortex-m-rt | ||
|
||
arm-none-eabi-as -march=armv6s-m asm.s -o bin/$crate.o | ||
ar crs bin/thumbv6m-none-eabi.a bin/$crate.o | ||
|
||
arm-none-eabi-as -march=armv7-m asm.s -o bin/$crate.o | ||
ar crs bin/thumbv7m-none-eabi.a bin/$crate.o | ||
|
||
arm-none-eabi-as -march=armv7e-m asm.s -o bin/$crate.o | ||
ar crs bin/thumbv7em-none-eabi.a bin/$crate.o | ||
ar crs bin/thumbv7em-none-eabihf.a bin/$crate.o | ||
|
||
rm bin/$crate.o |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Checks that the blobs are up to date with the committed assembly files | ||
|
||
set -euxo pipefail | ||
|
||
for lib in $(ls bin/*.a); do | ||
filename=$(basename $lib) | ||
arm-none-eabi-objdump -Cd $lib > bin/${filename%.a}.before | ||
done | ||
|
||
./assemble.sh | ||
|
||
for lib in $(ls bin/*.a); do | ||
filename=$(basename $lib) | ||
arm-none-eabi-objdump -Cd $lib > bin/${filename%.a}.after | ||
done | ||
|
||
for cksum in $(ls bin/*.after); do | ||
diff -u $cksum ${cksum%.after}.before | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters