-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
migrate thumb-none-qemu
to rmake
#128639
Merged
Merged
migrate thumb-none-qemu
to rmake
#128639
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
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
folkertdev marked this conversation as resolved.
Show resolved
Hide resolved
|
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,62 @@ | ||
//! This test runs a basic application for thumb targets, using the cortex-m crate. | ||
//! | ||
//! These targets are very bare-metal: the first instruction the core runs on | ||
//! power-on is already user code. The cortex-m-rt has to initialize the stack, .data, | ||
//! .bss, enable the FPU if present, etc. | ||
//! | ||
//! This test builds and runs the applications for various thumb targets using qemu. | ||
//! | ||
//! How to run this | ||
//! $ ./x.py clean | ||
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make | ||
jieyouxu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//! | ||
//! For supported targets, see `example/.cargo/config.toml` | ||
//! | ||
//! FIXME: https://github.com/rust-lang/rust/issues/128733 this test uses external | ||
//! dependencies, and needs an active internet connection | ||
//! | ||
//! FIXME: https://github.com/rust-lang/rust/issues/128734 extract bootstrap cargo | ||
//! to a proper command | ||
|
||
//@ only-thumb | ||
|
||
use std::path::PathBuf; | ||
|
||
use run_make_support::{cmd, env_var, path_helpers, target}; | ||
|
||
const CRATE: &str = "example"; | ||
|
||
fn main() { | ||
std::env::set_current_dir(CRATE).unwrap(); | ||
jieyouxu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
let bootstrap_cargo = env_var("BOOTSTRAP_CARGO"); | ||
let path = env_var("PATH"); | ||
let rustc = env_var("RUSTC"); | ||
|
||
let target_dir = path_helpers::path("target"); | ||
let manifest_path = path_helpers::path("Cargo.toml"); | ||
|
||
let debug = { | ||
let mut cmd = cmd(&bootstrap_cargo); | ||
cmd.args(&["run", "--target", &target()]) | ||
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x") | ||
.env("CARGO_TARGET_DIR", &target_dir) | ||
.env("PATH", &path) | ||
.env("RUSTC", &rustc); | ||
cmd.run() | ||
}; | ||
|
||
debug.assert_stdout_contains("x = 42"); | ||
|
||
let release = { | ||
let mut cmd = cmd(&bootstrap_cargo); | ||
cmd.args(&["run", "--release", "--target", &target()]) | ||
.env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x") | ||
.env("CARGO_TARGET_DIR", &target_dir) | ||
.env("PATH", &path) | ||
.env("RUSTC", &rustc); | ||
cmd.run() | ||
}; | ||
|
||
release.assert_stdout_contains("x = 42"); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Remark: I wonder if this needs
LD_LIBRARY_PATH
set.