From b2f94e0a16367f4cb63617935a58d571e3acf278 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 15 Mar 2020 20:23:11 +0100 Subject: gnu: rust: Bootstrap rust@1.29.0 by mrustc@0.9. * gnu/packages/patches/rustc-1.29.0-src.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/rust.scm (rust-1.19): Delete variable. (rust-1.20): Delete variable. (rust-1.21): Delete variable. (rust-1.22): Delete variable. (rust-1.23): Delete variable. (rust-1.24): Delete variable. (rust-1.25): Delete variable. (rust-1.26): Delete variable. (rust-1.27): Delete variable. (rust-1.28): Delete variable. (rust-1.29): Bootstrap from mrustc. [source]: Add patch. (rust-1.30)[inputs]: Remove llvm 3. Add llvm 6. (mrustc): Update rustc-version to 1.29.0. --- gnu/packages/patches/rustc-1.29.0-src.patch | 86 +++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 gnu/packages/patches/rustc-1.29.0-src.patch (limited to 'gnu/packages/patches/rustc-1.29.0-src.patch') diff --git a/gnu/packages/patches/rustc-1.29.0-src.patch b/gnu/packages/patches/rustc-1.29.0-src.patch new file mode 100644 index 0000000000..feeb7e71cf --- /dev/null +++ b/gnu/packages/patches/rustc-1.29.0-src.patch @@ -0,0 +1,86 @@ +From mrustc 0.9. +# Add mrustc slice length intrinsics +--- rustc-1.29.0-src/src/libcore/intrinsics.rs ++++ rustc-1.29.0-src/src/libcore/intrinsics.rs +@@ -678,5 +678,9 @@ + pub fn min_align_of_val(_: &T) -> usize; + ++ /// Obtain the length of a slice pointer ++ #[cfg(rust_compiler="mrustc")] ++ pub fn mrustc_slice_len(pointer: *const [T]) -> usize; ++ + /// Gets a static string slice containing the name of a type. + pub fn type_name() -> &'static str; + +--- rustc-1.29.0-src/src/libcore/slice/mod.rs ++++ rustc-1.29.0-src/src/libcore/slice/mod.rs +@@ -413,5 +413,7 @@ + pub const fn len(&self) -> usize { +- unsafe { +- Repr { rust: self }.raw.len +- } ++ #[cfg(not(rust_compiler="mrustc"))] ++ const fn len_inner(s: &[T]) -> usize { unsafe { Repr { rust: s }.raw.len } }; ++ #[cfg(rust_compiler="mrustc")] ++ const fn len_inner(s: &[T]) -> usize { unsafe { ::intrinsics::mrustc_slice_len(s) } } ++ len_inner(self) + } +# Static-link rustc_codegen_llvm because mrustc doesn't have dylib support +--- rustc-1.29.0-src/src/librustc_driver/Cargo.toml ++++ rustc-1.29.0-src/src/librustc_driver/Cargo.toml +@@ -39,1 +39,2 @@ + syntax_pos = { path = "../libsyntax_pos" } ++rustc_codegen_llvm = { path = "../librustc_codegen_llvm" } +--- rustc-1.29.0-src/src/librustc_driver/lib.rs ++++ rustc-1.29.0-src/src/librustc_driver/lib.rs +@@ -63,2 +63,3 @@ + extern crate syntax_pos; ++extern crate rustc_codegen_llvm; + +@@ -296,3 +296,7 @@ + } + ++ if backend_name == "llvm" { ++ return rustc_codegen_llvm::__rustc_codegen_backend; ++ } ++ + let target = session::config::host_triple(); +# No workspace support in minicargo, patch cargo's Cargo.toml +--- rustc-1.29.0-src/src/tools/cargo/Cargo.toml ++++ rustc-1.29.0-src/src/tools/cargo/Cargo.toml +@@ -60,5 +60,5 @@ + # A noop dependency that changes in the Rust repository, it's a bit of a hack. + # See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` + # for more information. +-rustc-workspace-hack = "1.0.0" ++rustc-workspace-hack = { path = "../rustc-workspace-hack" } + +# mrustc can't represent a 24 byte version of this enum (no way of storing the +# tag in padding) +--- rustc-1.29.0-src/src/librustc/ty/context.rs ++++ rustc-1.29.0-src/src/librustc/ty/context.rs +@@ -805,5 +805,5 @@ + // Ensure our type representation does not grow +- #[cfg(target_pointer_width = "64")] +- assert!(mem::size_of::() <= 24); +- #[cfg(target_pointer_width = "64")] +- assert!(mem::size_of::() <= 32); ++ //#[cfg(target_pointer_width = "64")] ++ //assert!(mem::size_of::() <= 24); ++ //#[cfg(target_pointer_width = "64")] ++ //assert!(mem::size_of::() <= 32); + +--- rustc-1.29.0-src/src/stdsimd/stdsimd/arch/detect/os/x86.rs ++++ rustc-1.29.0-src/src/stdsimd/stdsimd/arch/detect/os/x86.rs +@@ -14,5 +14,11 @@ + /// Performs run-time feature detection. + #[inline] ++#[cfg(not(rust_compiler="mrustc"))] + pub fn check_for(x: Feature) -> bool { + cache::test(x as u32, detect_features) + } ++#[inline] ++#[cfg(rust_compiler="mrustc")] ++pub fn check_for(x: Feature) -> bool { ++ false ++} -- cgit v1.2.3