public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mold] rawhide: Update to 3.0.0 (#2546053)
@ 2026-11-01 10:51 Christoph Erhardt
0 siblings, 0 replies; only message in thread
From: Christoph Erhardt @ 2026-11-01 10:51 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/mold
Branch : rawhide
Commit : 32a695788e5cc8d48acb27b04f4eb665e06bebb7
Author : Christoph Erhardt <fedora@sicherha.de>
Date : 2026-11-01T11:47:23+01:00
Stats : +150/-97 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/mold/c/32a695788e5cc8d48acb27b04f4eb665e06bebb7?branch=rawhide
Log:
Update to 3.0.0 (#2546053)
mold is now implemented in Rust.
The required dependencies exist in Fedora >= 43 and EPEL >= 10.
---
diff --git a/0001-Update-cpp_demangle-to-0.5.1.patch b/0001-Update-cpp_demangle-to-0.5.1.patch
new file mode 100644
index 0000000..48a8a29
--- /dev/null
+++ b/0001-Update-cpp_demangle-to-0.5.1.patch
@@ -0,0 +1,59 @@
+From 190c9f7c53e8b6865204bb0ae1d1e6a9d6c21d65 Mon Sep 17 00:00:00 2001
+Message-ID: <190c9f7c53e8b6865204bb0ae1d1e6a9d6c21d65.1793467150.git.github@sicherha.de>
+From: orielhaim <orielhaim2@gmail.com>
+Date: Mon, 5 Oct 2026 22:22:37 +0300
+Subject: [PATCH] Update cpp_demangle to 0.5.1
+
+---
+ Cargo.lock | 4 ++--
+ Cargo.toml | 2 +-
+ src/util/demangle.rs | 4 +---
+ 3 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/Cargo.lock b/Cargo.lock
+index 60fb12890..2cbc9b97b 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -64,9 +64,9 @@ checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
+
+ [[package]]
+ name = "cpp_demangle"
+-version = "0.4.5"
++version = "0.5.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f2bb79cb74d735044c972aae58ed0aaa9a837e85b01106a54c39e42e97f62253"
++checksum = "0667304c32ea56cb4cd6d2d7c0cfe9a2f8041229db8c033af7f8d69492429def"
+ dependencies = [
+ "cfg-if",
+ ]
+diff --git a/Cargo.toml b/Cargo.toml
+index 32dbb68e1..07c4ef40d 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -29,7 +29,7 @@ mold = { path = "." }
+ [dependencies]
+ blake3 = "1.8.7"
+ bstr = "1"
+-cpp_demangle = "0.4"
++cpp_demangle = "0.5.1"
+ crc32fast = "1"
+ flate2 = { version = "1", default-features = false, features = ["zlib"] }
+ getrandom = "0.4.3"
+diff --git a/src/util/demangle.rs b/src/util/demangle.rs
+index 46c720d07..e819c19e7 100644
+--- a/src/util/demangle.rs
++++ b/src/util/demangle.rs
+@@ -5,9 +5,7 @@ pub fn demangle_cpp(name: &[u8]) -> Option<String> {
+ if !name.starts_with(b"_Z") {
+ return None;
+ }
+- let sym = cpp_demangle::Symbol::new(name).ok()?;
+- let options = cpp_demangle::DemangleOptions::default();
+- sym.demangle(&options).ok()
++ cpp_demangle::Symbol::new(name).ok()?.demangle().ok()
+ }
+
+ /// Demangles a Rust symbol name in either the legacy or the v0 scheme.
+--
+2.56.0
+
diff --git a/0001-Use-system-compatible-include-path-for-xxhash.h.patch b/0001-Use-system-compatible-include-path-for-xxhash.h.patch
deleted file mode 100644
index cc4dc0c..0000000
--- a/0001-Use-system-compatible-include-path-for-xxhash.h.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From bd078876b1d067e882308b51973a373fb18fc5b1 Mon Sep 17 00:00:00 2001
-Message-ID: <bd078876b1d067e882308b51973a373fb18fc5b1.1749475017.git.github@sicherha.de>
-From: Christoph Erhardt <github@sicherha.de>
-Date: Sat, 6 Aug 2022 09:18:54 +0200
-Subject: [PATCH] Use system-compatible include path for `xxhash.h`
-
-Distributors that build mold against the system-provided xxHash package
-expect its header file `xxhash.h` in the top-level include directory,
-not in an `xxhash` subdirectory. Adjust the include path and the
-`#include` directive accordingly.
----
- CMakeLists.txt | 2 ++
- lib/lib.h | 2 +-
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0038d391..f28ae233 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -233,6 +233,8 @@ else()
- mold_add_tbb()
- endif()
-
-+target_include_directories(mold PRIVATE third-party/xxhash)
-+
- # We always use Clang to build mold on Windows. MSVC can't compile mold.
- if(WIN32)
- if(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-diff --git a/lib/lib.h b/lib/lib.h
-index b2a85dd9..6ca2d2e3 100644
---- a/lib/lib.h
-+++ b/lib/lib.h
-@@ -36,7 +36,7 @@
- #endif
-
- #define XXH_INLINE_ALL 1
--#include "../third-party/xxhash/xxhash.h"
-+#include <xxhash.h>
-
- #ifdef NDEBUG
- # define unreachable() __builtin_unreachable()
---
-2.49.0
-
diff --git a/0002-Adjust-dependencies-for-Fedora-Linux.patch b/0002-Adjust-dependencies-for-Fedora-Linux.patch
new file mode 100644
index 0000000..da2be61
--- /dev/null
+++ b/0002-Adjust-dependencies-for-Fedora-Linux.patch
@@ -0,0 +1,47 @@
+From 9ca791777805e579678b4a9c546a63fb3f1b3104 Mon Sep 17 00:00:00 2001
+Message-ID: <9ca791777805e579678b4a9c546a63fb3f1b3104.1793482779.git.github@sicherha.de>
+From: Christoph Erhardt <github@sicherha.de>
+Date: Sat, 31 Oct 2026 18:19:02 +0100
+Subject: [PATCH] Adjust dependencies for Fedora Linux
+
+Relax `uuid` to 1.26.1, which is the version available in Fedora and
+EPEL.
+
+Use the official upstream `mimalloc` crate instead of mold's fork. The
+fork bundles mimalloc 3.5.3, which fixes a crash on sparc64. Since that
+architecture is not supported by Fedora Linux, it makes no difference in
+practice.
+---
+ Cargo.toml | 2 +-
+ cli/Cargo.toml | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 07c4ef40d..6b02d649e 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -42,7 +42,7 @@ memmap2 = "0.9"
+ portable-atomic = "1"
+ rayon = "1"
+ rustc-demangle = "0.1"
+-uuid = { version = "1.27", default-features = false, features = ["v4"] }
++uuid = { version = "1.26.1", default-features = false, features = ["v4"] }
+ xxhash-rust = { version = "0.8", features = ["xxh3"] }
+ zstd = "0.13"
+
+diff --git a/cli/Cargo.toml b/cli/Cargo.toml
+index f9dfe9fda..5f8270457 100644
+--- a/cli/Cargo.toml
++++ b/cli/Cargo.toml
+@@ -16,7 +16,7 @@ path = "integration.rs"
+ harness = false
+
+ [dependencies]
+-mimalloc = { git = "https://github.com/rui314/mimalloc_rust", rev = "3979460494f1cd1e7f936cb8e10f41e927c9f698" }
++mimalloc = "0.1.52"
+ mold.workspace = true
+ mold-target-x86_64 = { path = "../arch/x86_64", optional = true }
+ mold-target-i386 = { path = "../arch/i386", optional = true }
+--
+2.56.0
+
diff --git a/mold.spec b/mold.spec
index b9ec107..084175a 100644
--- a/mold.spec
+++ b/mold.spec
@@ -1,14 +1,12 @@
%bcond check 1
-%global use_gcc_toolset 0%{?el8}
-%global use_system_tbb 0%{?fedora} >= 40 || 0%{?rhel} >= 10
-
-# 32-bit x86 is supported by RHEL < 10 and Fedora (the latter is implicitly
-# covered by the conditional expression)
-%global has_32bit_support 0%{?rhel} < 10
+# Prevent `gdb-add-index` from failing with `std::bad_alloc` on i386
+%ifarch %{ix86}
+%global rustflags_debuginfo 1
+%endif
Name: mold
-Version: 2.42.1
+Version: 3.0.0
Release: %autorelease
Summary: A Modern Linker
@@ -16,52 +14,44 @@ Summary: A Modern Linker
%global tag v%{version}
%forgemeta
-License: MIT AND (Apache-2.0 OR MIT)
+SourceLicense: MIT
+License: %{shrink:
+ MIT AND
+ (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND
+ (Apache-2.0 OR MIT) AND
+ BSL-1.0 AND
+ (MIT OR Apache-2.0) AND
+ (MIT-0 OR Apache-2.0) AND
+ (Unlicense OR MIT) AND
+ Zlib
+}
+# `LICENSE.dependencies` contains a full license breakdown
URL: %{forgeurl}
Source0: %{forgesource}
-# Allow building against the system-provided `xxhash.h`
-Patch0: 0001-Use-system-compatible-include-path-for-xxhash.h.patch
+# Upstream commit 4520bf5cbbcdfc64d8a1d71aae098cab58af5909
+Patch0: 0001-Update-cpp_demangle-to-0.5.1.patch
+# Adjust crate dependencies: relax uuid version, use mimalloc from crates.io
+Patch1: 0002-Adjust-dependencies-for-Fedora-Linux.patch
-BuildRequires: blake3-devel
-BuildRequires: cmake
-%if %{use_gcc_toolset}
-BuildRequires: gcc-toolset-13
-%else
+BuildRequires: cargo-rpm-macros
BuildRequires: gcc
-BuildRequires: gcc-c++ >= 10
-%endif
-BuildRequires: libzstd-devel
-BuildRequires: mimalloc-devel >= 3
-BuildRequires: xxhash-static
-BuildRequires: zlib-devel
-
-%if %{use_system_tbb}
-BuildRequires: tbb-devel >= 2021.9
-%else
-# API-incompatible with older tbb 2020.3 shipped by Fedora < 40:
-# https://bugzilla.redhat.com/show_bug.cgi?id=2036372
-Provides: bundled(tbb) = 2022.1
-# Required by bundled oneTBB
-BuildRequires: hwloc-devel
-%endif
# The following packages are only required for executing the tests
%if %{with check}
BuildRequires: binutils-devel
BuildRequires: clang
BuildRequires: gdb
+BuildRequires: gcc-c++
BuildRequires: glibc-static
-%if ! 0%{?el8}
%ifarch x86_64
-%if %{has_32bit_support}
+%if 0%{?fedora}
# Koji 64-bit buildroots do not contain packages from 32-bit builds, therefore
# the 'glibc-devel.i686' variant is provided as 'glibc32'.
BuildRequires: (glibc32 or glibc-devel(%__isa_name-32))
%endif
%endif
BuildRequires: libdwarf-tools
-%endif
BuildRequires: libstdc++-static
BuildRequires: llvm
BuildRequires: perl-interpreter
@@ -78,31 +68,32 @@ build time, especially in rapid debug-edit-rebuild cycles.
%prep
%forgeautosetup -p1
-rm -r third-party/{blake3,mimalloc,xxhash,zlib,zstd}
-%if %{use_system_tbb}
-rm -r third-party/tbb
-%endif
+%cargo_prep
+
+%generate_buildrequires
+%cargo_generate_buildrequires
%build
-%if %{use_gcc_toolset}
-. /opt/rh/gcc-toolset-13/enable
-%endif
-%if %{use_system_tbb}
-%define tbb_flags -DMOLD_USE_SYSTEM_TBB=ON
-%endif
-%cmake -DMOLD_USE_SYSTEM_MIMALLOC=ON %{?tbb_flags}
-%cmake_build
+# Set `MOLD_LIBDIR` in the build, check and install steps so `mold-wrapper.so`
+# is installed to (and searched in) the correct directory. This can be dropped
+# when packaging the next release.
+MOLD_LIBDIR="%{_libdir}" %cargo_build
+%{cargo_license_summary}
+%{cargo_license} > LICENSE.dependencies
%install
-%cmake_install
+DESTDIR="%{buildroot}" PREFIX="%{_prefix}" MOLD_LIBDIR="%{_libdir}" \
+ ./install-mold.sh
+# `LICENSE` is shipped via `%%license`
+rm -r "%{buildroot}%{_docdir}/mold"
touch %{buildroot}%{_bindir}/ld
%if %{with check}
%check
-%if %{use_gcc_toolset}
-. /opt/rh/gcc-toolset-13/enable
-%endif
-%ctest
+MOLD_LIBDIR="%{_libdir}" %cargo_test
+# Print skipped tests
+(cd target/rpm/mold-test/out/test/results &&
+ grep --files-with-matches --line-regexp skip */*.status) || :
%endif
%post
@@ -116,7 +107,7 @@ if [ "$1" = 0 ]; then
fi
%files
-%license %{_docdir}/mold/LICENSE
+%license LICENSE LICENSE.dependencies
%doc README.md
%ghost %{_bindir}/ld
%{_bindir}/mold
diff --git a/sources b/sources
index 70f4b62..1e076db 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (mold-2.42.1.tar.gz) = 8c771a781c19c0df562a3dcb648f851b3a32f2ac10115693ab180fd5faae1be8056b299ea2199516bfbfaef2411b4ddc858c79a3eb2422615ede3b982271b83a
+SHA512 (mold-3.0.0.tar.gz) = ba732b4e4ba38a404bb4c12ca8ded6cb820eb426d907958f1e5761f6815712a412ca10a9c2d737df8e692f7c25791fe612288e417549bba96a3d230bb99eb171
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-01 10:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01 10:51 [rpms/mold] rawhide: Update to 3.0.0 (#2546053) Christoph Erhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox