Subject: [bug#61009] [PATCH v2] Building Icecat and jemalloc on aarch64-linux

From: Roman Scherer <[email-masked]>
Date: Sun, 05 Feb 2023 17:35:28 +0100

Hi Guix,

here is another approach to this. This patch series updates jemalloc to
v5.3.0 and does not disable transparent huge pages on aarch64-linux,
similar to what we do on i686-linux and x86_64-linux. So I think this
would support now building binaries for Rust and Icecat on CI for 4K but
also larger kernel page sizes.

Could you please review the patches?

Thanks, Roman.

From ae69696267b0651fb2be40e4b31584d1c84647b6 Mon Sep 17 00:00:00 2001
From: r0man <[email-masked]>
Date: Sun, 5 Feb 2023 10:57:15 +0100
Subject: [PATCH 1/3] gnu: jemalloc: Update to 5.3.0.

* gnu/packages/jemalloc.scm (jemalloc): Update to 5.3.0.
---
 gnu/packages/jemalloc.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm
index 2e25780257..354f07a838 100644
--- a/gnu/packages/jemalloc.scm
+++ b/gnu/packages/jemalloc.scm
@@ -75,7 +75,7 @@ (define-public jemalloc-4.5.0
 (define-public jemalloc
   (package
     (inherit jemalloc-4.5.0)
-    (version "5.2.1")
+    (version "5.3.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -83,7 +83,7 @@ (define-public jemalloc
                     version "/jemalloc-" version ".tar.bz2"))
               (sha256
                (base32
-                "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl"))))
+                "1apyxjd1ixy4g8xkr61p0ny8jiz8vyv1j0k4nxqkxpqrf4g2vf1d"))))
     (arguments
       (substitute-keyword-arguments (package-arguments jemalloc-4.5.0)
         ;; Disable the thread local storage model in jemalloc 5 to prevent
-- 
2.38.1

From c228faf06983c1e36f633bad6a015dfe177a1702 Mon Sep 17 00:00:00 2001
From: r0man <[email-masked]>
Date: Sun, 5 Feb 2023 10:59:06 +0100
Subject: [PATCH 2/3] gnu: jemalloc: Build with transparent huge pacges on
 aarch64.

* gnu/packages/jemalloc.scm (jemalloc-4.5.0): Build with transparent huge pacges on aarch64.
---
 gnu/packages/jemalloc.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm
index 354f07a838..6c6ba0f568 100644
--- a/gnu/packages/jemalloc.scm
+++ b/gnu/packages/jemalloc.scm
@@ -56,7 +56,7 @@ (define-public jemalloc-4.5.0
              #t)))
        #:configure-flags
        '(,@(match (%current-system)
-             ((or "i686-linux" "x86_64-linux")
+             ((or "aarch64-linux" "i686-linux" "x86_64-linux")
               '())
              ("powerpc-linux"
               (list "--disable-thp" "CPPFLAGS=-maltivec"))
-- 
2.38.1

From 0311f5812ab091dabb0686a6373c0d17e006e0c5 Mon Sep 17 00:00:00 2001
From: r0man <[email-masked]>
Date: Sun, 5 Feb 2023 11:01:17 +0100
Subject: [PATCH 3/3] gnu: icecat: Remove unsupported --disable-eme option on
 aarch64.

* gnu/packages/gnuzilla.scm (icecat): Remove unsupported --disable-eme option on aarch64.
---
 gnu/packages/gnuzilla.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index b507ec0406..ad051e71f7 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -756,7 +756,8 @@ (define-public icecat
          "--disable-tests"
          "--disable-updater"
          "--disable-crashreporter"
-         "--disable-eme"
+         ;; The --disable-eme option is not available on aarch64.
+         #$(if (target-aarch64?) "" "--disable-eme")
 
          ;; Building with debugging symbols takes ~5GiB, so disable it.
          "--disable-debug"
-- 
2.38.1