From 32ef64b36efd3dd48a9d6677b081de4cde316904 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sun, 8 Apr 2018 13:27:51 +0200 Subject: [PATCH] compiler_builtins are now mandatory; Add them. In rust-lang/rust@679657b863c2a53a3052d8af9defbce48e12db10 a breaking change was introduced that now requires compiler_builtins. Add them, and use the opportunity to kick out rlibc, since memset() et al. can be provided by compiler intrinsics. --- .gitignore | 2 +- 01_bareminimum/Xargo.toml | 5 +++++ 02_multicore_rust/Xargo.toml | 5 +++++ 03_uart1/Xargo.toml | 5 +++++ 04_mailboxes/Cargo.lock | 7 ------- 04_mailboxes/Cargo.toml | 1 - 04_mailboxes/README.md | 8 +++----- 04_mailboxes/Xargo.toml | 6 ++++++ 04_mailboxes/kernel8.img | Bin 1920 -> 1920 bytes 04_mailboxes/src/main.rs | 1 - 05_uart0/Cargo.lock | 7 ------- 05_uart0/Cargo.toml | 1 - 05_uart0/Xargo.toml | 6 ++++++ 05_uart0/kernel8.img | Bin 2080 -> 2080 bytes 05_uart0/src/main.rs | 1 - 06_random/Cargo.lock | 7 ------- 06_random/Cargo.toml | 1 - 06_random/Xargo.toml | 6 ++++++ 06_random/kernel8.img | Bin 1936 -> 1936 bytes 06_random/src/main.rs | 1 - 20 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 01_bareminimum/Xargo.toml create mode 100644 02_multicore_rust/Xargo.toml create mode 100644 03_uart1/Xargo.toml create mode 100644 04_mailboxes/Xargo.toml create mode 100644 05_uart0/Xargo.toml create mode 100644 06_random/Xargo.toml diff --git a/.gitignore b/.gitignore index 9611428d..fbbf5d70 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -**/dockcross-linux-aarch64 \ No newline at end of file +**/dockcross-linux-aarch64 diff --git a/01_bareminimum/Xargo.toml b/01_bareminimum/Xargo.toml new file mode 100644 index 00000000..d0d5706f --- /dev/null +++ b/01_bareminimum/Xargo.toml @@ -0,0 +1,5 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +stage = 1 diff --git a/02_multicore_rust/Xargo.toml b/02_multicore_rust/Xargo.toml new file mode 100644 index 00000000..d0d5706f --- /dev/null +++ b/02_multicore_rust/Xargo.toml @@ -0,0 +1,5 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +stage = 1 diff --git a/03_uart1/Xargo.toml b/03_uart1/Xargo.toml new file mode 100644 index 00000000..d0d5706f --- /dev/null +++ b/03_uart1/Xargo.toml @@ -0,0 +1,5 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +stage = 1 diff --git a/04_mailboxes/Cargo.lock b/04_mailboxes/Cargo.lock index 6423a007..3352bcb2 100644 --- a/04_mailboxes/Cargo.lock +++ b/04_mailboxes/Cargo.lock @@ -3,7 +3,6 @@ name = "kernel8" version = "0.1.0" dependencies = [ "raspi3_glue 0.1.0", - "rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -11,11 +10,6 @@ dependencies = [ name = "raspi3_glue" version = "0.1.0" -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "vcell" version = "0.1.0" @@ -30,6 +24,5 @@ dependencies = [ ] [metadata] -"checksum rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" "checksum vcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45c297f0afb6928cd08ab1ff9d95e99392595ea25ae1b5ecf822ff8764e57a0d" "checksum volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286" diff --git a/04_mailboxes/Cargo.toml b/04_mailboxes/Cargo.toml index 8e79f96f..df9e43a9 100644 --- a/04_mailboxes/Cargo.toml +++ b/04_mailboxes/Cargo.toml @@ -6,4 +6,3 @@ authors = ["Andre Richter "] [dependencies] raspi3_glue = { path = "raspi3_glue" } volatile-register = "0.2.0" -rlibc = "1.0" diff --git a/04_mailboxes/README.md b/04_mailboxes/README.md index df509f27..9b28a564 100644 --- a/04_mailboxes/README.md +++ b/04_mailboxes/README.md @@ -35,17 +35,15 @@ Where each tag looks like: n+3. optional value buffer ``` -### rlibc +### Xargo.toml The mailbox buffer is a fixed array that is zero-initialized. To achieve zero-initialization, Rust utilizies and links to the `memset()` function, which is normally provided by `libc`. Since we are writing a `no_std` crate, we need to explicitly provide it. The -easiest way is pulling in [rlibc] by adding it as an `extern crate` to `main.rs` -and adding the dependency to `Cargo.toml`. - -[rlibc]: https://github.com/alexcrichton/rlibc +easiest way is pulling in the `mem` feature of the `compiler_builtins` by adding +it to `Xargo.toml`. ### Synchronization diff --git a/04_mailboxes/Xargo.toml b/04_mailboxes/Xargo.toml new file mode 100644 index 00000000..163024ec --- /dev/null +++ b/04_mailboxes/Xargo.toml @@ -0,0 +1,6 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +features = ["mem"] # for memset() et al. +stage = 1 diff --git a/04_mailboxes/kernel8.img b/04_mailboxes/kernel8.img index 4f18a092ee58a926a53c53f2181c5b7a86019a90..f36cf015fa1a80c5dd0df3c8ad5dfb7f29f21b99 100755 GIT binary patch delta 49 zcmZqRZ{VLG!|1zF)|r{HZ*wB^d&bEJ*enFH{{Nr;kKOSH0|SEy5HoBJU@c&r%)wp( E0F;^!NB{r; delta 49 zcmZqRZ{VLG!?<#ztTQuX&E`br_l%oouof^*4q&wq;QRl7`agEZ9}El(B0$VAnS;Fo E0F%BC4FCWD diff --git a/04_mailboxes/src/main.rs b/04_mailboxes/src/main.rs index ed6ac757..5fa2e798 100644 --- a/04_mailboxes/src/main.rs +++ b/04_mailboxes/src/main.rs @@ -26,7 +26,6 @@ #![feature(asm)] extern crate raspi3_glue; -extern crate rlibc; // for memset et al.b extern crate volatile_register; const MMIO_BASE: u32 = 0x3F00_0000; diff --git a/05_uart0/Cargo.lock b/05_uart0/Cargo.lock index 6423a007..3352bcb2 100644 --- a/05_uart0/Cargo.lock +++ b/05_uart0/Cargo.lock @@ -3,7 +3,6 @@ name = "kernel8" version = "0.1.0" dependencies = [ "raspi3_glue 0.1.0", - "rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -11,11 +10,6 @@ dependencies = [ name = "raspi3_glue" version = "0.1.0" -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "vcell" version = "0.1.0" @@ -30,6 +24,5 @@ dependencies = [ ] [metadata] -"checksum rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" "checksum vcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45c297f0afb6928cd08ab1ff9d95e99392595ea25ae1b5ecf822ff8764e57a0d" "checksum volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286" diff --git a/05_uart0/Cargo.toml b/05_uart0/Cargo.toml index 8e79f96f..df9e43a9 100644 --- a/05_uart0/Cargo.toml +++ b/05_uart0/Cargo.toml @@ -6,4 +6,3 @@ authors = ["Andre Richter "] [dependencies] raspi3_glue = { path = "raspi3_glue" } volatile-register = "0.2.0" -rlibc = "1.0" diff --git a/05_uart0/Xargo.toml b/05_uart0/Xargo.toml new file mode 100644 index 00000000..163024ec --- /dev/null +++ b/05_uart0/Xargo.toml @@ -0,0 +1,6 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +features = ["mem"] # for memset() et al. +stage = 1 diff --git a/05_uart0/kernel8.img b/05_uart0/kernel8.img index c37ec3fd583d66f6d78106da38bb0b4b1579a140..f2cc1a9109faa3a7825506044b82a4b399f2d58d 100755 GIT binary patch delta 55 zcmZ1=us~pf3}fy_S!ZU(b(<5J?=vzgO?G5$pKQVIAmH`?|MY+Cjz1U}7({@WVe<*r K0>;T5>@xuKY!S8q delta 55 zcmZ1=us~pf4CBd-vd+wmvo"] [dependencies] raspi3_glue = { path = "raspi3_glue" } volatile-register = "0.2.0" -rlibc = "1.0" diff --git a/06_random/Xargo.toml b/06_random/Xargo.toml new file mode 100644 index 00000000..163024ec --- /dev/null +++ b/06_random/Xargo.toml @@ -0,0 +1,6 @@ +[dependencies.core] +stage = 0 + +[dependencies.compiler_builtins] +features = ["mem"] # for memset() et al. +stage = 1 diff --git a/06_random/kernel8.img b/06_random/kernel8.img index 7c8e4fe59789b21ab0ca2733e496bc4ad12b84cb..f5627ac412555fcd60214e0875980e11617cdce7 100755 GIT binary patch delta 54 zcmbQhKY@RO3}fI%S!ZU(Nt+XyKQpp0GBAitKEdW7koN!o^ndJ*KNx@lK+Lc?g0+Bg IvIKht0KVf7u>b%7 delta 54 zcmbQhKY@RO4CC63vd+wmb(<5JKQpq#GBAj2Ucp+xI5~pVL4fQ3|LOnO9e*$YMS+-M IvIKht0L-%w*Z=?k diff --git a/06_random/src/main.rs b/06_random/src/main.rs index 248ee603..f039b4d5 100644 --- a/06_random/src/main.rs +++ b/06_random/src/main.rs @@ -26,7 +26,6 @@ #![feature(asm)] extern crate raspi3_glue; -extern crate rlibc; // for memset et al.b extern crate volatile_register; const MMIO_BASE: u32 = 0x3F00_0000;