diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2022-07-05 10:26:03 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2022-07-05 12:52:48 +0300 |
commit | 5cf9a03b7a86de9b7cc696fe4e45a650a4196b99 (patch) | |
tree | b303135f9f43b0d610a406aad9780d1cdce7913b /gnu/packages/patches | |
parent | 9061ac29af057edbed625e4f5d38f0cb0740d09e (diff) | |
download | guix-5cf9a03b7a86de9b7cc696fe4e45a650a4196b99.tar.gz guix-5cf9a03b7a86de9b7cc696fe4e45a650a4196b99.zip |
gnu: rust: Bootstrap with rust-1.54.0.
* gnu/packages/rust.scm (rust-1.39): Rename to rust-bootstrap. Update to
1.54.0.
[source]: Update snippet to new version. Replace mrustc patch for 1.39.0
with patch for 1.54.0.
[inputs]: Remove libssh2. Replace llvm-9 with llvm. Add gcc-9.
[arguments]: Adjust custom 'setup-mrustc-sources to also create file
with rust version. Adjust custom 'patch-makefiles phase to changes in
mrustc's build steps. Adjust custom 'build phase to follow mrustc's
build steps for rust-1.54.
(rust-1.40): Replace post-bootstrapped rust-1.40 with 1.55.
[arguments]: Add custom 'set-linker-locale-to-utf8 phase. Adjust custom
'build phase. Remove custom 'neuter-tidy phase.
[inputs]: Replace llvm-9 with llvm.
(rust-1.41, rust-1.42, rust-1.43, rust-1.44, rust-1.45, rust-1.46,
rust-1.47, rust-1.48, rust-1.49, rust-1.50, rust-1.51, rust-1.52,
rust-1.53): Remove variables.
* gnu/packages/patches/rust-1.39.0-src.patch: Remove file.
* gnu/packages/patches/rust-1.54.0-src.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register changes.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/rustc-1.39.0-src.patch | 99 | ||||
-rw-r--r-- | gnu/packages/patches/rustc-1.54.0-src.patch | 117 |
2 files changed, 117 insertions, 99 deletions
diff --git a/gnu/packages/patches/rustc-1.39.0-src.patch b/gnu/packages/patches/rustc-1.39.0-src.patch deleted file mode 100644 index 7859bd44d5..0000000000 --- a/gnu/packages/patches/rustc-1.39.0-src.patch +++ /dev/null @@ -1,99 +0,0 @@ -# This modified patch is to disable the hunk applying to LLVM, unbundled in Guix. - -# Add mrustc slice length intrinsics ---- src/libcore/intrinsics.rs -+++ src/libcore/intrinsics.rs -@@ -685,4 +685,8 @@ - pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize; - -+ /// Obtain the length of a slice pointer -+ #[cfg(rust_compiler="mrustc")] -+ pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize; -+ - /// Gets a static string slice containing the name of a type. - pub fn type_name<T: ?Sized>() -> &'static str; - ---- src/libcore/slice/mod.rs -+++ src/libcore/slice/mod.rs -@@ -68,5 +68,8 @@ - pub const fn len(&self) -> usize { -- unsafe { -- crate::ptr::Repr { rust: self }.raw.len -- } -+ #[cfg(not(rust_compiler="mrustc"))] -+ #[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))] -+ const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::ptr::Repr { rust: s }.raw.len } }; -+ #[cfg(rust_compiler="mrustc")] -+ const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::intrinsics::mrustc_slice_len(s) } } -+ len_inner(self) - } -# -# Static-link rustc_codegen_llvm so the generated rustc is standalone -# > Note: Interacts with `rustc-1.39.0-overrides.toml` -# ---- src/librustc_interface/util.rs -+++ src/librustc_interface/util.rs -@@ -421,2 +421,4 @@ - pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend> { -+ #[cfg(rust_compiler="mrustc")] -+ { if(backend_name == "llvm") { extern "Rust" { fn __rustc_codegen_backend() -> Box<dyn CodegenBackend>; } return || unsafe { __rustc_codegen_backend() } } } - // For now we only allow this function to be called once as it'll dlopen a -# Disable most architecture intrinsics ---- src/stdarch/crates/std_detect/src/detect/mod.rs -+++ src/stdarch/crates/std_detect/src/detect/mod.rs -@@ -74,4 +74,7 @@ - // this run-time detection logic is never called. - #[path = "os/other.rs"] - mod os; -+ } else if #[cfg(rust_compiler="mrustc")] { -+ #[path = "os/other.rs"] -+ mod os; - } else if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { ---- vendor/ppv-lite86/src/lib.rs -+++ vendor/ppv-lite86/src/lib.rs -@@ -12,10 +12,10 @@ --#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] -+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))] - pub mod x86_64; --#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] -+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))] - use self::x86_64 as arch; - --#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] -+#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] - pub mod generic; --#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] -+#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] - use self::generic as arch; - -# diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h -# index da9d9d5bfdc0..3d47471f0ef0 100644 -# --- src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h -# +++ src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h -# @@ -16,6 +16,8 @@ -# #include "llvm/Demangle/DemangleConfig.h" -# #include "llvm/Demangle/StringView.h" -# #include <array> -# +#include <cstdint> -# +#include <string> - -# namespace llvm { -# namespace itanium_demangle { -## -## gcc (used by mrustc) has 16-byte uint128_t alignment, while rustc uses 8 -## -#--- src/libsyntax/ast.rs -#+++ src/libsyntax/ast.rs -#@@ -986,2 +986,2 @@ -#-#[cfg(target_arch = "x86_64")] -#-static_assert_size!(Expr, 96); -#+//#[cfg(target_arch = "x86_64")] -#+//static_assert_size!(Expr, 96); -#--- src/librustc/ty/sty.rs -#+++ src/librustc/ty/sty.rs -#@@ -2258,2 +2258,2 @@ -#-#[cfg(target_arch = "x86_64")] -#-static_assert_size!(Const<'_>, 40); -#+//#[cfg(target_arch = "x86_64")] -#+//static_assert_size!(Const<'_>, 40); - diff --git a/gnu/packages/patches/rustc-1.54.0-src.patch b/gnu/packages/patches/rustc-1.54.0-src.patch new file mode 100644 index 0000000000..d075dce39b --- /dev/null +++ b/gnu/packages/patches/rustc-1.54.0-src.patch @@ -0,0 +1,117 @@ +# mrustc is much better at enum packing, so causes almost all of these to be smaller by one pointer +--- compiler/rustc_ast/src/ast.rs ++++ compiler/rustc_ast/src/ast.rs +@@ -1075,7 +1075,7 @@ pub struct Expr { + } + + // `Expr` is used a lot. Make sure it doesn't unintentionally get bigger. +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(Expr, 104); + + impl Expr { +@@ -2779,7 +2779,7 @@ pub enum AssocItemKind { + MacCall(MacCall), + } + +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(AssocItemKind, 72); + + impl AssocItemKind { +@@ -2831,7 +2831,7 @@ pub enum ForeignItemKind { + MacCall(MacCall), + } + +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler="mrustc"),target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(ForeignItemKind, 72); + + impl From<ForeignItemKind> for ItemKind { +--- compiler/rustc_hir/src/hir.rs ++++ compiler/rustc_hir/src/hir.rs +@@ -3050,3 +3050,3 @@ + // Some nodes are used a lot. Make sure they don't unintentionally get bigger. +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler="mrustc"),target_arch = "x86_64", target_pointer_width = "64"))] + mod size_asserts { +--- compiler/rustc_middle/src/mir/interpret/error.rs ++++ compiler/rustc_middle/src/mir/interpret/error.rs +@@ -452,2 +452,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + static_assert_size!(InterpError<'_>, 64); +--- compiler/rustc_middle/src/mir/mod.rs ++++ compiler/rustc_middle/src/mir/mod.rs +@@ -2203,2 +2203,2 @@ +-#[cfg(target_arch = "x86_64")] ++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64"))] + static_assert_size!(AggregateKind<'_>, 48); +--- compiler/rustc_middle/src/thir.rs ++++ compiler/rustc_middle/src/thir.rs +@@ -147,2 +147,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(Expr<'_>, 144); +--- compiler/rustc_mir/src/interpret/place.rs ++++ compiler/rustc_mir/src/interpret/place.rs +@@ -91,2 +91,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(Place, 64); +@@ -100,2 +100,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(PlaceTy<'_>, 80); +--- compiler/rustc_mir/src/interpret/operand.rs ++++ compiler/rustc_mir/src/interpret/operand.rs +@@ -35,2 +35,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(Immediate, 56); +@@ -90,2 +90,2 @@ +-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] ++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))] + rustc_data_structures::static_assert_size!(ImmTy<'_>, 72); + +# +# Disable crc32fast's use of stdarch +# +--- vendor/crc32fast/src/specialized/mod.rs ++++ vendor/crc32fast/src/specialized/mod.rs +@@ -1,5 +1,6 @@ + cfg_if! { + if #[cfg(all( ++ not(rust_compiler = "mrustc"), + crc32fast_stdarchx86, + any(target_arch = "x86", target_arch = "x86_64") + ))] { + +# +# Disable std_detect's detection logic (use the same logic as miri) +# +--- library/stdarch/crates/std_detect/src/detect/mod.rs ++++ library/stdarch/crates/std_detect/src/detect/mod.rs +@@ -88,2 +88,2 @@ + cfg_if! { +- if #[cfg(miri)] { ++ if #[cfg(any(miri, rust_compiler = "mrustc"))] { + +# PPV-Lite also needs to know that we're pretending to be miri +--- vendor/ppv-lite86/src/lib.rs ++++ vendor/ppv-lite86/src/lib.rs +@@ -12,9 +12,9 @@ +-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] ++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))] + pub mod x86_64; +-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] ++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))] + use self::x86_64 as arch; + +-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] ++#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] + pub mod generic; +-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] ++#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] + use self::generic as arch; + |