Skip to content

Commit d631367

Browse files
Tropix126max-niederman
authored andcommitted
clarify documentation regarding cargo-v5, adjust SystemTime panic message
1 parent 64b4027 commit d631367

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub(crate) fn target() -> Target {
1717
options: TargetOptions {
1818
os: "vexos".into(),
1919
vendor: "vex".into(),
20-
exe_suffix: ".elf".into(),
2120
cpu: "cortex-a9".into(),
2221
abi: "eabihf".into(),
2322
features: "+v7,+neon,+vfp3,+thumb2".into(),

library/std/src/sys/pal/vexos/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ pub unsafe extern "C" fn _start() -> ! {
3737
// Setup the stack
3838
asm!("ldr sp, =__stack_top", options(nostack));
3939

40-
// VEXos doesn't explicitly clean out .bss, so as a sanity
41-
// check we'll fill it with zeroes.
40+
// VEXos doesn't explicitly clean out .bss.
4241
ptr::slice_from_raw_parts_mut(
4342
addr_of_mut!(__bss_start),
4443
addr_of_mut!(__bss_end).offset_from(addr_of_mut!(__bss_start)) as usize,
@@ -52,6 +51,10 @@ pub unsafe extern "C" fn _start() -> ! {
5251
abort_internal()
5352
}
5453

54+
// The code signature is a 32 byte header at the start of user programs that
55+
// identifies the owner and type of the program, as well as certain flags for
56+
// program behavior dictated by the OS. In the event that the user wants to
57+
// change this header, we use weak linkage so it can be overwritten.
5558
#[link_section = ".code_signature"]
5659
#[linkage = "weak"]
5760
#[used]

library/std/src/sys/pal/vexos/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Instant {
2929

3030
impl SystemTime {
3131
pub fn now() -> SystemTime {
32-
panic!("time not implemented on this platform")
32+
panic!("system time not implemented on this platform")
3333
}
3434

3535
pub fn sub_time(&self, other: &SystemTime) -> Result<Duration, Duration> {

src/doc/rustc/src/platform-support/armv7a-vex-v5.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This target is cross-compiled. Dynamic linking is unsupported.
2323
`#![no_std]` crates can be built using `build-std` to build `core` and optionally
2424
`alloc`. Unwinding panics are not yet supported.
2525

26-
`std` is partially implemented, but many modules (such as `thread`, `process`, `net`, etc...) will return errors. An allocator is provided along with partial support for the `time`, `env` and `io` modules. Filesystem operations over SDCard through `std::fs` are partially supported within the restrictions of the user enviornment (e.g. directories cannot be created, filesystem objects cannot be removed).
26+
`std` is partially implemented, but many modules (such as `thread`, `process`, `net`, etc...) will return errors. An allocator is provided along with partial support for the `time`, `env` and `io` modules. Filesystem operations over SDCard through `std::fs` are partially supported within the restrictions of the user environment (e.g. directories cannot be created, filesystem objects cannot be removed).
2727

2828
This target generates binaries in the ELF format that may uploaded to the brain with external tools.
2929

@@ -44,7 +44,9 @@ build-std-features = ["compiler-builtins-mem"]
4444

4545
## Building Rust programs
4646

47-
The recommended way to build artifacts that run on V5 Brain is by using the [cargo-v5](https://github.com/vexide/cargo-v5) tool. This tool wraps the `cargo build` command by supplying arguments necessary to build the target, while also providing functionality for uploading over USB to a V5 Controller or Brain.
47+
When the compiler builds a binary, an ELF build artifact will be produced. Additional tools are required for this artifact to be recognizable to VEXos as a user program.
48+
49+
The [cargo-v5](https://github.com/vexide/cargo-v5) tool is capable of creating binaries that can be uploaded to the V5 brain. This tool wraps the `cargo build` command by supplying arguments necessary to build the target and produce an artifact recognizable to VEXos, while also providing functionality for uploading over USB to a V5 Controller or Brain.
4850

4951
To install the tool, run:
5052

0 commit comments

Comments
 (0)