From fbc9319b52c8567e9ff762323e13aacc3a6a8681 Mon Sep 17 00:00:00 2001 From: Axel Lindeberg Date: Tue, 6 Oct 2020 09:20:10 +0200 Subject: [PATCH] Meta: Remove rlibc now that upstream issue is fixed This issue made it impossible to use -Zbuild-std without implementing the memory related symbols required by the core lib such as memcpy, memset, etc yourself. https://github.com/rust-lang/wg-cargo-std-aware/issues/53 After this PR you can now tell cargo that your platform supports these mem features and just use the built in implementations in rustc. --- .cargo/{config => config.toml} | 1 + Cargo.lock | 11 ++--------- Cargo.toml | 1 - src/lib.rs | 5 ----- 4 files changed, 3 insertions(+), 15 deletions(-) rename .cargo/{config => config.toml} (78%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 78% rename from .cargo/config rename to .cargo/config.toml index 69bd80b..bc8a4d2 100644 --- a/.cargo/config +++ b/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "bootimage runner --quiet" [unstable] build-std = ["core", "compiler_builtins", "alloc"] +build-std-features = ["compiler-builtins-mem"] diff --git a/Cargo.lock b/Cargo.lock index 8b7051a..94fb458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,15 +6,14 @@ version = "0.1.0" dependencies = [ "bootloader", "lazy_static", - "rlibc", "spin", ] [[package]] name = "bootloader" -version = "0.9.8" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad686b9b47363de7d36c05fb6885f17d08d0f2d15b1bc782a101fe3c94a2c7c" +checksum = "83732ad599045a978528e4311539fdcb20c30e406b66d1d08cd4089d4fc8d90f" [[package]] name = "lazy_static" @@ -25,12 +24,6 @@ dependencies = [ "spin", ] -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" - [[package]] name = "spin" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index de730c9..0f11d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ edition = "2018" bootloader = { version = "0.9", features = ["map_physical_memory"] } lazy_static = { version = "1.4", features = ["spin_no_std"] } spin = "0.5" -rlibc = "1.0" [package.metadata.bootimage] run-args = ["-serial", "stdio"] diff --git a/src/lib.rs b/src/lib.rs index cd5179d..3547418 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,11 +9,6 @@ #![allow(clippy::missing_safety_doc)] // library lints #![allow(clippy::new_without_default)] -// When using cargo's -Zbuild-std some symbols like memcpy, memset etc are not -// included, so we need to depend on this crate until this issue is fixed: -// https://github.com/rust-lang/wg-cargo-std-aware/issues/53 -extern crate rlibc; - #[macro_use] pub mod dbg_print; pub mod interrupts;