summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-12-17 17:20:58 +0200
committerEfraim Flashner <efraim@flashner.co.il>2025-01-06 12:15:04 +0200
commit07bdee02778f5b30b341a01de6dd24dfef2fde2c (patch)
treee79ff25c9aa4e362037319830830958bea91ae6f /gnu/packages/patches
parent584c79d5dfb10208a9704a01f79af79f7d012544 (diff)
gnu: mrustc: Update to 0.11.0-1.5e01a76.
* gnu/packages/rust.scm (%mrustc-commit): Update to newest commit. (%mrustc-source): Update to 0.11.0-1.5e01a76. Add a patch. Adjust the snippet to not use vendored openssl. (rust-bootstrap)[source]: Remove patch, remove patch-flags. Add to the snippet a substitution for compatibility with llvm-13. [inputs]: Remove input labels. Remove conditional use of clang. [arguments]: Allow parallel building on all architectures. Update the make-flags. Replace the 'unpack phase to unpack the mrustc sources. Delete the custom 'set-mrustc-sources and 'patch-cargo-checksum phases. Adjust the custom 'patch-makefiles phase. Adjust the 'configure and 'build phases to no longer use clang on some architectures. * gnu/packages/patches/mrustc-patches.patch: New file. * gnu/packages/patches/rustc-1.54.0-src.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Update it. Change-Id: I7e444abe4b386b1bb77f05a278ddef45152ddb3c
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/mrustc-patches.patch19
-rw-r--r--gnu/packages/patches/rustc-1.54.0-src.patch304
2 files changed, 19 insertions, 304 deletions
diff --git a/gnu/packages/patches/mrustc-patches.patch b/gnu/packages/patches/mrustc-patches.patch
new file mode 100644
index 0000000000..626945e2a1
--- /dev/null
+++ b/gnu/packages/patches/mrustc-patches.patch
@@ -0,0 +1,19 @@
+diff --git a/rustc-1.54.0-src.patch b/rustc-1.54.0-src.patch
+index 088c723a..d322fd0d 100644
+--- a/rustc-1.54.0-src.patch
++++ b/rustc-1.54.0-src.patch
+@@ -302,14 +302,3 @@
+ use self::generic as arch;
+
+ pub use self::arch::{vec128_storage, vec256_storage, vec512_storage};
+-
+---- src/llvm-project/llvm/include/llvm/Support/Signals.h
+-+++ src/llvm-project/llvm/include/llvm/Support/Signals.h
+-@@ -14,6 +14,7 @@
+- #ifndef LLVM_SUPPORT_SIGNALS_H
+- #define LLVM_SUPPORT_SIGNALS_H
+-
+-+#include <cstdint>
+- #include <string>
+-
+- namespace llvm {
diff --git a/gnu/packages/patches/rustc-1.54.0-src.patch b/gnu/packages/patches/rustc-1.54.0-src.patch
deleted file mode 100644
index d322fd0d49..0000000000
--- a/gnu/packages/patches/rustc-1.54.0-src.patch
+++ /dev/null
@@ -1,304 +0,0 @@
-# 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
-@@ -3048,7 +3048,7 @@ impl<'hir> Node<'hir> {
- }
-
- // 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 {
- rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
- rustc_data_structures::static_assert_size!(super::Expr<'static>, 64);
-
---- compiler/rustc_middle/src/mir/interpret/error.rs
-+++ compiler/rustc_middle/src/mir/interpret/error.rs
-@@ -449,7 +449,7 @@ impl dyn MachineStopType {
- }
- }
-
--#[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);
-
- pub enum InterpError<'tcx> {
-
---- compiler/rustc_middle/src/mir/mod.rs
-+++ compiler/rustc_middle/src/mir/mod.rs
-@@ -2200,7 +2200,7 @@ pub enum AggregateKind<'tcx> {
- Generator(DefId, SubstsRef<'tcx>, hir::Movability),
- }
-
--#[cfg(target_arch = "x86_64")]
-+#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64"))]
- static_assert_size!(AggregateKind<'_>, 48);
-
- #[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
-
---- compiler/rustc_middle/src/thir.rs
-+++ compiler/rustc_middle/src/thir.rs
-@@ -144,7 +144,7 @@ pub enum StmtKind<'tcx> {
- }
-
- // `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<'_>, 144);
-
- /// The Thir trait implementor lowers their expressions (`&'tcx H::Expr`)
-
---- compiler/rustc_mir/src/interpret/operand.rs
-+++ compiler/rustc_mir/src/interpret/operand.rs
-@@ -32,7 +32,7 @@ pub enum Immediate<Tag = ()> {
- ScalarPair(ScalarMaybeUninit<Tag>, ScalarMaybeUninit<Tag>),
- }
-
--#[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);
-
- impl<Tag> From<ScalarMaybeUninit<Tag>> for Immediate<Tag> {
-@@ -87,7 +87,7 @@ pub struct ImmTy<'tcx, Tag = ()> {
- pub layout: TyAndLayout<'tcx>,
- }
-
--#[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);
-
- impl<Tag: Copy> std::fmt::Display for ImmTy<'tcx, Tag> {
-
---- compiler/rustc_mir/src/interpret/place.rs
-+++ compiler/rustc_mir/src/interpret/place.rs
-@@ -88,7 +88,7 @@ pub enum Place<Tag = ()> {
- Local { frame: usize, local: mir::Local },
- }
-
--#[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);
-
- #[derive(Copy, Clone, Debug)]
-@@ -97,7 +97,7 @@ pub struct PlaceTy<'tcx, Tag = ()> {
- pub layout: TyAndLayout<'tcx>,
- }
-
--#[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);
-
- impl<'tcx, Tag> std::ops::Deref for PlaceTy<'tcx, Tag> {
-
-#
-# 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
-@@ -86,7 +86,7 @@ mod bit;
- mod cache;
-
- cfg_if! {
-- if #[cfg(miri)] {
-+ if #[cfg(any(miri, rust_compiler = "mrustc"))] {
- // When running under miri all target-features that are not enabled at
- // compile-time are reported as disabled at run-time.
- //
-
-#
-# 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")
- ))] {
-
-#
-# Backport which is required to support arm64 on macOS 12
-# See: https://github.com/alexcrichton/curl-rust/commit/0aea09c428b9bc2bcf46da0fc33959fe3f03c74a
-#
---- vendor/curl/src/lib.rs
-+++ vendor/curl/src/lib.rs
-@@ -82,6 +82,9 @@ pub mod easy;
- pub mod multi;
- mod panic;
-
-+#[cfg(test)]
-+static INITIALIZED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
-+
- /// Initializes the underlying libcurl library.
- ///
- /// The underlying libcurl library must be initialized before use, and must be
-@@ -102,46 +105,62 @@ pub fn init() {
- /// Used to prevent concurrent or duplicate initialization.
- static INIT: Once = Once::new();
-
-- /// An exported constructor function. On supported platforms, this will be
-- /// invoked automatically before the program's `main` is called.
-- #[cfg_attr(
-- any(target_os = "linux", target_os = "freebsd", target_os = "android"),
-- link_section = ".init_array"
-- )]
-- #[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
-- #[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
-- static INIT_CTOR: extern "C" fn() = init_inner;
-+ INIT.call_once(|| {
-+ #[cfg(need_openssl_init)]
-+ openssl_probe::init_ssl_cert_env_vars();
-+ #[cfg(need_openssl_init)]
-+ openssl_sys::init();
-+
-+ unsafe {
-+ assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
-+ }
-+
-+ #[cfg(test)]
-+ {
-+ INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
-+ }
-+
-+ // Note that we explicitly don't schedule a call to
-+ // `curl_global_cleanup`. The documentation for that function says
-+ //
-+ // > You must not call it when any other thread in the program (i.e. a
-+ // > thread sharing the same memory) is running. This doesn't just mean
-+ // > no other thread that is using libcurl.
-+ //
-+ // We can't ever be sure of that, so unfortunately we can't call the
-+ // function.
-+ });
-+}
-
-+/// An exported constructor function. On supported platforms, this will be
-+/// invoked automatically before the program's `main` is called. This is done
-+/// for the convenience of library users since otherwise the thread-safety rules
-+/// around initialization can be difficult to fulfill.
-+///
-+/// This is a hidden public item to ensure the symbol isn't optimized away by a
-+/// rustc/LLVM bug: https://github.com/rust-lang/rust/issues/47384. As long as
-+/// any item in this module is used by the final binary (which `init` will be)
-+/// then this symbol should be preserved.
-+#[used]
-+#[doc(hidden)]
-+#[cfg_attr(
-+ any(target_os = "linux", target_os = "freebsd", target_os = "android"),
-+ link_section = ".init_array"
-+)]
-+#[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
-+#[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
-+pub static INIT_CTOR: extern "C" fn() = {
- /// This is the body of our constructor function.
- #[cfg_attr(
- any(target_os = "linux", target_os = "android"),
- link_section = ".text.startup"
- )]
-- extern "C" fn init_inner() {
-- INIT.call_once(|| {
-- #[cfg(need_openssl_init)]
-- openssl_sys::init();
--
-- unsafe {
-- assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
-- }
--
-- // Note that we explicitly don't schedule a call to
-- // `curl_global_cleanup`. The documentation for that function says
-- //
-- // > You must not call it when any other thread in the program (i.e.
-- // > a thread sharing the same memory) is running. This doesn't just
-- // > mean no other thread that is using libcurl.
-- //
-- // We can't ever be sure of that, so unfortunately we can't call the
-- // function.
-- });
-+ extern "C" fn init_ctor() {
-+ init();
- }
-
-- // We invoke our init function through our static to ensure the symbol isn't
-- // optimized away by a bug: https://github.com/rust-lang/rust/issues/47384
-- INIT_CTOR();
--}
-+ init_ctor
-+};
-
- unsafe fn opt_str<'a>(ptr: *const libc::c_char) -> Option<&'a str> {
- if ptr.is_null() {
-@@ -158,3 +177,20 @@ fn cvt(r: curl_sys::CURLcode) -> Result<(), Error> {
- Err(Error::new(r))
- }
- }
-+
-+#[cfg(test)]
-+mod tests {
-+ use super::*;
-+
-+ #[test]
-+ #[cfg(any(
-+ target_os = "linux",
-+ target_os = "macos",
-+ target_os = "windows",
-+ target_os = "freebsd",
-+ target_os = "android"
-+ ))]
-+ fn is_initialized_before_main() {
-+ assert!(INITIALIZED.load(std::sync::atomic::Ordering::SeqCst));
-+ }
-+}
-
-# 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
-@@ -9,14 +9,14 @@ mod soft;
- mod types;
- pub use self::types::*;
-
--#[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;
-
- pub use self::arch::{vec128_storage, vec256_storage, vec512_storage};