From f653a07bb893b028fdbfa2f46f486fcda6731d70 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 29 Sep 2024 21:15:45 +0300 Subject: [PATCH] gnu: mold: Only build with mimalloc on 64-bit systems. * gnu/packages/mold.scm (mold)[arguments]: Adjust the configure-flags to only use mimalloc on 64-bit systems. [inputs]: Only add mimalloc when building for a 64-bit system. Change-Id: I7fc8eed076072ccb49f180adbfb12683ae169eca --- gnu/packages/mold.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gnu/packages/mold.scm b/gnu/packages/mold.scm index d2534de6a1..fb669ec88e 100644 --- a/gnu/packages/mold.scm +++ b/gnu/packages/mold.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Zhu Zihao -;;; Copyright © 2023 Efraim Flashner +;;; Copyright © 2023, 2024 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,7 +55,11 @@ (define-public mold (build-system cmake-build-system) (arguments (list - #:configure-flags #~(list "-DMOLD_USE_SYSTEM_MIMALLOC=ON" + ;; Mold only uses mimalloc on 64-bit systems, even with the + ;; configure flag set, saying it is unstable on 32-bit systems. + #:configure-flags #~(list #$@(if (target-64bit?) + '("-DMOLD_USE_SYSTEM_MIMALLOC=ON") + '("-DMOLD_USE_MIMALLOC=OFF")) "-DMOLD_USE_SYSTEM_TBB=ON" "-DBUILD_TESTING=ON") #:phases @@ -81,7 +85,12 @@ (define-public mold ;; but compiler in Guix will insert the path of gcc-lib and ;; glibc into the output binary. (delete-file "test/rpath.sh")))))) - (inputs (list mimalloc tbb xxhash zlib `(,zstd "lib"))) + (inputs + (append + (if (target-64bit?) + (list mimalloc) + '()) + (list tbb xxhash zlib `(,zstd "lib")))) (home-page "https://github.com/rui314/mold") (synopsis "Fast linker") (description