-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
810952e
commit 57ed187
Showing
14 changed files
with
108 additions
and
59 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
Submodule freertos-std
updated
18 files
+2 −2 | Cargo.toml | |
+24 −11 | README.md | |
+8 −15 | src/lib.rs | |
+3 −6 | src/panicking.rs | |
+0 −15 | src/personality.rs | |
+0 −1,559 | src/primitive_docs.rs | |
+2 −1 | src/sys/freertos/common.rs | |
+2 −0 | src/sys/freertos/freertos_api.rs | |
+8 −0 | src/sys/freertos/mod.rs | |
+13 −0 | src/sys/freertos/panic_abort.rs | |
+15 −0 | src/sys/freertos/panic_unwind/dummy.rs | |
+113 −0 | src/sys/freertos/panic_unwind/gcc.rs | |
+25 −0 | src/sys/freertos/panic_unwind/miri.rs | |
+65 −0 | src/sys/freertos/panic_unwind/mod.rs | |
+314 −0 | src/sys/freertos/unwind/libunwind.rs | |
+72 −0 | src/sys/freertos/unwind/mod.rs | |
+1 −1 | src/sys/personality/gcc.rs | |
+1 −34 | src/sys/personality/mod.rs |
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 +1 @@ | ||
/target | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
rust/ |
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,37 @@ | ||
#! /bin/bash | ||
TOOLCHAIN_NAME="local-1.76-unwind" | ||
set -e | ||
|
||
if [[ $(rustup toolchain list | grep $TOOLCHAIN_NAME) ]] | ||
then | ||
echo "ERROR: There is already a toolchain linked under the name $TOOLCHAIN_NAME" | ||
echo "Uninstall it via \"rustup uninstall $TOOLCHAIN_NAME\" and retry" | ||
exit 1 | ||
fi | ||
|
||
# Clone and patch the Rust repo | ||
if [[ -e rust ]] | ||
then | ||
cd rust | ||
if [[ $(git describe)=1.76.0 && -z $(git diff | diff --ignore-all-space ../setup-unwind-for-thumbv7m-target.patch -) ]] | ||
then | ||
echo "Rust repo is already cloned and patched, skipping this step" | ||
else | ||
echo "Unexpected contents in rust subfolder, delete it and retry" | ||
exit 1 | ||
fi | ||
else | ||
echo "Cloning and Patching Rust repo" | ||
git clone --depth=1 --branch=1.76.0 https://github.com/rust-lang/rust.git | ||
cd rust | ||
git apply ../setup-unwind-for-thumbv7m-target.patch | ||
fi | ||
|
||
# Build the toolchain | ||
echo "Building the toolchain" | ||
./x build --config ../config.toml --target thumbv7m-none-eabi | ||
|
||
# link it | ||
rustup toolchain link $TOOLCHAIN_NAME build/host/stage1 | ||
echo "The built toolchain is linked as $TOOLCHAIN_NAME, you can now use it for building" | ||
echo "example: cargo +$TOOLCHAIN_NAME build" |
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,2 @@ | ||
profile = "compiler" | ||
change-id = 118703 |
20 changes: 20 additions & 0 deletions
20
rust-unwind-toolchain/setup-unwind-for-thumbv7m-target.patch
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,20 @@ | ||
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs | ||
index f9ab3ce1..d6d64081 100644 | ||
--- a/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs | ||
+++ b/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs | ||
@@ -1,6 +1,6 @@ | ||
// Targets the Cortex-M3 processor (ARMv7-M) | ||
|
||
-use crate::spec::{base, Target, TargetOptions}; | ||
+use crate::spec::{base, Target, TargetOptions, PanicStrategy}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
@@ -12,6 +12,7 @@ pub fn target() -> Target { | ||
options: TargetOptions { | ||
abi: "eabi".into(), | ||
max_atomic_width: Some(32), | ||
+ panic_strategy: PanicStrategy::Unwind, | ||
..base::thumb::opts() | ||
}, | ||
} |
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 +1,3 @@ | ||
assets/ | ||
__pycache__/ | ||
report.* |
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,2 @@ | ||
[build] | ||
target = "thumbv7m-none-eabi" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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