commit:     a5bfcd482b87529122c06e6bb5fae20f0c1c0126
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  9 09:49:08 2026 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Mar 10 00:41:36 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5bfcd48

dev-lang/mrustc: add 0.12.0 (1.90.0); sync live

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 dev-lang/mrustc/Manifest                           |   2 +
 .../mrustc-0.12.0-build-with-provided-rust.patch   | 197 +++++++++++++++++++++
 .../files/mrustc-0.12.0-default-to-rust-1_90.patch |  18 ++
 .../mrustc/files/mrustc-0.12.0-git-be-gone.patch   |  25 +++
 ...c-0.12.0-no-glibcxx-assertions-workaround.patch |  97 ++++++++++
 .../{mrustc-9999.ebuild => mrustc-0.12.0.ebuild}   |  17 +-
 dev-lang/mrustc/mrustc-9999.ebuild                 |  33 +++-
 7 files changed, 373 insertions(+), 16 deletions(-)

diff --git a/dev-lang/mrustc/Manifest b/dev-lang/mrustc/Manifest
index b10690c71040..e0a52fb53bbf 100644
--- a/dev-lang/mrustc/Manifest
+++ b/dev-lang/mrustc/Manifest
@@ -1,2 +1,4 @@
 DIST mrustc-0.11.2.tar.gz 1364024 BLAKE2B 
e68178d952b3afef526f99dda24def646ebefbf661200e7b57a7ea054c511075a1455e6456f3fbb0e4c1042660f716f92bcee990054dbe7c1ebc4185ce0e3899
 SHA512 
9a39249c38eee109c4f60af051df89aa5ab1e3408761d67d3ee8ae05cded03b9e4fd36b554a470e35c77d214bf02d39f172ab04fdcb8b03fac068d8af268ebf5
+DIST mrustc-0.12.0.tar.gz 1437209 BLAKE2B 
056bf7a983d2b962062bf0e208665d1f3f6d4602fa13d0043b2085cb02e34d5d4e1a5c925bcd930e4ef4d04e88690cad96ae67b6d9c7d9734361bcedcd7f11d8
 SHA512 
0df0ad41e646b25664459c92419b88881b139967d36d0601d799d282afb063cb36a73c5476b796d6935e6d886a4709d8efe6442b496c27accf149d7b7b39af42
 DIST rustc-1.74.1-src.tar.xz 155968724 BLAKE2B 
e05f2379ac94b286f85791a138e1928e5b5b5a7749f0981d82c40c2a12860f55bf96bb2f0e924e35a0f8b2447b13052d38adea909aaa3199105787bb5a4861b3
 SHA512 
14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d
+DIST rustc-1.90.0-src.tar.xz 272348992 BLAKE2B 
82dbbe3b5fe79f623c74fb81a4c4372b14e7d765f0e9af3d76a6c4bde9899007c85c8af70dfd9facc06c37a9c8d03a4597ec87b2d053585ccbc2287332b27e70
 SHA512 
fb0798b4c7450754db2fcbb641202909d209c6db2d9181d7df7282217b8320dc52f5e9853de9d7bdb79177f1f920389450cab07674dea5fb5501eaab5816662a

diff --git a/dev-lang/mrustc/files/mrustc-0.12.0-build-with-provided-rust.patch 
b/dev-lang/mrustc/files/mrustc-0.12.0-build-with-provided-rust.patch
new file mode 100644
index 000000000000..c63308212145
--- /dev/null
+++ b/dev-lang/mrustc/files/mrustc-0.12.0-build-with-provided-rust.patch
@@ -0,0 +1,197 @@
+From e12b1ea2ce63eef36fca22b47a22aa55e8b898cd Mon Sep 17 00:00:00 2001
+From: Matt Jolly <[email protected]>
+Date: Mon, 9 Mar 2026 19:22:58 +1000
+Subject: [PATCH] Enable build with provided rust tarball
+
+Signed-off-by: Matt Jolly <[email protected]>
+--- a/minicargo.mk
++++ b/minicargo.mk
+@@ -16,6 +16,9 @@ endif
+ RUSTC_VERSION_DEF := $(shell cat rust-version)
+ RUSTC_VERSION ?= $(RUSTC_VERSION_DEF)
+ 
++# Distros may want to sandbox the build and provide the source themselves
++RUSTC_SRC_PROVIDED := 0
++
+ # OUTDIR_SUF : Output directory suffix
+ ifeq ($(RUSTC_VERSION),$(RUSTC_VERSION_DEF))
+   OUTDIR_SUF_DEF :=
+@@ -92,18 +95,26 @@ else
+   RUSTC_OUT_BIN := rustc_main
+ endif
+ 
+-ifeq ($(RUSTC_CHANNEL),nightly)
+-  RUSTCSRC := rustc-nightly-src/
++ifeq ($(RUSTC_SRC_PROVIDED),0)
++  ifeq ($(RUSTC_CHANNEL),nightly)
++    RUSTCSRC := rustc-nightly-src
++  else
++    RUSTCSRC := rustc-$(RUSTC_VERSION)-src
++  endif
+ else
+-  RUSTCSRC := rustc-$(RUSTC_VERSION)-src/
++  # Strip trailing slash from rustcsrc if present
++  RUSTCSRC := $(RUSTCSRC:/=)
++  ifeq ($(wildcard $(RUSTCSRC)/Cargo.toml),)
++    $(error "RUSTCSRC is not set to a valid directory: $(RUSTCSRC)/")
++  endif
+ endif
+ RUSTC_SRC_DL := $(RUSTCSRC)/dl-version
+ ifeq ($(RUSTC_VERSION),1.19.0)
+-  VENDOR_DIR := $(RUSTCSRC)src/vendor
++  VENDOR_DIR := $(RUSTCSRC)/src/vendor
+ else ifeq ($(RUSTC_VERSION),1.29.0)
+-  VENDOR_DIR := $(RUSTCSRC)src/vendor
++  VENDOR_DIR := $(RUSTCSRC)/src/vendor
+ else
+-  VENDOR_DIR := $(RUSTCSRC)vendor
++  VENDOR_DIR := $(RUSTCSRC)/vendor
+   MINICARGO_FLAGS += --manifest-overrides 
rustc-$(RUSTC_VERSION)-overrides.toml
+ endif
+ ifeq ($(RUSTC_VERSION),1.54.0)
+@@ -218,6 +229,7 @@ bin/testrunner$(EXESUF):
+ # rustc (with std/cargo) source download
+ #
+ RUSTC_SRC_TARBALL := rustc-$(RUSTC_VERSION)-src.tar.gz
++ifeq ($(RUSTC_SRC_PROVIDED),0)
+ $(RUSTC_SRC_TARBALL):
+       @echo [CURL] $@
+       @rm -f $@
+@@ -225,15 +237,23 @@ $(RUSTC_SRC_TARBALL):
+ rustc-$(RUSTC_VERSION)-src/extracted: $(RUSTC_SRC_TARBALL)
+       tar -xzf $(RUSTC_SRC_TARBALL)
+       touch $@
+-$(RUSTC_SRC_DL): rustc-$(RUSTC_VERSION)-src/extracted 
rustc-$(RUSTC_VERSION)-src.patch
+-      cd $(RUSTCSRC) && patch -p0 < ../rustc-$(RUSTC_VERSION)-src.patch;
++else
++$(RUSTC_SRC_TARBALL):
++      @echo "RUSTC_SRC_PROVIDED is set, no need to fetch source"
++rustc-$(RUSTC_VERSION)-src/extracted: $(RUSTC_SRC_TARBALL)
++      touch $(RUSTCSRC)/extracted
++endif
++
++$(RUSTC_SRC_DL): $(RUSTC_SRC_TARBALL) rustc-$(RUSTC_VERSION)-src/extracted 
rustc-$(RUSTC_VERSION)-src.patch
++      PATCH_FILE=$(abspath rustc-$(RUSTC_VERSION)-src.patch); \
++      cd $(RUSTCSRC) && patch -p0 < $$PATCH_FILE;
+       touch $@
+ 
+ # Standard library crates
+ # - libstd, libpanic_unwind, libtest and libgetopts
+ # - libproc_macro (mrustc)
+ ifeq ($(USE_MERGED_BUILD),1)
+-$(RUSTCSRC)mrustc-stdlib/Cargo.toml: $(RUSTC_SRC_DL) minicargo.mk
++$(RUSTCSRC)/mrustc-stdlib/Cargo.toml: $(RUSTC_SRC_DL) minicargo.mk
+       @mkdir -p $(dir $@)
+       @echo "#![no_core]" > $(dir $@)/lib.rs
+       @echo "[package]" > $@
+@@ -248,23 +268,23 @@ $(RUSTCSRC)mrustc-stdlib/Cargo.toml: $(RUSTC_SRC_DL) 
minicargo.mk
+       @echo "rustc-std-workspace-core = { path = 
\"../$(RUST_LIB_PREFIX)rustc-std-workspace-core\" }" >> $@
+       @echo "rustc-std-workspace-alloc = { path = 
\"../$(RUST_LIB_PREFIX)rustc-std-workspace-alloc\" }" >> $@
+       @echo "rustc-std-workspace-std = { path = 
\"../$(RUST_LIB_PREFIX)rustc-std-workspace-std\" }" >> $@
+-LIBS: $(RUSTCSRC)mrustc-stdlib/Cargo.toml $(MRUSTC) $(MINICARGO)
+-      +STD_ENV_ARCH=$(RUSTC_ARCH) $(MINICARGO) --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)mrustc-stdlib/
++LIBS: $(RUSTCSRC)/mrustc-stdlib/Cargo.toml $(MRUSTC) $(MINICARGO)
++      +STD_ENV_ARCH=$(RUSTC_ARCH) $(MINICARGO) --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)/mrustc-stdlib/
+       +$(MINICARGO) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
lib/libproc_macro
+ else
+ LIBS: $(MRUSTC) $(MINICARGO) $(RUSTC_SRC_DL)
+-      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)$(RUST_LIB_PREFIX)std
+-      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)$(RUST_LIB_PREFIX)panic_unwind
+-      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)$(RUST_LIB_PREFIX)test
++      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)/$(RUST_LIB_PREFIX)std
++      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)/$(RUST_LIB_PREFIX)panic_unwind
++      +$(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides 
$(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
$(RUSTCSRC)/$(RUST_LIB_PREFIX)test
+       +$(MINICARGO) --output-dir $(OUTDIR) $(MINICARGO_FLAGS) 
lib/libproc_macro
+ endif
+ 
+ # Dynamically linked version of the standard library
+ $(OUTDIR)test/libtest.so: $(RUSTC_SRC_DL)
+       mkdir -p $(dir $@)
+-      +MINICARGO_DYLIB=1 $(MINICARGO) $(RUSTCSRC)$(RUST_LIB_PREFIX)std        
  --vendor-dir $(VENDOR_DIR) --script-overrides $(OVERRIDE_DIR) --output-dir 
$(dir $@) $(MINICARGO_FLAGS)
+-      +MINICARGO_DYLIB=1 $(MINICARGO) 
$(RUSTCSRC)$(RUST_LIB_PREFIX)panic_unwind --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(dir $@) $(MINICARGO_FLAGS)
+-      +MINICARGO_DYLIB=1 $(MINICARGO) $(RUSTCSRC)$(RUST_LIB_PREFIX)test       
  --vendor-dir $(VENDOR_DIR) --output-dir $(dir $@) $(MINICARGO_FLAGS)
++      +MINICARGO_DYLIB=1 $(MINICARGO) $(RUSTCSRC)/$(RUST_LIB_PREFIX)std       
   --vendor-dir $(VENDOR_DIR) --script-overrides $(OVERRIDE_DIR) --output-dir 
$(dir $@) $(MINICARGO_FLAGS)
++      +MINICARGO_DYLIB=1 $(MINICARGO) 
$(RUSTCSRC)/$(RUST_LIB_PREFIX)panic_unwind --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(dir $@) $(MINICARGO_FLAGS)
++      +MINICARGO_DYLIB=1 $(MINICARGO) $(RUSTCSRC)/$(RUST_LIB_PREFIX)test      
   --vendor-dir $(VENDOR_DIR) --output-dir $(dir $@) $(MINICARGO_FLAGS)
+       test -e $@
+ 
+ RUSTC_ENV_VARS := CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET)
+@@ -281,17 +301,17 @@ RUSTC_ENV_VARS += RUSTC_BOOTSTRAP=1
+ 
+ $(OUTDIR)rustc: $(MRUSTC) $(MINICARGO) LIBS $(LLVM_CONFIG)
+       mkdir -p $(OUTDIR)rustc-build
+-      +$(RUSTC_ENV_VARS) $(MINICARGO) $(RUSTCSRC)$(SRCDIR_RUSTC) --vendor-dir 
$(VENDOR_DIR) --output-dir $(OUTDIR)rustc-build -L $(OUTDIR) $(MINICARGO_FLAGS) 
$(MINICARGO_FLAGS_$@)
++      +$(RUSTC_ENV_VARS) $(MINICARGO) $(RUSTCSRC)/$(SRCDIR_RUSTC) 
--vendor-dir $(VENDOR_DIR) --output-dir $(OUTDIR)rustc-build -L $(OUTDIR) 
$(MINICARGO_FLAGS) $(MINICARGO_FLAGS_$@)
+       test -e $@ -a ! $(OUTDIR)rustc-build/$(RUSTC_OUT_BIN) -nt $@ || cp 
$(OUTDIR)rustc-build/$(RUSTC_OUT_BIN) $@
+ $(OUTDIR)rustc-build/librustc_driver.rlib: $(MRUSTC) $(MINICARGO) LIBS
+       mkdir -p $(OUTDIR)rustc-build
+-      +$(RUSTC_ENV_VARS) $(MINICARGO) $(RUSTCSRC)$(SRCDIR_RUSTC_DRIVER) 
--vendor-dir $(VENDOR_DIR) --output-dir $(OUTDIR)rustc-build -L $(OUTDIR) 
$(MINICARGO_FLAGS) $(MINICARGO_FLAGS_$(OUTDIR)rustc)
++      +$(RUSTC_ENV_VARS) $(MINICARGO) $(RUSTCSRC)/$(SRCDIR_RUSTC_DRIVER) 
--vendor-dir $(VENDOR_DIR) --output-dir $(OUTDIR)rustc-build -L $(OUTDIR) 
$(MINICARGO_FLAGS) $(MINICARGO_FLAGS_$(OUTDIR)rustc)
+ $(OUTDIR)cargo: $(MRUSTC) LIBS
+       mkdir -p $(OUTDIR)cargo-build
+-      +$(CARGO_ENV_VARS) $(MINICARGO) $(RUSTCSRC)src/tools/cargo --vendor-dir 
$(VENDOR_DIR) --output-dir $(OUTDIR)cargo-build -L $(OUTDIR) $(MINICARGO_FLAGS) 
$(MINICARGO_FLAGS_$@)
++      +$(CARGO_ENV_VARS) $(MINICARGO) $(RUSTCSRC)/src/tools/cargo 
--vendor-dir $(VENDOR_DIR) --output-dir $(OUTDIR)cargo-build -L $(OUTDIR) 
$(MINICARGO_FLAGS) $(MINICARGO_FLAGS_$@)
+       test -e $@ -a ! $(OUTDIR)cargo-build/cargo -nt $@ || cp 
$(OUTDIR)cargo-build/cargo $@
+ 
+-# Reference $(RUSTCSRC)src/bootstrap/native.rs for these values
++# Reference $(RUSTCSRC)/src/bootstrap/native.rs for these values
+ LLVM_CMAKE_OPTS := LLVM_TARGET_ARCH=$(firstword $(subst -, ,$(RUSTC_TARGET))) 
LLVM_DEFAULT_TARGET_TRIPLE=$(RUSTC_TARGET)
+ LLVM_CMAKE_OPTS += LLVM_TARGETS_TO_BUILD="$(LLVM_TARGETS)"
+ LLVM_CMAKE_OPTS += LLVM_ENABLE_ASSERTIONS=OFF
+@@ -303,22 +323,22 @@ LLVM_CMAKE_OPTS += CMAKE_BUILD_TYPE=Release
+ LLVM_CMAKE_OPTS += $(LLVM_CMAKE_OPTS_EXTRA)
+ 
+ 
+-$(RUSTCSRC)build/bin/llvm-config: $(RUSTCSRC)build/Makefile
+-      $Vcd $(RUSTCSRC)build && $(MAKE) -j $(PARLEVEL)
++$(RUSTCSRC)/build/bin/llvm-config: $(RUSTCSRC)/build/Makefile
++      $Vcd $(RUSTCSRC)/build && $(MAKE) -j $(PARLEVEL)
+ 
+-$(RUSTCSRC)build/Makefile: $(RUSTCSRC)$(LLVM_DIR)/CMakeLists.txt
+-      @mkdir -p $(RUSTCSRC)build
+-      $Vcd $(RUSTCSRC)build && cmake $(addprefix -D , $(LLVM_CMAKE_OPTS)) 
../$(LLVM_DIR)
++$(RUSTCSRC)/build/Makefile: $(RUSTCSRC)/$(LLVM_DIR)/CMakeLists.txt
++      @mkdir -p $(RUSTCSRC)/build
++      $Vcd $(RUSTCSRC)/build && cmake $(addprefix -D , $(LLVM_CMAKE_OPTS)) 
../$(LLVM_DIR)
+ 
+ #
+ # Developement-only targets
+ #
+ $(OUTDIR)libcore.rlib: $(MRUSTC) $(MINICARGO)
+-      $(MINICARGO) $(RUSTCSRC)src/libcore --script-overrides $(OVERRIDE_DIR) 
--output-dir $(OUTDIR) $(MINICARGO_FLAGS)
++      $(MINICARGO) $(RUSTCSRC)/src/libcore --script-overrides $(OVERRIDE_DIR) 
--output-dir $(OUTDIR) $(MINICARGO_FLAGS)
+ $(OUTDIR)liballoc.rlib: $(MRUSTC) $(MINICARGO)
+-      $(MINICARGO) $(RUSTCSRC)src/liballoc --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS)
++      $(MINICARGO) $(RUSTCSRC)/src/liballoc --vendor-dir $(VENDOR_DIR) 
--script-overrides $(OVERRIDE_DIR) --output-dir $(OUTDIR) $(MINICARGO_FLAGS)
+ $(OUTDIR)rustc-build/librustdoc.rlib: $(MRUSTC) LIBS
+-      $(MINICARGO) $(RUSTCSRC)src/librustdoc --vendor-dir $(VENDOR_DIR) 
--output-dir $(dir $@) -L $(OUTDIR) $(MINICARGO_FLAGS)
++      $(MINICARGO) $(RUSTCSRC)/src/librustdoc --vendor-dir $(VENDOR_DIR) 
--output-dir $(dir $@) -L $(OUTDIR) $(MINICARGO_FLAGS)
+ #$(OUTDIR)cargo-build/libserde-1_0_6.rlib: $(MRUSTC) LIBS
+ #     $(MINICARGO) $(VENDOR_DIR)/serde --vendor-dir $(VENDOR_DIR) 
--output-dir $(dir $@) -L $(OUTDIR) $(MINICARGO_FLAGS)
+ $(OUTDIR)cargo-build/libgit2-0_6_6.rlib: $(MRUSTC) LIBS
+@@ -359,9 +379,9 @@ $(OUTDIR)test/librust_test_helpers.a: 
$(OUTDIR)test/rust_test_helpers.o
+       @mkdir -p $(dir $@)
+       ar cur $@ $<
+ ifeq ($(RUSTC_VERSION),1.19.0)
+-RUST_TEST_HELPERS_C := $(RUSTCSRC)src/rt/rust_test_helpers.c
++RUST_TEST_HELPERS_C := $(RUSTCSRC)/src/rt/rust_test_helpers.c
+ else
+-RUST_TEST_HELPERS_C := $(RUSTCSRC)src/test/auxiliary/rust_test_helpers.c
++RUST_TEST_HELPERS_C := $(RUSTCSRC)/src/test/auxiliary/rust_test_helpers.c
+ endif
+ output$(OUTDIR_SUF)/test/rust_test_helpers.o: $(RUST_TEST_HELPERS_C)
+       @mkdir -p $(dir $@)
+@@ -434,8 +454,8 @@ RUNTIME_ARGS_$(OUTDIR)stdtest/collectionstests += --skip 
::vec::overaligned_allo
+ #ENV_$(OUTDIR)stdtest/rustc-test := 
+ #ENV_$(OUTDIR)stdtest/rustc-test += CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET)
+ 
+-$(OUTDIR)stdtest/%-test: $(RUSTCSRC)$(RUST_LIB_PREFIX)/Cargo.toml LIBS
+-      +MRUSTC_LIBDIR=$(abspath $(OUTDIR)) $(MINICARGO) --test 
$(RUSTCSRC)$(RUST_LIB_PREFIX)$* --vendor-dir $(VENDOR_DIR) --output-dir $(dir 
$@) -L $(OUTDIR)
++$(OUTDIR)stdtest/%-test: $(RUSTCSRC)/$(RUST_LIB_PREFIX)/Cargo.toml LIBS
++      +MRUSTC_LIBDIR=$(abspath $(OUTDIR)) $(MINICARGO) --test 
$(RUSTCSRC)/$(RUST_LIB_PREFIX)$* --vendor-dir $(VENDOR_DIR) --output-dir $(dir 
$@) -L $(OUTDIR)
+ $(OUTDIR)stdtest/collectionstests: $(OUTDIR)stdtest/alloc-test
+       test -e $@
+ $(OUTDIR)collectionstest_out.txt: $(OUTDIR)%
+-- 
+2.52.0
+

diff --git a/dev-lang/mrustc/files/mrustc-0.12.0-default-to-rust-1_90.patch 
b/dev-lang/mrustc/files/mrustc-0.12.0-default-to-rust-1_90.patch
new file mode 100644
index 000000000000..e9f29ac13a19
--- /dev/null
+++ b/dev-lang/mrustc/files/mrustc-0.12.0-default-to-rust-1_90.patch
@@ -0,0 +1,18 @@
+From f422e43cc314e4cfda059ddb63d31973c9e8b5b7 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <[email protected]>
+Date: Tue, 17 Dec 2024 17:55:59 +1000
+Subject: [PATCH] default to Rust 1_74
+
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -39,7 +39,7 @@
+ # undef max
+ #endif
+ 
+-TargetVersion gTargetVersion = TargetVersion::Rustc1_29;
++TargetVersion gTargetVersion = TargetVersion::Rustc1_90;
+ 
+ struct ProgramParams
+ {
+-- 
+2.47.1

diff --git a/dev-lang/mrustc/files/mrustc-0.12.0-git-be-gone.patch 
b/dev-lang/mrustc/files/mrustc-0.12.0-git-be-gone.patch
new file mode 100644
index 000000000000..1c83958a6711
--- /dev/null
+++ b/dev-lang/mrustc/files/mrustc-0.12.0-git-be-gone.patch
@@ -0,0 +1,25 @@
+From b1489480866deb22d0dc5244c7b8a0e233cc59bd Mon Sep 17 00:00:00 2001
+From: Matt Jolly <[email protected]>
+Date: Mon, 9 Mar 2026 19:25:35 +1000
+Subject: [PATCH] Build from a source tarball
+
+Signed-off-by: Matt Jolly <[email protected]>
+--- a/Makefile
++++ b/Makefile
+@@ -187,7 +187,7 @@ $(OBJDIR)%.o: src/%.cpp
+ $(OBJDIR)version.o: $(OBJDIR)%.o: src/%.cpp $(filter-out 
$(OBJDIR)version.o,$(OBJ)) Makefile
+       @+mkdir -p $(dir $@)
+       @echo [CXX] -o $@
+-      $V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF [email protected] -D 
VERSION_GIT_FULLHASH=\"$(shell git show --pretty=%H -s --no-show-signature)\" 
-D VERSION_GIT_BRANCH="\"$(shell git symbolic-ref -q --short HEAD || git 
describe --tags --exact-match)\"" -D VERSION_GIT_SHORTHASH=\"$(shell git show 
-s --pretty=%h --no-show-signature)\" -D VERSION_BUILDTIME="\"$(shell env 
LC_TIME=C date -u +"%a, %e %b %Y %T +0000")\"" -D VERSION_GIT_ISDIRTY=$(shell 
git diff-index --quiet HEAD; echo $$?)
++      $V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF [email protected] -D 
VERSION_GIT_FULLHASH=\"gentoo\" -D VERSION_GIT_BRANCH=\"gentoo\" -D 
VERSION_GIT_SHORTHASH=\"gentoo\" -D VERSION_BUILDTIME="\"$(shell env LC_TIME=C 
date -u +"%a, %e %b %Y %T +0000")\"" -D VERSION_GIT_ISDIRTY=0
+ 
+ src/main.cpp: $(PCHS:%=src/%.gch)
+ 
+@@ -201,4 +201,3 @@ bin/common_lib.a: $(wildcard tools/common/*)
+ -include $(OBJ:%=%.dep)
+ 
+ # vim: noexpandtab ts=4
+-
+-- 
+2.52.0
+

diff --git 
a/dev-lang/mrustc/files/mrustc-0.12.0-no-glibcxx-assertions-workaround.patch 
b/dev-lang/mrustc/files/mrustc-0.12.0-no-glibcxx-assertions-workaround.patch
new file mode 100644
index 000000000000..5b800e5a90a4
--- /dev/null
+++ b/dev-lang/mrustc/files/mrustc-0.12.0-no-glibcxx-assertions-workaround.patch
@@ -0,0 +1,97 @@
+From 0d2484695bb5df19465dba3afb430e6e343bd7f0 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <[email protected]>
+Date: Mon, 9 Mar 2026 19:26:56 +1000
+Subject: [PATCH] Pass -U_GLIBCXX_ASSERTIONS when building mrustc as a
+ workaround
+
+Signed-off-by: Matt Jolly <[email protected]>
+--- a/Makefile
++++ b/Makefile
+@@ -47,7 +47,7 @@ CXXFLAGS := -g -Wall
+ CXXFLAGS += -std=c++14
+ #CXXFLAGS += -Wextra
+ CXXFLAGS += -O2
+-CXXFLAGS += $(CXXFLAGS_EXTRA)
++CXXFLAGS += $(CXXFLAGS_EXTRA) -U_GLIBCXX_ASSERTIONS
+ 
+ CPPFLAGS := -I src/include/ -I src/
+ CPPFLAGS += -I tools/common/
+--- a/src/trans/codegen_c.cpp
++++ b/src/trans/codegen_c.cpp
+@@ -1302,6 +1302,7 @@ namespace {
+                 {
+                     args.push_back( a.c_str() );
+                 }
++                args.push_back("-U_GLIBCXX_ASSERTIONS"); // TODO
+                 args.push_back("-Wno-psabi");   // Suppress "note: the ABI 
for passing parameters with 128-byte alignment has changed in GCC 4.6"
+                 switch(opt.opt_level)
+                 {
+--- a/tools/common/Makefile
++++ b/tools/common/Makefile
+@@ -12,7 +12,7 @@ OBJS += jobserver.o
+ 
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+ 
+-CXXFLAGS += $(CXXFLAGS_EXTRA)
++CXXFLAGS += $(CXXFLAGS_EXTRA) -U_GLIBCXX_ASSERTIONS
+ 
+ OBJS := $(OBJS:%=$(OBJDIR)%)
+ 
+--- a/tools/dump_hirfile/Makefile
++++ b/tools/dump_hirfile/Makefile
+@@ -16,7 +16,7 @@ OBJS := main.o
+ 
+ LINKFLAGS := -g -lpthread -lz
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+-CXXFLAGS += -I ../common -I ../../src -I ../../src/include
++CXXFLAGS += -I ../common -I ../../src -I ../../src/include 
-U_GLIBCXX_ASSERTIONS
+ 
+ CXXFLAGS += $(CXXFLAGS_EXTRA)
+ LINKFLAGS += $(LINKFLAGS_EXTRA)
+--- a/tools/minicargo/Makefile
++++ b/tools/minicargo/Makefile
+@@ -25,7 +25,7 @@ OBJS += resolve_cargo.o
+ 
+ LINKFLAGS := -g -lpthread
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+-CXXFLAGS += -I ../common
++CXXFLAGS += -I ../common -U_GLIBCXX_ASSERTIONS
+ 
+ CXXFLAGS += $(CXXFLAGS_EXTRA)
+ LINKFLAGS += $(LINKFLAGS_EXTRA)
+--- a/tools/mir_opt_test/Makefile
++++ b/tools/mir_opt_test/Makefile
+@@ -16,7 +16,7 @@ LIBS := ../../bin/mrustc.a ../../bin/common_lib.a
+ 
+ LINKFLAGS := -g -lpthread -lz
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+-CXXFLAGS += -I ../common -I ../../src/include -I ../../src -I .
++CXXFLAGS += -I ../common -I ../../src/include -I ../../src -I . 
-U_GLIBCXX_ASSERTIONS
+ CXXFLAGS += -Wno-misleading-indentation       # Gets REALLY confused by the 
TU_ARM macro
+ 
+ CXXFLAGS += $(CXXFLAGS_EXTRA)
+--- a/tools/standalone_miri/Makefile
++++ b/tools/standalone_miri/Makefile
+@@ -16,7 +16,7 @@ OBJS += miri.o miri_extern.o miri_intrinsic.o
+ 
+ LINKFLAGS := -g -lpthread
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+-CXXFLAGS += -I ../common -I ../../src/include -I .
++CXXFLAGS += -I ../common -I ../../src/include -I . -U_GLIBCXX_ASSERTIONS
+ CXXFLAGS += -Wno-misleading-indentation       # Gets REALLY confused by the 
TU_ARM macro
+ 
+ CXXFLAGS += $(CXXFLAGS_EXTRA)
+--- a/tools/testrunner/Makefile
++++ b/tools/testrunner/Makefile
+@@ -8,7 +8,7 @@ OBJS := main.o path.o
+ LINKFLAGS := -g
+ CXXFLAGS := -Wall -std=c++14 -g -O2
+ 
+-CXXFLAGS += $(CXXFLAGS_EXTRA)
++CXXFLAGS += $(CXXFLAGS_EXTRA) -U_GLIBCXX_ASSERTIONS
+ LINKFLAGS += $(LINKFLAGS_EXTRA)
+ 
+ OBJS := $(OBJS:%=$(OBJDIR)%)
+-- 
+2.52.0
+

diff --git a/dev-lang/mrustc/mrustc-9999.ebuild 
b/dev-lang/mrustc/mrustc-0.12.0.ebuild
similarity index 87%
copy from dev-lang/mrustc/mrustc-9999.ebuild
copy to dev-lang/mrustc/mrustc-0.12.0.ebuild
index 28592e15c064..e66fc9e9b71c 100644
--- a/dev-lang/mrustc/mrustc-9999.ebuild
+++ b/dev-lang/mrustc/mrustc-0.12.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2024-2025 Gentoo Authors
+# Copyright 2024-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -6,9 +6,9 @@ EAPI=8
 inherit edo multiprocessing rust-toolchain toolchain-funcs
 
 # The makefile needs to know the version of rust to build
-RUST_VERSION=1.74.1
+RUST_VERSION=1.90.0
 # We need to pretend to be this version of Rust for mrustc build and outputs
-MRUSTC_RUST_VER=1.74.0
+MRUSTC_RUST_VER=1.90.0
 
 DESCRIPTION="Mutabah's Rust Compiler"
 HOMEPAGE="https://github.com/thepowersgang/mrustc";
@@ -35,10 +35,11 @@ RDEPEND="
 BDEPEND="sys-devel/gcc:*"
 
 PATCHES=(
-       "${FILESDIR}/${PN}-0.11.0-default-to-rust-1_74.patch"
-       "${FILESDIR}/${PN}-0.11.0-RUSTC_SRC_PROVIDED.patch"
-       "${FILESDIR}/${PN}-0.11.2-no-glibcxx-assertions-workaround.patch"
-       "${FILESDIR}/${PN}-0.11.2-no-glibcxx-assertions-workaround-more.patch"
+       "${FILESDIR}/${PN}-0.11.2-dont-strip-bins.patch"
+       "${FILESDIR}/${PN}-0.12.0-default-to-rust-1_90.patch"
+       "${FILESDIR}/${PN}-0.12.0-build-with-provided-rust.patch"
+       "${FILESDIR}/${PN}-0.12.0-git-be-gone.patch"
+       "${FILESDIR}/${PN}-0.12.0-no-glibcxx-assertions-workaround.patch"
 )
 
 QA_FLAGS_IGNORED="
@@ -77,7 +78,7 @@ src_test() {
        emake -e -f minicargo.mk local_tests
        # build and run 'hello world' (this is called using 'test' in the 
makefile, but we can do it manually)
        edo "${S}"/bin/mrustc -L "${S}"/output-${MRUSTC_RUST_VER}/ \
-               -g 
"${S}/../rustc-${RUST_VERSION}-src/tests/ui/hello_world/main.rs" -o "${T}"/hello
+               -g 
"${S}/../rustc-${RUST_VERSION}-src/tests/ui/parallel-rustc/hello_world.rs" -o 
"${T}"/hello
        "${T}"/hello || die "Failed to run hello_world built with mrustc"
 }
 

diff --git a/dev-lang/mrustc/mrustc-9999.ebuild 
b/dev-lang/mrustc/mrustc-9999.ebuild
index 28592e15c064..8a4bba4af680 100644
--- a/dev-lang/mrustc/mrustc-9999.ebuild
+++ b/dev-lang/mrustc/mrustc-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2024-2025 Gentoo Authors
+# Copyright 2024-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -6,9 +6,9 @@ EAPI=8
 inherit edo multiprocessing rust-toolchain toolchain-funcs
 
 # The makefile needs to know the version of rust to build
-RUST_VERSION=1.74.1
+RUST_VERSION=1.90.0
 # We need to pretend to be this version of Rust for mrustc build and outputs
-MRUSTC_RUST_VER=1.74.0
+MRUSTC_RUST_VER=1.90.0
 
 DESCRIPTION="Mutabah's Rust Compiler"
 HOMEPAGE="https://github.com/thepowersgang/mrustc";
@@ -16,6 +16,7 @@ HOMEPAGE="https://github.com/thepowersgang/mrustc";
 if [[ ${PV} == *"9999"* ]]; then
        inherit git-r3
        EGIT_REPO_URI="https://github.com/thepowersgang/mrustc.git";
+       
SRC_URI="https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz";
 else
        
SRC_URI="https://github.com/thepowersgang/mrustc/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz
                
https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz
@@ -35,18 +36,34 @@ RDEPEND="
 BDEPEND="sys-devel/gcc:*"
 
 PATCHES=(
-       "${FILESDIR}/${PN}-0.11.0-default-to-rust-1_74.patch"
-       "${FILESDIR}/${PN}-0.11.0-RUSTC_SRC_PROVIDED.patch"
-       "${FILESDIR}/${PN}-0.11.2-no-glibcxx-assertions-workaround.patch"
-       "${FILESDIR}/${PN}-0.11.2-no-glibcxx-assertions-workaround-more.patch"
+       "${FILESDIR}/${PN}-0.11.2-dont-strip-bins.patch"
+       "${FILESDIR}/${PN}-0.12.0-default-to-rust-1_90.patch"
+       "${FILESDIR}/${PN}-0.12.0-build-with-provided-rust.patch"
+       "${FILESDIR}/${PN}-0.12.0-no-glibcxx-assertions-workaround.patch"
 )
 
+if [[ ${PV} != *"9999"* ]]; then
+       PATCHES+=(
+               "${FILESDIR}/${PN}-0.12.0-git-be-gone.patch"
+       )
+fi
+
 QA_FLAGS_IGNORED="
        usr/lib/rust/${P}/bin/mrustc
        usr/lib/rust/${P}/bin/minicargo
        usr/lib/rust/${P}/lib/rustlib/$(rust_abi)/lib/*.rlib
 "
 
+src_unpack() {
+       if [[ ${PV} == *"9999"* ]]; then
+               default
+               git-r3_src_unpack
+       else
+               default
+       fi
+
+}
+
 src_configure() {
        :
 }
@@ -77,7 +94,7 @@ src_test() {
        emake -e -f minicargo.mk local_tests
        # build and run 'hello world' (this is called using 'test' in the 
makefile, but we can do it manually)
        edo "${S}"/bin/mrustc -L "${S}"/output-${MRUSTC_RUST_VER}/ \
-               -g 
"${S}/../rustc-${RUST_VERSION}-src/tests/ui/hello_world/main.rs" -o "${T}"/hello
+               -g 
"${S}/../rustc-${RUST_VERSION}-src/tests/ui/parallel-rustc/hello_world.rs" -o 
"${T}"/hello
        "${T}"/hello || die "Failed to run hello_world built with mrustc"
 }
 

Reply via email to