all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#50091] [PATCH 00/21] Add riscv64 support
@ 2021-08-17 10:10 Efraim Flashner
  2021-08-17 10:18 ` [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate Efraim Flashner
                   ` (21 more replies)
  0 siblings, 22 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:10 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

This is the current tree for wip-riscv, which I rebase regularly on top
of core-updates-frozen. I'm not in love with raw-build-guile3 in
gnu/packages/bootstrap but I wasn't able to find another way to make it
work. I'll add some comments in response to the patches.

Everything was built using a SiFive HiFive Unmatched board¹. As a
comparison, my pine64 passed the build phase in mesa in 89 minutes, and
this board built it in 66 minutes.

¹ https://www.sifive.com/boards/hifive-unmatched

Efraim Flashner (21):
  utils: Define 'target-riscv?' predicate.
  gnu: bootstrap: Add support for riscv64-linux.
  gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux.
  gnu: %boot3-inputs: Add missing input.
  gnu: guile: Fix building on riscv64-linux.
  gnu: %final-inputs: Add implied gcc:lib input.
  gnu: bdb: Fix building on riscv64-linux.
  gnu: elfutils: Fix building on riscv64-linux.
  gnu: pcre: Fix building on riscv64-linux.
  gnu: openssl: Fix build on riscv64-linux.
  gnu: libtool: Fix building on riscv64-linux.
  gnu: openblas: Fix building on riscv64-linux.
  gnu: mesa: Add support for riscv64-linux.
  gnu: pcre2: Fix building on riscv64-linux.
  gnu: icu4c: Skip tests on riscv64-linux.
  gnu: openblas-ilp64: Add riscv64-linux as a supported architecture.
  gnu: openlibm: Remove riscv64-linux from supported systems.
  gnu: texlive-bin: Fix building on riscv64-linux.
  gnu: texlive-updmap.cfg: Update hash.
  gnu: lz4: Build on riscv64-linux without valgrind.
  gnu: lapack: Fix building on riscv64-linux.

 gnu/packages/bootstrap.scm                    | 112 +++++++++++++++++-
 gnu/packages/commencement.scm                 |  58 ++++++++-
 gnu/packages/compression.scm                  |   4 +-
 gnu/packages/dbm.scm                          |  23 ++--
 gnu/packages/elf.scm                          |  11 +-
 gnu/packages/gl.scm                           |  26 ++--
 gnu/packages/guile.scm                        |  22 ++--
 gnu/packages/icu4c.scm                        |   8 ++
 gnu/packages/maths.scm                        |  10 +-
 .../patches/libtool-skip-tests2.patch         |   8 +-
 gnu/packages/pcre.scm                         |  13 +-
 gnu/packages/tex.scm                          |  20 ++--
 gnu/packages/tls.scm                          |  11 +-
 guix/packages.scm                             |   4 +-
 guix/utils.scm                                |   9 +-
 m4/guix.m4                                    |   4 +-
 16 files changed, 283 insertions(+), 60 deletions(-)

-- 
2.32.0





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
@ 2021-08-17 10:18 ` Efraim Flashner
  2021-08-17 10:27   ` Maxime Devos
  2021-08-17 10:19 ` [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux Efraim Flashner
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:18 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* guix/utils.scm (target-riscv?): New predicate.
---
 guix/utils.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/guix/utils.scm b/guix/utils.scm
index 32fcff72ea..134879feb1 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -96,6 +96,7 @@
             target-arm?
             target-ppc32?
             target-powerpc?
+            target-riscv?
             target-64bit?
             cc-for-target
             cxx-for-target
@@ -699,6 +700,11 @@ architecture (x86_64)?"
                                                  (%current-system))))
   (string-prefix? "powerpc" target))
 
+(define* (target-riscv? #:optional (target (or (%current-target-system)
+                                               (%current-system))))
+  "Is the architecture of TARGET a 'riscv' architecture variant?"
+  (string-prefix? "riscv" target))
+
 (define* (target-64bit? #:optional (system (or (%current-target-system)
                                                (%current-system))))
   (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64")))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
  2021-08-17 10:18 ` [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-24 11:53   ` Efraim Flashner
  2021-09-23  7:35   ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 03/21] gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux Efraim Flashner
                   ` (19 subsequent siblings)
  21 siblings, 2 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

On 7d93b21ab1c132990054372a9677c1639d54e631
    gnu: glibc-for-bootstrap: Update patch.

Run
    ./pre-inst-env guix build --target=riscv64-linux-gnu bootstrap-tarballs

Producing
    /gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0

With guix hash -rx
    1nj0fdgj08bbmfny01mp2blv7c3p2iciqh31zmf04ap5s7ygsqlp

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
riscv64-linux.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for riscv64-linux.
(raw-build-guile3): New procedure.
(make-raw-bag): Use raw-build-guile3 for riscv64-linux.
* gnu/packages/commencement.scm (findutils-boot0)[arguments]: Don't
override TIME_T_32_BIT_OK on riscv64-linux.
* guix/packages.scm (%supported-systems): Add riscv64-linux.
(%cuirass-supported-systems): Remove riscv64-linux.
* guix/utils.scm (target-64bit?): Add riscv64-linux.
* m4/guix.m4: Add riscv64-linux as a supported system.
---
 gnu/packages/bootstrap.scm    | 112 +++++++++++++++++++++++++++++++++-
 gnu/packages/commencement.scm |   4 +-
 guix/packages.scm             |   4 +-
 guix/utils.scm                |   3 +-
 m4/guix.m4                    |   4 +-
 5 files changed, 118 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 5a8028a465..260c1b5b91 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -144,7 +144,16 @@
      ("tar"
       ,(base32 "150c8948cz8r208g6qgn2dn4f4zs5kpgbpbg6bwag6yw42rapw2l"))
      ("xz"
-      ,(base32 "0v5738idy9pqzcbrjdpxi5c6qs5m78zrpsydmrpx5cfcfzbkxzjh")))))
+      ,(base32 "0v5738idy9pqzcbrjdpxi5c6qs5m78zrpsydmrpx5cfcfzbkxzjh")))
+    ("riscv64-linux"
+     ("bash"
+      ,(base32 "0almlf73k6hbm495kzf4bw1rzsg5qddn7z2rf5l3d1xcapac2hj3"))
+     ("mkdir"
+      ,(base32 "0rg1amdcqfkplcy1608jignl8jq0wqzfkp430mwik3f62959gya6"))
+     ("tar"
+      ,(base32 "17d3x27qhiwk7h6ns0xrvbrq0frxz89mjjh2cdwx2rraq5x6wffm"))
+     ("xz"
+      ,(base32 "0nxn75xf386vdq3igmgm8gnyk4h4x0cm8jv71vlb2jvwxh0cyw1q")))))
 
 (define %bootstrap-executable-base-urls
   ;; This is where the bootstrap executables come from.
@@ -159,6 +168,7 @@
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
+    ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
                       "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e"))))
 
@@ -362,6 +372,8 @@ or false to signal an error."
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
+                   ("riscv64-linux"
+                    "/20210725/guile-3.0.2.tar.xz")
                    (_
                     "/20131110/guile-2.0.9.tar.xz"))))
 
@@ -383,7 +395,9 @@ or false to signal an error."
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
     ("powerpc-linux"
-     (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))))
+     (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
+    ("riscv64-linux"
+     (base32 "12pqmhsbbp7hh9r1bjdl14l3a4q06plpz6dcks9dysb4czay8p9f"))))
 
 (define (bootstrap-guile-origin system)
   "Return an <origin> object for the Guile tarball of SYSTEM."
@@ -455,6 +469,76 @@ GUILE_SYSTEM_PATH=$out/share/guile/2.0 \
 GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.0/ccache \
 $out/bin/guile -c ~s $out ~a
 
+# Sanity check.
+$out/bin/guile --version~%"
+                                           (derivation->output-path mkdir)
+                                           (derivation->output-path xz)
+                                           (derivation->output-path tar)
+                                           (object->string wrapper)
+                                           (derivation->output-path bash)))))
+    (raw-derivation name
+                    (derivation->output-path bash) `(,builder)
+                    #:system system
+                    #:inputs (map derivation-input
+                                  (list bash mkdir tar xz guile))
+                    #:sources (list builder)
+                    #:env-vars `(("GUILE_TARBALL"
+                                  . ,(derivation->output-path guile))))))
+
+(define* (raw-build-guile3 name inputs
+                    #:key outputs system search-paths
+                    #:allow-other-keys)
+  (define (->store file)
+    (lower-object (bootstrap-executable file system)
+                  system))
+
+  (define (make-guile-wrapper bash guile-real)
+    ;; The following code, run by the bootstrap guile after it is unpacked,
+    ;; creates a wrapper for itself to set its load path.  This replaces the
+    ;; previous non-portable method based on reading the /proc/self/exe
+    ;; symlink.
+    '(begin
+       (use-modules (ice-9 match))
+       (match (command-line)
+         ((_ out bash)
+          (let ((bin-dir    (string-append out "/bin"))
+                (guile      (string-append out "/bin/guile"))
+                (guile-real (string-append out "/bin/.guile-real"))
+                ;; We must avoid using a bare dollar sign in this code,
+                ;; because it would be interpreted by the shell.
+                (dollar     (string (integer->char 36))))
+            (chmod bin-dir #o755)
+            (rename-file guile guile-real)
+            (call-with-output-file guile
+              (lambda (p)
+                (format p "\
+#!~a
+export GUILE_SYSTEM_PATH=~a/share/guile/3.0
+export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/3.0/ccache
+exec -a \"~a0\" ~a \"~a@\"\n"
+                        bash out out dollar guile-real dollar)))
+            (chmod guile   #o555)
+            (chmod bin-dir #o555))))))
+
+  (mlet* %store-monad ((tar   (->store "tar"))
+                       (xz    (->store "xz"))
+                       (mkdir (->store "mkdir"))
+                       (bash  (->store "bash"))
+                       (guile (download-bootstrap-guile system))
+                       (wrapper -> (make-guile-wrapper bash guile))
+                       (builder
+                        (text-file "build-bootstrap-guile.sh"
+                                   (format #f "
+echo \"unpacking bootstrap Guile to '$out'...\"
+~a $out
+cd $out
+~a -dc < $GUILE_TARBALL | ~a xv
+
+# Use the bootstrap guile to create its own wrapper to set the load path.
+GUILE_SYSTEM_PATH=$out/share/guile/3.0 \
+GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/3.0/ccache \
+$out/bin/guile -c ~s $out ~a
+
 # Sanity check.
 $out/bin/guile --version~%"
                                            (derivation->output-path mkdir)
@@ -478,7 +562,9 @@ $out/bin/guile --version~%"
     (name name)
     (system system)
     (build-inputs inputs)
-    (build raw-build)))
+    (build (cond ((target-riscv?)
+                  raw-build-guile3)
+                 (else raw-build)))))
 
 (define %bootstrap-guile
   ;; The Guile used to run the build scripts of the initial derivations.
@@ -518,6 +604,8 @@ $out/bin/guile --version~%"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
+                                            ("riscv64-linux"
+                                             "/20210725/static-binaries.tar.xz")
                                             (_
                                              "/20131110/static-binaries.tar.xz")))
                                      %bootstrap-base-urls))
@@ -544,6 +632,9 @@ $out/bin/guile --version~%"
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
+                              ("riscv64-linux"
+                               (base32
+                                "0x0xjlpmyh6rkr51p00gp6pscgl6zjida1rsg8vk3rinyi6rrbkg"))
                               ("mips64el-linux"
                                (base32
                                 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
@@ -596,6 +687,8 @@ $out/bin/guile --version~%"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
+                                            ("riscv64-linux"
+                                             "/20210725/binutils-2.34.tar.xz")
                                             (_
                                              "/20131110/binutils-2.23.2.tar.xz")))
                                      %bootstrap-base-urls))
@@ -616,6 +709,9 @@ $out/bin/guile --version~%"
                               ("powerpc64le-linux"
                                (base32
                                 "1klxy945c61134mzhqzz2gbk8w0n8jq7arwkrvz78d22ff2q0cwz"))
+                              ("riscv64-linux"
+                               (base32
+                                "0n9qf4vbilfmh1lknhw000waakj4q6s50pnjazr5137skm976z5m"))
                               ("i586-gnu"
                                (base32
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
@@ -681,6 +777,8 @@ $out/bin/guile --version~%"
                                        "/20200326/glibc-stripped-2.31-i586-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
+                                      ("riscv64-linux"
+                                       "/20210725/glibc-2.31.tar.xz")
                                       (_
                                        "/20131110/glibc-2.18.tar.xz")))
                                %bootstrap-base-urls))
@@ -701,6 +799,9 @@ $out/bin/guile --version~%"
                         ("powerpc64le-linux"
                          (base32
                           "1a1df6z8gkaq09md3jy94lixnh20599p58p0s856p10xwjaqr1iz"))
+                        ("riscv64-linux"
+                         (base32
+                          "0d9x80vm7ca1pd2whcmpm1h14zxpb58kqajlxlwffzm04xfsjnxm"))
                         ("i586-gnu"
                          (base32
                           "14ddm10lpbas8bankmn5bcrlqvz1v5dnn1qjzxb19r57vd2w5952"))
@@ -782,6 +883,8 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
+                                       ("riscv64-linux"
+                                        "/20210725/gcc-7.5.0.tar.xz")
                                        (_
                                         "/20131110/gcc-4.8.2.tar.xz")))
                                 %bootstrap-base-urls))
@@ -802,6 +905,9 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
                          ("powerpc64le-linux"
                           (base32
                            "151kjsai25vz2s667bgzpisx8f281fpl3n9pxz2yrp9jlnadz3m1"))
+                         ("riscv64-linux"
+                          (base32
+                           "1k4mbnb54wj2q37fgshf5dfixixqnhn002vhzvi9pnb57xb9v14d"))
                          ("i586-gnu"
                           (base32
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index dc9b372132..d395b261c2 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2496,7 +2496,9 @@ exec " gcc "/bin/" program
        ,@(substitute-keyword-arguments (package-arguments findutils)
            ((#:configure-flags flags ''())
             `(append
-              ,(if (target-64bit?)
+               ;; TODO: Figure out exactly with architectures need this.
+              ,(if (and (target-64bit?)
+                        (not (target-riscv?)))
                    ''("TIME_T_32_BIT_OK=yes")
                    ''())
               ,(match (%current-system)
diff --git a/guix/packages.scm b/guix/packages.scm
index 2349bb4340..7e86da9aae 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -366,7 +366,7 @@ name of its URI."
   ;; This is the list of system types that are supported.  By default, we
   ;; expect all packages to build successfully here.
   '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "mips64el-linux" "i586-gnu"
-    "powerpc64le-linux" "powerpc-linux"))
+    "powerpc64le-linux" "powerpc-linux" "riscv64-linux"))
 
 (define %hurd-systems
   ;; The GNU/Hurd systems for which support is being developed.
@@ -377,7 +377,7 @@ name of its URI."
   ;;
   ;; XXX: MIPS is unavailable in CI:
   ;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
-  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux")))
+  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux")))
 
 (define-inlinable (sanitize-inputs inputs)
   "Sanitize INPUTS by turning it into a list of name/package tuples if it's
diff --git a/guix/utils.scm b/guix/utils.scm
index 134879feb1..3ca846f075 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -707,7 +707,8 @@ architecture (x86_64)?"
 
 (define* (target-64bit? #:optional (system (or (%current-target-system)
                                                (%current-system))))
-  (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64")))
+  (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64"
+                                        "powerpc64" "riscv64")))
 
 (define* (cc-for-target #:optional (target (%current-target-system)))
   (if target
diff --git a/m4/guix.m4 b/m4/guix.m4
index e778a56004..c79d3c3bc5 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -1,7 +1,7 @@
 dnl GNU Guix --- Functional package management for GNU
 dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
-dnl Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
+dnl Copyright © 2017, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 dnl Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
 dnl
 dnl This file is part of GNU Guix.
@@ -89,7 +89,7 @@ courageous and port the GNU System distribution to it (see
   # Currently only Linux-based systems are supported, and only on some
   # platforms.
   case "$guix_system" in
-    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|powerpc-linux)
+    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|powerpc-linux|riscv64-linux)
       ;;
     *)
       if test "x$guix_courageous" = "xyes"; then
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 03/21] gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
  2021-08-17 10:18 ` [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input Efraim Flashner
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/commencement.scm (libstdc++-boot0-gcc7): New variable.
(gcc-boot0)[inputs]: On riscv64-linux use libstdc++-boot0-gcc7 instead
of libstdc++-boot0.
---
 gnu/packages/commencement.scm | 48 ++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d395b261c2..69cf30483d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2703,6 +2703,50 @@ exec " gcc "/bin/" program
       (inputs (%boot0-inputs))
       (native-inputs '()))))
 
+(define libstdc++-boot0-gcc7
+  ;; GCC >= 7 is needed by architectures which use C++-14 features.
+  (let ((lib (make-libstdc++ gcc-7)))
+    (package
+      (inherit lib)
+      (source (bootstrap-origin (package-source lib)))
+      (name "libstdc++-boot0")
+      (arguments
+       `(#:guile ,%bootstrap-guile
+         #:implicit-inputs? #f
+
+         ;; XXX: libstdc++.so NEEDs ld.so for some reason.
+         #:validate-runpath? #f
+
+         ,@(substitute-keyword-arguments (package-arguments lib)
+             ((#:phases phases)
+              `(modify-phases ,phases
+                 (add-after 'unpack 'unpack-gmp&co
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (let ((gmp  (assoc-ref %build-inputs "gmp-source"))
+                           (mpfr (assoc-ref %build-inputs "mpfr-source"))
+                           (mpc  (assoc-ref %build-inputs "mpc-source")))
+
+                       ;; To reduce the set of pre-built bootstrap inputs, build
+                       ;; GMP & co. from GCC.
+                       (for-each (lambda (source)
+                                   (invoke "tar" "xvf" source))
+                                 (list gmp mpfr mpc))
+
+                       ;; Create symlinks like `gmp' -> `gmp-x.y.z'.
+                       ,@(map (lambda (lib)
+                                ;; Drop trailing letters, as gmp-6.0.0a unpacks
+                                ;; into gmp-6.0.0.
+                                `(symlink ,(string-trim-right
+                                            (package-full-name lib "-")
+                                            char-set:letter)
+                                          ,(package-name lib)))
+                              (list gmp-6.0 mpfr mpc))))))))))
+      (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
+                ("mpfr-source" ,(bootstrap-origin (package-source mpfr)))
+                ("mpc-source" ,(bootstrap-origin (package-source mpc)))
+                ,@(%boot0-inputs)))
+      (native-inputs '()))))
+
 (define gcc-boot0
   (package
     (inherit gcc)
@@ -2814,7 +2858,9 @@ exec " gcc "/bin/" program
               ("binutils-cross" ,binutils-boot0)
 
               ;; The libstdc++ that libcc1 links against.
-              ("libstdc++" ,libstdc++-boot0)
+              ("libstdc++" ,(match (%current-system)
+                                   ("riscv64-linux" libstdc++-boot0-gcc7)
+                                   (_ libstdc++-boot0)))
 
               ;; Call it differently so that the builder can check whether
               ;; the "libc" input is #f.
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (2 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 03/21] gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:29   ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux Efraim Flashner
                   ` (17 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/commencement.scm (%boot3-inputs): Add gcc:lib.
---
 gnu/packages/commencement.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 69cf30483d..e2339170e5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3579,6 +3579,9 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
 (define (%boot3-inputs)
   ;; 4th stage inputs.
   `(("gcc" ,gcc-final)
+    ,@(if (target-riscv?)
+        `(("gcc:lib" ,gcc-final "lib"))
+        '())
     ("ld-wrapper" ,ld-wrapper-boot3)
     ,@(alist-delete "gcc" (%boot2-inputs))))
 
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (3 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:30   ` Efraim Flashner
  2021-08-17 10:44   ` Maxime Devos
  2021-08-17 10:19 ` [bug#50091] [PATCH 06/21] gnu: %final-inputs: Add implied gcc:lib input Efraim Flashner
                   ` (16 subsequent siblings)
  21 siblings, 2 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/guile.scm (guile-3.0)[arguments]: On riscv64-linux add
a phase to skip a failing test.
---
 gnu/packages/guile.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index fffc30f913..f9a7125f83 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -65,7 +65,8 @@
   #:use-module (guix deprecation)
   #:use-module (guix utils)
   #:use-module (ice-9 match)
-  #:use-module ((srfi srfi-1) #:prefix srfi-1:))
+  #:use-module ((srfi srfi-1) #:prefix srfi-1:)
+  #:use-module (srfi srfi-26))
 
 ;;; Commentary:
 ;;;
@@ -346,14 +347,17 @@ without requiring the source code to be rewritten.")
                        ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
                        (substitute* "bootstrap/Makefile.in"
                          (("^GUILE_OPTIMIZATIONS.*")
-                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
-                   (add-after 'unpack 'skip-failing-fdes-test
-                     (lambda _
-                       ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
-                       (substitute* "test-suite/tests/ports.test"
-                         (("fdes not closed\"" all) (string-append all "(exit 77)")))
-                       #t)))
-                 '())))))
+                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n")))))
+                 '())
+           ,@(if (srfi-1:any (cute string-prefix? <> (%current-system))
+                             '("powerpc-" "riscv64-"))
+               `((add-after 'unpack 'skip-failing-fdes-test
+                   (lambda _
+                     ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
+                     (substitute* "test-suite/tests/ports.test"
+                       (("fdes not closed\"" all) (string-append all "(exit 77)")))
+                     #t)))
+               '())))))
 
     (native-search-paths
      (list (search-path-specification
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 06/21] gnu: %final-inputs: Add implied gcc:lib input.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (4 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux Efraim Flashner
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/commencement.scm (%final-inputs): Add gcc:lib.
---
 gnu/packages/commencement.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index e2339170e5..b717604a9c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3726,6 +3726,9 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
       ("ld-wrapper" ,ld-wrapper)
       ("binutils" ,binutils-final)
       ("gcc" ,gcc-final)
+      ,@(if (target-riscv?)
+          `(("gcc:lib" ,gcc-final "lib"))
+          '())
       ("libc" ,glibc-final)
       ("libc:static" ,glibc-final "static")
       ("locales" ,glibc-utf8-locales-final))))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (5 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 06/21] gnu: %final-inputs: Add implied gcc:lib input Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 14:58   ` Thiago Jung Bauermann via Guix-patches via
  2021-08-17 10:19 ` [bug#50091] [PATCH 08/21] gnu: elfutils: " Efraim Flashner
                   ` (14 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/dbm.scm (bdb)[arguments]: Modify configure to build for
the currect architecture when building for riscv64-linux.
---
 gnu/packages/dbm.scm | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
index ce84ef9eda..c2bdaf782a 100644
--- a/gnu/packages/dbm.scm
+++ b/gnu/packages/dbm.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2016, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
@@ -28,7 +28,8 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
-  #:use-module (guix utils))
+  #:use-module (guix utils)
+  #:use-module (ice-9 match))
 
 ;;; Commentary:
 ;;;
@@ -72,15 +73,15 @@
                        (string-append "CONFIG_SHELL=" (which "bash"))
                        (string-append "SHELL=" (which "bash"))
 
-                       ;; Bdb doesn't recognize aarch64 as an architecture.
-                       ,@(if (string=? "aarch64-linux" (%current-system))
-                             '("--build=aarch64-unknown-linux-gnu")
-                             '())
-
-                       ;; Bdb doesn't recognize powerpc64le as an architecture.
-                       ,@(if (string=? "powerpc64le-linux" (%current-system))
-                             '("--build=powerpc64le-unknown-linux-gnu")
-                             '())
+                       ;; Bdb doesn't recognize very many architectures.
+                       ,@(match (%current-system)
+                           ("aarch64-linux"
+                            '("--build=aarch64-unknown-linux-gnu"))
+                           ("powerpc64le-linux"
+                            '("--build=powerpc64le-unknown-linux-gnu"))
+                           ("riscv64-linux"
+                            '("--build=riscv64-unknown-linux-gnu"))
+                           (_ '()))
 
                        ,@(if (%current-target-system)         ; cross building
                              '((string-append "--host=" target))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 08/21] gnu: elfutils: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (6 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 09/21] gnu: pcre: " Efraim Flashner
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/elf.scm (elfutils)[arguments]: On riscv64-linux add a
phase to skip failing test.
---
 gnu/packages/elf.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 2bc1d00048..01e5f51b00 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
@@ -98,7 +98,14 @@
            (lambda _
              (substitute* "tests/Makefile.in"
                (("run-backtrace-native.sh") ""))
-             #t)))))
+             #t))
+         ,@(if (target-riscv?)
+             `((add-after 'unpack 'disable-failing-riscv64-test
+                 (lambda _
+                   ;; dwfl_thread_getframes: No DWARF information found
+                   (substitute* "tests/Makefile.in"
+                     (("run-backtrace-dwarf.sh") "")))))
+             '()))))
 
     (native-inputs `(("m4" ,m4)))
     (inputs `(("zlib" ,zlib)))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 09/21] gnu: pcre: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (7 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 08/21] gnu: elfutils: " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Efraim Flashner
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/pcre.scm (pcre)[arguments]: Adjust configure-flags to not
build with JIT when building for riscv64-linux.
---
 gnu/packages/pcre.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/pcre.scm b/gnu/packages/pcre.scm
index 318727915e..315dd8be1d 100644
--- a/gnu/packages/pcre.scm
+++ b/gnu/packages/pcre.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
@@ -32,6 +32,7 @@
   #:use-module (gnu packages)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu))
 
 (define-public pcre
@@ -54,7 +55,7 @@
              ("readline" ,readline)
              ("zlib" ,zlib)))
    (arguments
-    '(#:disallowed-references ("doc")
+    `(#:disallowed-references ("doc")
       #:configure-flags '("--enable-utf"
                           "--enable-pcregrep-libz"
                           "--enable-pcregrep-libbz2"
@@ -62,7 +63,9 @@
                           "--enable-unicode-properties"
                           "--enable-pcre16"
                           "--enable-pcre32"
-                          "--enable-jit")
+                          ,@(if (target-riscv?)
+                              '()
+                              `("--enable-jit")))
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'move-static-libs
                    (lambda* (#:key outputs #:allow-other-keys)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 10/21] gnu: openssl: Fix build on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (8 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 09/21] gnu: pcre: " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 11/21] gnu: libtool: Fix building " Efraim Flashner
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
to skip failing test.
(target->openssl-target): Add case for riscv64-linux.
---
 gnu/packages/tls.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 4b8df04f17..f6cdeac363 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -337,7 +337,10 @@ OpenSSL for TARGET."
         ((string-prefix? "powerpc64" target)
          "linux-ppc64")
         ((string-prefix? "powerpc" target)
-         "linux-ppc")))
+         "linux-ppc")
+        ((string-prefix? "riscv64" target)
+         ;; linux64-riscv64 isn't recognized until 3.0.0.
+         "linux-generic64")))
 
 (define-public openssl
   (package
@@ -380,6 +383,12 @@ OpenSSL for TARGET."
                                #$(target->openssl-target
                                   (%current-target-system))))))
                 #~())
+         ;; Unclear why this test is failing.
+         #$@(if (target-riscv?)
+              #~((add-after 'unpack 'skip-failing-test
+                   (lambda _
+                     (delete-file "test/recipes/30-test_afalg.t"))))
+              #~())
          (replace 'configure
            (lambda* (#:key configure-flags #:allow-other-keys)
              (let* ((out #$output)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 11/21] gnu: libtool: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (9 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:32   ` Efraim Flashner
  2021-08-17 10:49   ` Maxime Devos
  2021-08-17 10:19 ` [bug#50091] [PATCH 12/21] gnu: openblas: " Efraim Flashner
                   ` (10 subsequent siblings)
  21 siblings, 2 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/patches/libtool-skip-tests2.patch: Also skip pie tests
on riscv architectures.
---
 gnu/packages/patches/libtool-skip-tests2.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch
index c9d61e3b41..b0a479325f 100644
--- a/gnu/packages/patches/libtool-skip-tests2.patch
+++ b/gnu/packages/patches/libtool-skip-tests2.patch
@@ -1,4 +1,4 @@
-Skip the nopic test on ARM and MIPS systems.
+Skip the nopic test on ARM, MIPS and RISCV systems.
 
 --- libtool-2.4.6/tests/demo.at.orig	2015-01-16 13:52:04.000000000 -0500
 +++ libtool-2.4.6/tests/demo.at	2015-02-16 10:48:51.435851966 -0500
@@ -7,7 +7,7 @@ Skip the nopic test on ARM and MIPS systems.
  
  AT_CHECK([case $host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
@@ -18,7 +18,7 @@ Skip the nopic test on ARM and MIPS systems.
  { set +x
  $as_echo "$at_srcdir/demo.at:535: case \$host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
@@ -27,7 +27,7 @@ Skip the nopic test on ARM and MIPS systems.
  at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535"
  ( $at_check_trace; case $host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 12/21] gnu: openblas: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (10 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 11/21] gnu: libtool: Fix building " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 13/21] gnu: mesa: Add support for riscv64-linux Efraim Flashner
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/maths.scm (openblas)[arguments]: Adjust make-flags on
riscv64-linux to target the correct architecture when building for
riscv64-linux.
---
 gnu/packages/maths.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a7931e6eeb..7eac94f2a1 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4075,6 +4075,8 @@ parts of it.")
                   ;; Failed to detect CPU.
                   ((string-prefix? "armhf" system)
                    '("TARGET=ARMV7"))
+                  ((string-prefix? "riscv64" system)
+                   '("TARGET=RISCV64_GENERIC"))
                   (else '()))))
        ;; no configure script
        #:phases
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 13/21] gnu: mesa: Add support for riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (11 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 12/21] gnu: openblas: " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 14/21] gnu: pcre2: Fix building on riscv64-linux Efraim Flashner
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/gl.scm (mesa)[inputs]: Add llvm-11 on riscv64-linux.
[native-inputs]: Add glslang on riscv64-linux.
[arguments]: In configure-flags adjust gallium-drivers to swap the
power* and intel drivers for the fallback option. Specify riscv64-linux
configure options for vulkan-drivers. Enable the vulkan-overlay-layer
and llvm support. Adjust the custom 'disable-failing-test phase to have
a riscv64-linux section.
---
 gnu/packages/gl.scm | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 7a8a478953..8b82352204 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -274,7 +274,8 @@ also known as DXTn or DXTC) for Mesa.")
         ("libxrandr" ,libxrandr)
         ("libxvmc" ,libxvmc)
         ,@(match (%current-system)
-            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux")
+            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux"
+                 "powerpc-linux" "riscv64-linux")
              ;; Note: update the 'clang' input of mesa-opencl when bumping this.
              `(("llvm" ,llvm-11)))
             (_
@@ -286,7 +287,8 @@ also known as DXTn or DXTC) for Mesa.")
         ("flex" ,flex)
         ("gettext" ,gettext-minimal)
         ,@(match (%current-system)
-            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux")
+            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux"
+                 "powerpc-linux" "riscv64-linux")
              `(("glslang" ,glslang)))
             (_
              `()))
@@ -301,10 +303,10 @@ also known as DXTn or DXTC) for Mesa.")
              ((or "armhf-linux" "aarch64-linux")
               ;; TODO: Fix svga driver for non-Intel architectures.
               '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
-             ((or "powerpc64le-linux" "powerpc-linux")
-              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
+             ((or "x86_64-linux" "i686-linux")
+              '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl"))
              (_
-              '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
+              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
          ;; omx requires libomxil-bellagio
          "-Dplatforms=x11,wayland"
@@ -327,12 +329,15 @@ also known as DXTn or DXTC) for Mesa.")
               '("-Dvulkan-drivers=amd,swrast"))
              ("aarch64-linux"
               '("-Dvulkan-drivers=freedreno,amd,broadcom,swrast"))
+             ("riscv64-linux"
+              '("-Dvulkan-drivers=amd,swrast"))
              (_
               '("-Dvulkan-drivers=auto")))
 
          ;; Enable the Vulkan overlay layer on architectures using llvm.
          ,@(match (%current-system)
-             ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux")
+             ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux"
+                  "powerpc-linux" "riscv64-linux")
               '("-Dvulkan-overlay-layer=true"))
              (_
               '()))
@@ -346,7 +351,7 @@ also known as DXTn or DXTC) for Mesa.")
              ((or "x86_64-linux" "i686-linux")
               '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
                 "-Dllvm=enabled"))      ; default is x86/x86_64 only
-             ((or "powerpc64le-linux" "aarch64-linux" "powerpc-linux")
+             ((or "powerpc64le-linux" "aarch64-linux" "powerpc-linux" "riscv64-linux")
               '("-Ddri-drivers=nouveau,r200,r100"
                 "-Dllvm=enabled"))
              (_
@@ -365,6 +370,13 @@ also known as DXTn or DXTC) for Mesa.")
          (add-after 'unpack 'disable-failing-test
            (lambda _
              ,@(match (%current-system)
+                 ("riscv64-linux"
+                  ;; According to the test logs the llvm JIT is not designed
+                  ;; for this architecture and the llvmpipe tests all segfault.
+                  ;; The same is true for mesa:gallium / osmesa-render.
+                  `((substitute* '("src/gallium/drivers/llvmpipe/meson.build"
+                                   "src/gallium/targets/osmesa/meson.build")
+                      (("if with_tests") "if false"))))
                  ("powerpc64le-linux"
                   ;; Disable some of the llvmpipe tests.
                   `((substitute* "src/gallium/drivers/llvmpipe/lp_test_arit.c"
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 14/21] gnu: pcre2: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (12 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 13/21] gnu: mesa: Add support for riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 15/21] gnu: icu4c: Skip tests " Efraim Flashner
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/pcre.scm (pcre2)[arguments]: Adjust configure-flags to not
build with JIT when building for riscv64-linux.
---
 gnu/packages/pcre.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/pcre.scm b/gnu/packages/pcre.scm
index 315dd8be1d..e63caebd64 100644
--- a/gnu/packages/pcre.scm
+++ b/gnu/packages/pcre.scm
@@ -108,7 +108,9 @@ POSIX regular expression API.")
                           "--enable-pcre2test-libreadline"
                           "--enable-pcre2-16"
                           "--enable-pcre2-32"
-                          "--enable-jit"
+                          ,@(if (target-riscv?)
+                              '()
+                              `("--enable-jit"))
                           "--disable-static")
       #:phases
       (modify-phases %standard-phases
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 15/21] gnu: icu4c: Skip tests on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (13 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 14/21] gnu: pcre2: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 16/21] gnu: openblas-ilp64: Add riscv64-linux as a supported architecture Efraim Flashner
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/icu4c.scm (icu4c)[arguments]: Add phase to skip failing
test on riscv64-linux.
---
 gnu/packages/icu4c.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 0d5f34aed8..13db71a982 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -80,6 +80,14 @@
               (("LDFLAGSICUDT=-nodefaultlibs -nostdlib")
                "LDFLAGSICUDT="))
             #t))
+        ,@(if (target-riscv?)
+            `((add-after 'unpack 'disable-failing-test
+                ;; It is unknown why this test is failing.
+                (lambda _
+                  (substitute* "source/test/intltest/numbertest_api.cpp"
+                    (("(TESTCASE_AUTO\\(unitUsage\\));" all)
+                     (string-append "//" all))))))
+            '())
         (add-after 'install 'avoid-coreutils-reference
           ;; Don't keep a reference to the build tools.
           (lambda* (#:key outputs #:allow-other-keys)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 16/21] gnu: openblas-ilp64: Add riscv64-linux as a supported architecture.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (14 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 15/21] gnu: icu4c: Skip tests " Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 17/21] gnu: openlibm: Remove riscv64-linux from supported systems Efraim Flashner
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/maths.scm (openblas-ilp64)[supported-systems]: Add
riscv64-linux.
---
 gnu/packages/maths.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 7eac94f2a1..eb6e685278 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4104,7 +4104,7 @@ parts of it.")
 (define-public openblas-ilp64
   (package/inherit openblas
     (name "openblas-ilp64")
-    (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
+    (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux" "riscv64-linux"))
     (arguments
      (substitute-keyword-arguments (package-arguments openblas)
        ((#:make-flags flags '())
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 17/21] gnu: openlibm: Remove riscv64-linux from supported systems.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (15 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 16/21] gnu: openblas-ilp64: Add riscv64-linux as a supported architecture Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux Efraim Flashner
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/maths.scm (openlibm)[supported-systems]: Remove
riscv64-linux.
---
 gnu/packages/maths.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index eb6e685278..06b9dfea59 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4250,7 +4250,8 @@ have a good libm for the Julia programming language that worked consistently
 across compilers and operating systems, and in 32-bit and 64-bit
 environments.")
     ;; Each architecture has its own make target, and there is none for mips.
-    (supported-systems (delete "mips64el-linux" %supported-systems))
+    (supported-systems (fold delete %supported-systems
+                             '("mips64el-linux" "riscv64-linux")))
     ;; See LICENSE.md for details.
     (license (list license:expat
                    license:isc
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (16 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 17/21] gnu: openlibm: Remove riscv64-linux from supported systems Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:34   ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash Efraim Flashner
                   ` (3 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/tex.scm (texlive-bin)[arguments]: Adjust configure-flags
for riscv64-linux to skip luajit based binaries. Add phase to skip some
tests.
---
 gnu/packages/tex.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index c00c2ae177..b96aadc357 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -338,13 +338,14 @@ files from LOCATIONS with expected checksum HASH.  CODE is not currently in use.
          "--with-system-teckit"
          "--with-system-zlib"
          "--with-system-zziplib"
-         ;; LuaJIT is not ported to powerpc64le* yet.
-         ,@(if (string-prefix? "powerpc64le" (or (%current-target-system)
-                                                 (%current-system)))
-               '("--disable-luajittex"
-                 "--disable-luajithbtex"
-                 "--disable-mfluajit")
-               '()))
+         ;; LuaJIT is not ported to some architectures yet.
+         ,@(if (or (string-prefix? "powerpc64le" (or (%current-target-system)
+                                                     (%current-system)))
+                   (target-riscv?))
+             '("--disable-luajittex"
+               "--disable-luajithbtex"
+               "--disable-mfluajit")
+             '()))
 
       ;; Disable tests on some architectures to cope with a failure of
       ;; luajiterr.test.
@@ -385,7 +386,8 @@ files from LOCATIONS with expected checksum HASH.  CODE is not currently in use.
                (("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1")
                 "./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77"))
              #t))
-         ,@(if (target-ppc32?)
+         ,@(if (or (target-ppc32?)
+                   (target-riscv?))
              ;; Some mendex tests fail on some architectures.
              `((add-after 'unpack 'skip-mendex-tests
                  (lambda _
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (17 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 15:23   ` Thiago Jung Bauermann via Guix-patches via
  2021-08-17 10:19 ` [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind Efraim Flashner
                   ` (2 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

The hash seems to have changed.

* gnu/packages/tex.scm (texlive-updmap.cfg)[source]: Update hash.
---
 gnu/packages/tex.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index b96aadc357..072793ec30 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -4077,7 +4077,7 @@ configuration of a base set of packages plus PACKAGES."
                   (file-name "updmap.cfg")
                   (sha256
                    (base32
-                    "1q3l7yx5sng080ibfb8z3rdah0hhq170j6xw8z1w8i4w9m37lp94"))))
+                    "0zhpyld702im6352fwp41f2hgfkpj2b4j1kfsjqbkijlcmvb6w2c"))))
         (name "texlive-updmap.cfg")
         (build-system copy-build-system)
         (arguments
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (18 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 10:35   ` Efraim Flashner
  2021-08-17 10:19 ` [bug#50091] [PATCH 21/21] gnu: lapack: Fix building on riscv64-linux Efraim Flashner
  2021-08-17 19:33 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Sarah Morgensen
  21 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/compression.scm (lz4)[native-inputs]: Don't use valgrind
when building for riscv64-linux.
---
 gnu/packages/compression.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 93d517abd5..1803237e6e 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -819,7 +819,9 @@ decompression of some loosely related file formats used by Microsoft.")
     (native-inputs
      `(;; For tests.
        ("python" ,python)
-       ("valgrind" ,valgrind)))
+       ,@(if (target-riscv?)
+           '()
+           `(("valgrind" ,valgrind)))))
     (arguments
      `(;; Not designed for parallel testing.
        ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 21/21] gnu: lapack: Fix building on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (19 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind Efraim Flashner
@ 2021-08-17 10:19 ` Efraim Flashner
  2021-08-17 19:33 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Sarah Morgensen
  21 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:19 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

* gnu/packages/maths.scm (lapack)[inputs]: When building for
riscv64-linux explicitly add gfortran:lib.
---
 gnu/packages/maths.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 06b9dfea59..f9b3a20274 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -889,6 +889,9 @@ large scale eigenvalue problems.")
     (build-system cmake-build-system)
     (home-page "http://www.netlib.org/lapack/")
     (inputs `(("fortran" ,gfortran)
+              ,@(if (target-riscv?)
+                  `(("fortran:lib" ,gfortran "lib"))
+                  '())
               ("python" ,python-wrapper)))
     (arguments
      `(#:configure-flags (list
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate.
  2021-08-17 10:18 ` [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate Efraim Flashner
@ 2021-08-17 10:27   ` Maxime Devos
  2021-08-17 10:28     ` Efraim Flashner
  2021-08-17 10:30     ` Maxime Devos
  0 siblings, 2 replies; 48+ messages in thread
From: Maxime Devos @ 2021-08-17 10:27 UTC (permalink / raw)
  To: Efraim Flashner, 50091

[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]

Efraim Flashner schreef op di 17-08-2021 om 13:18 [+0300]:
> * guix/utils.scm (target-riscv?): New predicate.
> ---
>  guix/utils.scm | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/guix/utils.scm b/guix/utils.scm
> index 32fcff72ea..134879feb1 100644
> --- a/guix/utils.scm
> +++ b/guix/utils.scm
> @@ -96,6 +96,7 @@
>              target-arm?
>              target-ppc32?
>              target-powerpc?
> +            target-riscv?
>              target-64bit?
>              cc-for-target
>              cxx-for-target
> @@ -699,6 +700,11 @@ architecture (x86_64)?"
>                                                   (%current-system))))
>    (string-prefix? "powerpc" target))
>  
> +(define* (target-riscv? #:optional (target (or (%current-target-system)
> +                                               (%current-system))))
> +  "Is the architecture of TARGET a 'riscv' architecture variant?"
> +  (string-prefix? "riscv" target))
> +
>  (define* (target-64bit? #:optional (system (or (%current-target-system)
>                                                 (%current-system))))
>    (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64")))

The next patch adds a ‘riscv64-linux-gnu’ target.  riscv64 seems 64-bit to me.
It would seem riscv64 needs to be added to target-64bit?.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate.
  2021-08-17 10:27   ` Maxime Devos
@ 2021-08-17 10:28     ` Efraim Flashner
  2021-08-17 10:30     ` Maxime Devos
  1 sibling, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:28 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]

On Tue, Aug 17, 2021 at 12:27:17PM +0200, Maxime Devos wrote:
> Efraim Flashner schreef op di 17-08-2021 om 13:18 [+0300]:
> > * guix/utils.scm (target-riscv?): New predicate.
> > ---
> >  guix/utils.scm | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/guix/utils.scm b/guix/utils.scm
> > index 32fcff72ea..134879feb1 100644
> > --- a/guix/utils.scm
> > +++ b/guix/utils.scm
> > @@ -96,6 +96,7 @@
> >              target-arm?
> >              target-ppc32?
> >              target-powerpc?
> > +            target-riscv?
> >              target-64bit?
> >              cc-for-target
> >              cxx-for-target
> > @@ -699,6 +700,11 @@ architecture (x86_64)?"
> >                                                   (%current-system))))
> >    (string-prefix? "powerpc" target))
> >  
> > +(define* (target-riscv? #:optional (target (or (%current-target-system)
> > +                                               (%current-system))))
> > +  "Is the architecture of TARGET a 'riscv' architecture variant?"
> > +  (string-prefix? "riscv" target))
> > +
> >  (define* (target-64bit? #:optional (system (or (%current-target-system)
> >                                                 (%current-system))))
> >    (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64")))
> 
> The next patch adds a ‘riscv64-linux-gnu’ target.  riscv64 seems 64-bit to me.
> It would seem riscv64 needs to be added to target-64bit?.
> 
> Greetings,
> Maxime.

The next patch also adds riscv64-linux to target-64bit?, since that's
pretty much "when it begins to exist".


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input.
  2021-08-17 10:19 ` [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input Efraim Flashner
@ 2021-08-17 10:29   ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:29 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Tue, Aug 17, 2021 at 01:19:02PM +0300, Efraim Flashner wrote:
> * gnu/packages/commencement.scm (%boot3-inputs): Add gcc:lib.
> ---
>  gnu/packages/commencement.scm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 69cf30483d..e2339170e5 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -3579,6 +3579,9 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
>  (define (%boot3-inputs)
>    ;; 4th stage inputs.
>    `(("gcc" ,gcc-final)
> +    ,@(if (target-riscv?)
> +        `(("gcc:lib" ,gcc-final "lib"))
> +        '())
>      ("ld-wrapper" ,ld-wrapper-boot3)
>      ,@(alist-delete "gcc" (%boot2-inputs))))
>  
> -- 
> 2.32.0
> 

I haven't figured out why gcc doesn't seem to pull in gcc:lib (or
gfortran and gfortran:lib), but only on riscv64-linux. Without gcc:lib I
get failures during the configure phase.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate.
  2021-08-17 10:27   ` Maxime Devos
  2021-08-17 10:28     ` Efraim Flashner
@ 2021-08-17 10:30     ` Maxime Devos
  1 sibling, 0 replies; 48+ messages in thread
From: Maxime Devos @ 2021-08-17 10:30 UTC (permalink / raw)
  To: Efraim Flashner, 50091

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]


> > +(define* (target-riscv? #:optional (target (or (%current-target-system)
> > +                                               (%current-system))))
> > +  "Is the architecture of TARGET a 'riscv' architecture variant?"
> > +  (string-prefix? "riscv" target))
> > +
> >  (define* (target-64bit? #:optional (system (or (%current-target-system)
> >                                                 (%current-system))))
> >    (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64")))
> 
> The next patch adds a ‘riscv64-linux-gnu’ target.  riscv64 seems 64-bit to me.
> It would seem riscv64 needs to be added to target-64bit?.

Nevermind,
[bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux.
adds it to target-64bit?

> Greetings,
> Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:30   ` Efraim Flashner
  2021-08-17 10:44   ` Maxime Devos
  1 sibling, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:30 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 2601 bytes --]

On Tue, Aug 17, 2021 at 01:19:03PM +0300, Efraim Flashner wrote:
> * gnu/packages/guile.scm (guile-3.0)[arguments]: On riscv64-linux add
> a phase to skip a failing test.
> ---
>  gnu/packages/guile.scm | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index fffc30f913..f9a7125f83 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -65,7 +65,8 @@
>    #:use-module (guix deprecation)
>    #:use-module (guix utils)
>    #:use-module (ice-9 match)
> -  #:use-module ((srfi srfi-1) #:prefix srfi-1:))
> +  #:use-module ((srfi srfi-1) #:prefix srfi-1:)
> +  #:use-module (srfi srfi-26))
>  
>  ;;; Commentary:
>  ;;;
> @@ -346,14 +347,17 @@ without requiring the source code to be rewritten.")
>                         ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
>                         (substitute* "bootstrap/Makefile.in"
>                           (("^GUILE_OPTIMIZATIONS.*")
> -                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
> -                   (add-after 'unpack 'skip-failing-fdes-test
> -                     (lambda _
> -                       ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> -                       (substitute* "test-suite/tests/ports.test"
> -                         (("fdes not closed\"" all) (string-append all "(exit 77)")))
> -                       #t)))
> -                 '())))))
> +                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n")))))
> +                 '())
> +           ,@(if (srfi-1:any (cute string-prefix? <> (%current-system))
> +                             '("powerpc-" "riscv64-"))

this should be switched to
,@(if (or (target-ppc32?)
          (target-riscv?))

> +               `((add-after 'unpack 'skip-failing-fdes-test
> +                   (lambda _
> +                     ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> +                     (substitute* "test-suite/tests/ports.test"
> +                       (("fdes not closed\"" all) (string-append all "(exit 77)")))
> +                     #t)))
> +               '())))))
>  
>      (native-search-paths
>       (list (search-path-specification
> -- 
> 2.32.0
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 11/21] gnu: libtool: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 11/21] gnu: libtool: Fix building " Efraim Flashner
@ 2021-08-17 10:32   ` Efraim Flashner
  2021-08-17 10:49   ` Maxime Devos
  1 sibling, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:32 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 2306 bytes --]

Since this touches the patch for libtool it would involve a rebuild of
everything depending on libtool. I can of course rewrite this so it adds
a phase only for riscv64-linux and then undo it in core-updates.

On Tue, Aug 17, 2021 at 01:19:09PM +0300, Efraim Flashner wrote:
> * gnu/packages/patches/libtool-skip-tests2.patch: Also skip pie tests
> on riscv architectures.
> ---
>  gnu/packages/patches/libtool-skip-tests2.patch | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch
> index c9d61e3b41..b0a479325f 100644
> --- a/gnu/packages/patches/libtool-skip-tests2.patch
> +++ b/gnu/packages/patches/libtool-skip-tests2.patch
> @@ -1,4 +1,4 @@
> -Skip the nopic test on ARM and MIPS systems.
> +Skip the nopic test on ARM, MIPS and RISCV systems.
>  
>  --- libtool-2.4.6/tests/demo.at.orig	2015-01-16 13:52:04.000000000 -0500
>  +++ libtool-2.4.6/tests/demo.at	2015-02-16 10:48:51.435851966 -0500
> @@ -7,7 +7,7 @@ Skip the nopic test on ARM and MIPS systems.
>   
>   AT_CHECK([case $host in
>  -hppa*|x86_64*|s390*)
> -+hppa*|x86_64*|s390*|arm*|mips*)
> ++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
>     # These hosts cannot use non-PIC shared libs
>     exit 77 ;;
>   *-solaris*|*-sunos*)
> @@ -18,7 +18,7 @@ Skip the nopic test on ARM and MIPS systems.
>   { set +x
>   $as_echo "$at_srcdir/demo.at:535: case \$host in
>  -hppa*|x86_64*|s390*)
> -+hppa*|x86_64*|s390*|arm*|mips*)
> ++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
>     # These hosts cannot use non-PIC shared libs
>     exit 77 ;;
>   *-solaris*|*-sunos*)
> @@ -27,7 +27,7 @@ Skip the nopic test on ARM and MIPS systems.
>   at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535"
>   ( $at_check_trace; case $host in
>  -hppa*|x86_64*|s390*)
> -+hppa*|x86_64*|s390*|arm*|mips*)
> ++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
>     # These hosts cannot use non-PIC shared libs
>     exit 77 ;;
>   *-solaris*|*-sunos*)
> -- 
> 2.32.0
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 10:34   ` Efraim Flashner
  2021-08-17 15:15     ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:34 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 2527 bytes --]

On Tue, Aug 17, 2021 at 01:19:16PM +0300, Efraim Flashner wrote:
> * gnu/packages/tex.scm (texlive-bin)[arguments]: Adjust configure-flags
> for riscv64-linux to skip luajit based binaries. Add phase to skip some
> tests.
> ---
>  gnu/packages/tex.scm | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
> index c00c2ae177..b96aadc357 100644
> --- a/gnu/packages/tex.scm
> +++ b/gnu/packages/tex.scm
> @@ -338,13 +338,14 @@ files from LOCATIONS with expected checksum HASH.  CODE is not currently in use.
>           "--with-system-teckit"
>           "--with-system-zlib"
>           "--with-system-zziplib"
> -         ;; LuaJIT is not ported to powerpc64le* yet.
> -         ,@(if (string-prefix? "powerpc64le" (or (%current-target-system)
> -                                                 (%current-system)))
> -               '("--disable-luajittex"
> -                 "--disable-luajithbtex"
> -                 "--disable-mfluajit")
> -               '()))
> +         ;; LuaJIT is not ported to some architectures yet.
> +         ,@(if (or (string-prefix? "powerpc64le" (or (%current-target-system)
> +                                                     (%current-system)))
> +                   (target-riscv?))

I don't think I pushed the patch yet to add target-ppc64le? as an option
yet, but I'll rewrite this one when I do.

> +             '("--disable-luajittex"
> +               "--disable-luajithbtex"
> +               "--disable-mfluajit")
> +             '()))
>  
>        ;; Disable tests on some architectures to cope with a failure of
>        ;; luajiterr.test.
> @@ -385,7 +386,8 @@ files from LOCATIONS with expected checksum HASH.  CODE is not currently in use.
>                 (("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1")
>                  "./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77"))
>               #t))
> -         ,@(if (target-ppc32?)
> +         ,@(if (or (target-ppc32?)
> +                   (target-riscv?))
>               ;; Some mendex tests fail on some architectures.
>               `((add-after 'unpack 'skip-mendex-tests
>                   (lambda _
> -- 
> 2.32.0
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind.
  2021-08-17 10:19 ` [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind Efraim Flashner
@ 2021-08-17 10:35   ` Efraim Flashner
  2021-08-17 15:26     ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:35 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Tue, Aug 17, 2021 at 01:19:18PM +0300, Efraim Flashner wrote:
> * gnu/packages/compression.scm (lz4)[native-inputs]: Don't use valgrind
> when building for riscv64-linux.
> ---
>  gnu/packages/compression.scm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
> index 93d517abd5..1803237e6e 100644
> --- a/gnu/packages/compression.scm
> +++ b/gnu/packages/compression.scm
> @@ -819,7 +819,9 @@ decompression of some loosely related file formats used by Microsoft.")
>      (native-inputs
>       `(;; For tests.
>         ("python" ,python)
> -       ("valgrind" ,valgrind)))
> +       ,@(if (target-riscv?)
> +           '()
> +           `(("valgrind" ,valgrind)))))
>      (arguments
>       `(;; Not designed for parallel testing.
>         ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
> -- 
> 2.32.0
> 

Valgrind added support for riscv64-linux after the last release, but the
patch isn't easy to backport. I've thought about adding a valgrind-next
and pulling from a recent commit but I'm not sure it's actually worth
it.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux Efraim Flashner
  2021-08-17 10:30   ` Efraim Flashner
@ 2021-08-17 10:44   ` Maxime Devos
  2021-08-17 10:56     ` Efraim Flashner
  1 sibling, 1 reply; 48+ messages in thread
From: Maxime Devos @ 2021-08-17 10:44 UTC (permalink / raw)
  To: Efraim Flashner, 50091

[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]

>  ;;; Commentary:
>  ;;;
> @@ -346,14 +347,17 @@ without requiring the source code to be rewritten.")
>                         ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
>                         (substitute* "bootstrap/Makefile.in"
>                           (("^GUILE_OPTIMIZATIONS.*")
> -                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
> -                   (add-after 'unpack 'skip-failing-fdes-test
> -                     (lambda _
> -                       ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> -                       (substitute* "test-suite/tests/ports.test"
> -                         (("fdes not closed\"" all) (string-append all "(exit 77)")))
> -                       #t)))
> -                 '())))))
> +                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n")))))
> +                 '())
> +           ,@(if (srfi-1:any (cute string-prefix? <> (%current-system))
> +                             '("powerpc-" "riscv64-"))
> +               `((add-after 'unpack 'skip-failing-fdes-test
> +                   (lambda _
> +                     ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> +                     (substitute* "test-suite/tests/ports.test"
> +                       (("fdes not closed\"" all) (string-append all "(exit 77)")))
> +                     #t)))
> +               '())))))

This is not powerpc- or riscv64-specific -- iirc, I sometimes encounter it on a x86_64.
It's non-determenistic though.  The debian patch has a nice explanation:
<https://salsa.debian.org/rlb/deb-guile/-/blob/f24ab0150132d906b9724128576c36c39361cab7/debian/patches/0007-Fix-non-revealed-port-is-closed-ports.test.patch>.
I've also linked some of the public reports on the issue together:
<https://issues.guix.gnu.org/48389#11>.

Could the patch (or substitution) be applied, independently of the architecture?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 11/21] gnu: libtool: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 11/21] gnu: libtool: Fix building " Efraim Flashner
  2021-08-17 10:32   ` Efraim Flashner
@ 2021-08-17 10:49   ` Maxime Devos
  2021-08-17 10:58     ` Efraim Flashner
  1 sibling, 1 reply; 48+ messages in thread
From: Maxime Devos @ 2021-08-17 10:49 UTC (permalink / raw)
  To: Efraim Flashner, 50091

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

Efraim Flashner schreef op di 17-08-2021 om 13:19 [+0300]:
> * gnu/packages/patches/libtool-skip-tests2.patch: Also skip pie tests
> on riscv architectures.
> ---
>  gnu/packages/patches/libtool-skip-tests2.patch | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Does upstream know about the issue?
I would recommend including a link to the upstream bug report.
(in libtool-skip-tests2.patch or in a comment in the 'libtool'
package definition).

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux.
  2021-08-17 10:44   ` Maxime Devos
@ 2021-08-17 10:56     ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:56 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 2509 bytes --]

On Tue, Aug 17, 2021 at 12:44:44PM +0200, Maxime Devos wrote:
> >  ;;; Commentary:
> >  ;;;
> > @@ -346,14 +347,17 @@ without requiring the source code to be rewritten.")
> >                         ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
> >                         (substitute* "bootstrap/Makefile.in"
> >                           (("^GUILE_OPTIMIZATIONS.*")
> > -                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
> > -                   (add-after 'unpack 'skip-failing-fdes-test
> > -                     (lambda _
> > -                       ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> > -                       (substitute* "test-suite/tests/ports.test"
> > -                         (("fdes not closed\"" all) (string-append all "(exit 77)")))
> > -                       #t)))
> > -                 '())))))
> > +                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n")))))
> > +                 '())
> > +           ,@(if (srfi-1:any (cute string-prefix? <> (%current-system))
> > +                             '("powerpc-" "riscv64-"))
> > +               `((add-after 'unpack 'skip-failing-fdes-test
> > +                   (lambda _
> > +                     ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
> > +                     (substitute* "test-suite/tests/ports.test"
> > +                       (("fdes not closed\"" all) (string-append all "(exit 77)")))
> > +                     #t)))
> > +               '())))))
> 
> This is not powerpc- or riscv64-specific -- iirc, I sometimes encounter it on a x86_64.
> It's non-determenistic though.  The debian patch has a nice explanation:
> <https://salsa.debian.org/rlb/deb-guile/-/blob/f24ab0150132d906b9724128576c36c39361cab7/debian/patches/0007-Fix-non-revealed-port-is-closed-ports.test.patch>.

It is deterministic on powerpc and riscv64 though.

> I've also linked some of the public reports on the issue together:
> <https://issues.guix.gnu.org/48389#11>.
> 
> Could the patch (or substitution) be applied, independently of the architecture?

It could, but it affects everything back to guile-final, so it's world
rebuilding.

> Greetings,
> Maxime.



-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 11/21] gnu: libtool: Fix building on riscv64-linux.
  2021-08-17 10:49   ` Maxime Devos
@ 2021-08-17 10:58     ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-17 10:58 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

On Tue, Aug 17, 2021 at 12:49:12PM +0200, Maxime Devos wrote:
> Efraim Flashner schreef op di 17-08-2021 om 13:19 [+0300]:
> > * gnu/packages/patches/libtool-skip-tests2.patch: Also skip pie tests
> > on riscv architectures.
> > ---
> >  gnu/packages/patches/libtool-skip-tests2.patch | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> 
> Does upstream know about the issue?
> I would recommend including a link to the upstream bug report.
> (in libtool-skip-tests2.patch or in a comment in the 'libtool'
> package definition).
> 
> Greetings,
> Maxime.

I have to assume upstream knows about it, Debian has a similar patch
they've been using for years. I'll see what I can find about getting a
link for a bug report.


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 14:58   ` Thiago Jung Bauermann via Guix-patches via
  2021-09-23  7:28     ` Efraim Flashner
  0 siblings, 1 reply; 48+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-17 14:58 UTC (permalink / raw)
  To: 50091; +Cc: Efraim Flashner

Hello Efraim,

Em terça-feira, 17 de agosto de 2021, às 07:19:05 -03, Efraim Flashner 
escreveu:
> * gnu/packages/dbm.scm (bdb)[arguments]: Modify configure to build for
> the currect architecture when building for riscv64-linux.
> ---
>  gnu/packages/dbm.scm | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
> index ce84ef9eda..c2bdaf782a 100644
> --- a/gnu/packages/dbm.scm
> +++ b/gnu/packages/dbm.scm
> @@ -1,7 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2012, 2013, 2014, 2016, 2020 Ludovic Courtès
> <ludo@gnu.org> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
> -;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner
> <efraim@flashner.co.il> +;;; Copyright © 2016, 2017, 2018, 2020, 2021
> Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017, 2018
> Marius Bakke <mbakke@fastmail.com>
>  ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
>  ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
> @@ -28,7 +28,8 @@
>    #:use-module (guix packages)
>    #:use-module (guix download)
>    #:use-module (guix build-system gnu)
> -  #:use-module (guix utils))
> +  #:use-module (guix utils)
> +  #:use-module (ice-9 match))
> 
>  ;;; Commentary:
>  ;;;
> @@ -72,15 +73,15 @@
>                         (string-append "CONFIG_SHELL=" (which "bash"))
>                         (string-append "SHELL=" (which "bash"))
> 
> -                       ;; Bdb doesn't recognize aarch64 as an
> architecture. -                       ,@(if (string=? "aarch64-linux"
> (%current-system)) -                            
> '("--build=aarch64-unknown-linux-gnu") -                            
> '())
> -
> -                       ;; Bdb doesn't recognize powerpc64le as an
> architecture. -                       ,@(if (string=?
> "powerpc64le-linux" (%current-system)) -                            
> '("--build=powerpc64le-unknown-linux-gnu") -                            
> '())
> +                       ;; Bdb doesn't recognize very many architectures.
> +                       ,@(match (%current-system)
> +                           ("aarch64-linux"
> +                            '("--build=aarch64-unknown-linux-gnu"))
> +                           ("powerpc64le-linux"
> +                            '("--build=powerpc64le-unknown-linux-gnu"))
> +                           ("riscv64-linux"
> +                            '("--build=riscv64-unknown-linux-gnu"))
> +                           (_ '()))
> 
>                         ,@(if (%current-target-system)         ; cross
> building '((string-append "--host=" target))

Can this be fixed instead by updating ‘config.guess’ and ‘config.sub’ as 
done in https://issues.guix.gnu.org/50086#1 ?

That could possibly even fix cross-building (as it does for ‘pth’) and 
eliminate the need for all the “,@” forms in the ‘configure’ phase.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux.
  2021-08-17 10:34   ` Efraim Flashner
@ 2021-08-17 15:15     ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 0 replies; 48+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-17 15:15 UTC (permalink / raw)
  To: Efraim Flashner, 50091

Hello Efraim,

Em terça-feira, 17 de agosto de 2021, às 07:34:11 -03, Efraim Flashner 
escreveu:
> On Tue, Aug 17, 2021 at 01:19:16PM +0300, Efraim Flashner wrote:
> > * gnu/packages/tex.scm (texlive-bin)[arguments]: Adjust configure-flags
> > for riscv64-linux to skip luajit based binaries. Add phase to skip some
> > tests.
> > ---
> > 
> >  gnu/packages/tex.scm | 18 ++++++++++--------
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> > 
> > diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
> > index c00c2ae177..b96aadc357 100644
> > --- a/gnu/packages/tex.scm
> > +++ b/gnu/packages/tex.scm
> > @@ -338,13 +338,14 @@ files from LOCATIONS with expected checksum HASH.
> >  CODE is not currently in use.> 
> >           "--with-system-teckit"
> >           "--with-system-zlib"
> >           "--with-system-zziplib"
> > 
> > -         ;; LuaJIT is not ported to powerpc64le* yet.
> > -         ,@(if (string-prefix? "powerpc64le" (or
> > (%current-target-system) -                                            
> >     (%current-system))) -               '("--disable-luajittex"
> > -                 "--disable-luajithbtex"
> > -                 "--disable-mfluajit")
> > -               '()))
> > +         ;; LuaJIT is not ported to some architectures yet.
> > +         ,@(if (or (string-prefix? "powerpc64le" (or
> > (%current-target-system) +                                            
> >         (%current-system))) +                   (target-riscv?))
> 
> I don't think I pushed the patch yet to add target-ppc64le? as an option
> yet, but I'll rewrite this one when I do.

Nice, thanks!

You’ll also need a corresponding change in ‘texlive-texmf’, similar to the 
one added in https://issues.guix.gnu.org/50081 .

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash.
  2021-08-17 10:19 ` [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash Efraim Flashner
@ 2021-08-17 15:23   ` Thiago Jung Bauermann via Guix-patches via
  2021-08-18  7:10     ` Efraim Flashner
  0 siblings, 1 reply; 48+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-17 15:23 UTC (permalink / raw)
  To: 50091, Efraim Flashner

Hi,

Em terça-feira, 17 de agosto de 2021, às 07:19:17 -03, Efraim Flashner 
escreveu:
> The hash seems to have changed.

That’s true. I get the same hash as the new one in this patch when I 
manually download ‘updmap.cfg’.

How did you notice it? I didn’t get an error in my (admittedly basic) tests 
of the TeX Live packages.

Thanks for fixing it.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind.
  2021-08-17 10:35   ` Efraim Flashner
@ 2021-08-17 15:26     ` Thiago Jung Bauermann via Guix-patches via
  2021-08-18  9:10       ` Efraim Flashner
  0 siblings, 1 reply; 48+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-17 15:26 UTC (permalink / raw)
  To: Efraim Flashner, 50091

Hello,

Em terça-feira, 17 de agosto de 2021, às 07:35:35 -03, Efraim Flashner 
escreveu:
> On Tue, Aug 17, 2021 at 01:19:18PM +0300, Efraim Flashner wrote:
> > * gnu/packages/compression.scm (lz4)[native-inputs]: Don't use valgrind
> > when building for riscv64-linux.
> > ---
> > 
> >  gnu/packages/compression.scm | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/gnu/packages/compression.scm
> > b/gnu/packages/compression.scm
> > index 93d517abd5..1803237e6e 100644
> > --- a/gnu/packages/compression.scm
> > +++ b/gnu/packages/compression.scm
> > @@ -819,7 +819,9 @@ decompression of some loosely related file formats
> > used by Microsoft.")> 
> >      (native-inputs
> >      
> >       `(;; For tests.
> >       
> >         ("python" ,python)
> > 
> > -       ("valgrind" ,valgrind)))
> > +       ,@(if (target-riscv?)
> > +           '()
> > +           `(("valgrind" ,valgrind)))))
> > 
> >      (arguments
> >      
> >       `(;; Not designed for parallel testing.
> >       
> >         ;; See
> >         https://github.com/lz4/lz4/issues/957#issuecomment-737419821
> 
> Valgrind added support for riscv64-linux after the last release, but the
> patch isn't easy to backport. I've thought about adding a valgrind-next
> and pulling from a recent commit but I'm not sure it's actually worth
> it.

IMHO, either the commit message or the code would benefit from a note 
mentioning that the current version of Valgrind doesn’t support
riscv64-linux.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 10/21] gnu: openssl: Fix build on riscv64-linux.
  2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
                   ` (20 preceding siblings ...)
  2021-08-17 10:19 ` [bug#50091] [PATCH 21/21] gnu: lapack: Fix building on riscv64-linux Efraim Flashner
@ 2021-08-17 19:33 ` Sarah Morgensen
  2021-08-18  7:09   ` Efraim Flashner
  21 siblings, 1 reply; 48+ messages in thread
From: Sarah Morgensen @ 2021-08-17 19:33 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 50091

Hi Efraim,

Efraim Flashner <efraim@flashner.co.il> writes:

> * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> to skip failing test.
> (target->openssl-target): Add case for riscv64-linux.
> ---
>  gnu/packages/tls.scm | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> index 4b8df04f17..f6cdeac363 100644
> --- a/gnu/packages/tls.scm
> +++ b/gnu/packages/tls.scm
> @@ -337,7 +337,10 @@ OpenSSL for TARGET."
>          ((string-prefix? "powerpc64" target)
>           "linux-ppc64")
>          ((string-prefix? "powerpc" target)
> -         "linux-ppc")))
> +         "linux-ppc")
> +        ((string-prefix? "riscv64" target)
> +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> +         "linux-generic64")))
>  
>  (define-public openssl
>    (package
> @@ -380,6 +383,12 @@ OpenSSL for TARGET."
>                                 #$(target->openssl-target
>                                    (%current-target-system))))))
>                  #~())
> +         ;; Unclear why this test is failing.
> +         #$@(if (target-riscv?)
> +              #~((add-after 'unpack 'skip-failing-test
> +                   (lambda _
> +                     (delete-file "test/recipes/30-test_afalg.t"))))
> +              #~())
>           (replace 'configure
>             (lambda* (#:key configure-flags #:allow-other-keys)
>               (let* ((out #$output)

This test is also failing on aarch64 [0] and has been reported upstream
for some time [1] with no action.

Looks like it can also be disabled with

  make TESTS=-test_afalg test

if that's more desirable.

[0] https://ci.guix.gnu.org/build/29270/details
[1] https://github.com/openssl/openssl/issues/12242

--
Sarah




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 10/21] gnu: openssl: Fix build on riscv64-linux.
  2021-08-17 19:33 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Sarah Morgensen
@ 2021-08-18  7:09   ` Efraim Flashner
  2021-08-18 10:44     ` Efraim Flashner
  0 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-18  7:09 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

On Tue, Aug 17, 2021 at 12:33:45PM -0700, Sarah Morgensen wrote:
> Hi Efraim,
> 
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> > to skip failing test.
> > (target->openssl-target): Add case for riscv64-linux.
> > ---
> >  gnu/packages/tls.scm | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> > index 4b8df04f17..f6cdeac363 100644
> > --- a/gnu/packages/tls.scm
> > +++ b/gnu/packages/tls.scm
> > @@ -337,7 +337,10 @@ OpenSSL for TARGET."
> >          ((string-prefix? "powerpc64" target)
> >           "linux-ppc64")
> >          ((string-prefix? "powerpc" target)
> > -         "linux-ppc")))
> > +         "linux-ppc")
> > +        ((string-prefix? "riscv64" target)
> > +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> > +         "linux-generic64")))
> >  
> >  (define-public openssl
> >    (package
> > @@ -380,6 +383,12 @@ OpenSSL for TARGET."
> >                                 #$(target->openssl-target
> >                                    (%current-target-system))))))
> >                  #~())
> > +         ;; Unclear why this test is failing.
> > +         #$@(if (target-riscv?)
> > +              #~((add-after 'unpack 'skip-failing-test
> > +                   (lambda _
> > +                     (delete-file "test/recipes/30-test_afalg.t"))))
> > +              #~())
> >           (replace 'configure
> >             (lambda* (#:key configure-flags #:allow-other-keys)
> >               (let* ((out #$output)
> 
> This test is also failing on aarch64 [0] and has been reported upstream
> for some time [1] with no action.

I was able to build openssl without any problems on my pine64, I'll run
it again and see what I come up with.

Looking at the bug report, it looks like it also might be kernel
dependant and/or related to cross compiling. I'm pretty sure the aarch64
builders are running Guix System, and my pine64 is running Armbian.

I'll go ahead and disable it for all the arm* architectures.

> Looks like it can also be disabled with
> 
>   make TESTS=-test_afalg test
> 
> if that's more desirable.

I do like that better.

> [0] https://ci.guix.gnu.org/build/29270/details
> [1] https://github.com/openssl/openssl/issues/12242
> 
> --
> Sarah

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash.
  2021-08-17 15:23   ` Thiago Jung Bauermann via Guix-patches via
@ 2021-08-18  7:10     ` Efraim Flashner
  2021-08-18 10:41       ` Efraim Flashner
  0 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-08-18  7:10 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On Tue, Aug 17, 2021 at 12:23:27PM -0300, Thiago Jung Bauermann wrote:
> Hi,
> 
> Em terça-feira, 17 de agosto de 2021, às 07:19:17 -03, Efraim Flashner 
> escreveu:
> > The hash seems to have changed.
> 
> That’s true. I get the same hash as the new one in this patch when I 
> manually download ‘updmap.cfg’.
> 
> How did you notice it? I didn’t get an error in my (admittedly basic) tests 
> of the TeX Live packages.

On some of my machines I build without substitutes, so when this one
changed upstream it showed up.

> Thanks for fixing it.

Don't thank me just yet, I still need to see what changed between the
two versions.

> -- 
> Thanks,
> Thiago
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind.
  2021-08-17 15:26     ` Thiago Jung Bauermann via Guix-patches via
@ 2021-08-18  9:10       ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-18  9:10 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]

On Tue, Aug 17, 2021 at 12:26:33PM -0300, Thiago Jung Bauermann wrote:
> Hello,
> 
> Em terça-feira, 17 de agosto de 2021, às 07:35:35 -03, Efraim Flashner 
> escreveu:
> > On Tue, Aug 17, 2021 at 01:19:18PM +0300, Efraim Flashner wrote:
> > > * gnu/packages/compression.scm (lz4)[native-inputs]: Don't use valgrind
> > > when building for riscv64-linux.
> > > ---
> > > 
> > >  gnu/packages/compression.scm | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/gnu/packages/compression.scm
> > > b/gnu/packages/compression.scm
> > > index 93d517abd5..1803237e6e 100644
> > > --- a/gnu/packages/compression.scm
> > > +++ b/gnu/packages/compression.scm
> > > @@ -819,7 +819,9 @@ decompression of some loosely related file formats
> > > used by Microsoft.")> 
> > >      (native-inputs
> > >      
> > >       `(;; For tests.
> > >       
> > >         ("python" ,python)
> > > 
> > > -       ("valgrind" ,valgrind)))
> > > +       ,@(if (target-riscv?)
> > > +           '()
> > > +           `(("valgrind" ,valgrind)))))
> > > 
> > >      (arguments
> > >      
> > >       `(;; Not designed for parallel testing.
> > >       
> > >         ;; See
> > >         https://github.com/lz4/lz4/issues/957#issuecomment-737419821
> > 
> > Valgrind added support for riscv64-linux after the last release, but the
> > patch isn't easy to backport. I've thought about adding a valgrind-next
> > and pulling from a recent commit but I'm not sure it's actually worth
> > it.
> 
> IMHO, either the commit message or the code would benefit from a note 
> mentioning that the current version of Valgrind doesn’t support
> riscv64-linux.
> 

Looks like I was mistaken, libunwind grew riscv64-linux support, not
valgrind.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash.
  2021-08-18  7:10     ` Efraim Flashner
@ 2021-08-18 10:41       ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-18 10:41 UTC (permalink / raw)
  To: Thiago Jung Bauermann, 50091

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

On Wed, Aug 18, 2021 at 10:10:50AM +0300, Efraim Flashner wrote:
> On Tue, Aug 17, 2021 at 12:23:27PM -0300, Thiago Jung Bauermann wrote:
> > Hi,
> > 
> > Em terça-feira, 17 de agosto de 2021, às 07:19:17 -03, Efraim Flashner 
> > escreveu:
> > > The hash seems to have changed.
> > 
> > That’s true. I get the same hash as the new one in this patch when I 
> > manually download ‘updmap.cfg’.
> > 
> > How did you notice it? I didn’t get an error in my (admittedly basic) tests 
> > of the TeX Live packages.
> 
> On some of my machines I build without substitutes, so when this one
> changed upstream it showed up.
> 
> > Thanks for fixing it.
> 
> Don't thank me just yet, I still need to see what changed between the
> two versions.
> 

Turns out the wrong hash was because it was missed during the Tex Live
2021 update. I've pushed the updated patch to core-updates-frozen.


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 10/21] gnu: openssl: Fix build on riscv64-linux.
  2021-08-18  7:09   ` Efraim Flashner
@ 2021-08-18 10:44     ` Efraim Flashner
  0 siblings, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-18 10:44 UTC (permalink / raw)
  To: Sarah Morgensen, 50091

[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]

On Wed, Aug 18, 2021 at 10:09:39AM +0300, Efraim Flashner wrote:
> On Tue, Aug 17, 2021 at 12:33:45PM -0700, Sarah Morgensen wrote:
> > Hi Efraim,
> > 
> > Efraim Flashner <efraim@flashner.co.il> writes:
> > 
> > > * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> > > to skip failing test.
> > > (target->openssl-target): Add case for riscv64-linux.
> > > ---
> > >  gnu/packages/tls.scm | 11 ++++++++++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> > > index 4b8df04f17..f6cdeac363 100644
> > > --- a/gnu/packages/tls.scm
> > > +++ b/gnu/packages/tls.scm
> > > @@ -337,7 +337,10 @@ OpenSSL for TARGET."
> > >          ((string-prefix? "powerpc64" target)
> > >           "linux-ppc64")
> > >          ((string-prefix? "powerpc" target)
> > > -         "linux-ppc")))
> > > +         "linux-ppc")
> > > +        ((string-prefix? "riscv64" target)
> > > +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> > > +         "linux-generic64")))
> > >  
> > >  (define-public openssl
> > >    (package
> > > @@ -380,6 +383,12 @@ OpenSSL for TARGET."
> > >                                 #$(target->openssl-target
> > >                                    (%current-target-system))))))
> > >                  #~())
> > > +         ;; Unclear why this test is failing.
> > > +         #$@(if (target-riscv?)
> > > +              #~((add-after 'unpack 'skip-failing-test
> > > +                   (lambda _
> > > +                     (delete-file "test/recipes/30-test_afalg.t"))))
> > > +              #~())
> > >           (replace 'configure
> > >             (lambda* (#:key configure-flags #:allow-other-keys)
> > >               (let* ((out #$output)
> > 
> > This test is also failing on aarch64 [0] and has been reported upstream
> > for some time [1] with no action.
> 
> I was able to build openssl without any problems on my pine64, I'll run
> it again and see what I come up with.
> 
> Looking at the bug report, it looks like it also might be kernel
> dependant and/or related to cross compiling. I'm pretty sure the aarch64
> builders are running Guix System, and my pine64 is running Armbian.
> 
> I'll go ahead and disable it for all the arm* architectures.
> 
> > Looks like it can also be disabled with
> > 
> >   make TESTS=-test_afalg test
> > 
> > if that's more desirable.
> 
> I do like that better.
> 
> > [0] https://ci.guix.gnu.org/build/29270/details
> > [1] https://github.com/openssl/openssl/issues/12242
> > 

I've pushed the arm* version to core-updates

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux Efraim Flashner
@ 2021-08-24 11:53   ` Efraim Flashner
  2021-09-23  7:35   ` Efraim Flashner
  1 sibling, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-08-24 11:53 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Tue, Aug 17, 2021 at 01:19:00PM +0300, Efraim Flashner wrote:
> On 7d93b21ab1c132990054372a9677c1639d54e631
>     gnu: glibc-for-bootstrap: Update patch.
> 
> Run
>     ./pre-inst-env guix build --target=riscv64-linux-gnu bootstrap-tarballs
> 
> Producing
>     /gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0
> 
> With guix hash -rx
>     1nj0fdgj08bbmfny01mp2blv7c3p2iciqh31zmf04ap5s7ygsqlp

I tested this myself with two other machines, one x86_64 running Guix
System and aarch64, running Armbian (based on Debian 10)

From the x86_64 machine:

(ins)efraim@E5400 ~$ guix time-machine --commit=7d93b21ab1c132990054372a9677c1639d54e631 \
    -- build --no-substitutes --target=riscv64-linux-gnu bootstrap-tarballs
/gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0
(ins)efraim@E5400 ~$ guix hash -rx /gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0
1nj0fdgj08bbmfny01mp2blv7c3p2iciqh31zmf04ap5s7ygsqlp

(ins)efraim@pine64:~$ guix time-machine --commit=7d93b21ab1c132990054372a9677c1639d54e631 \
    -- build --no-substitutes --target=riscv64-linux-gnu bootstrap-tarballs
(ins)efraim@pine64:~$ guix hash -rx /gnu/store/my39g68c6g4czzzk0l1bw8jh8jgpsc9s-bootstrap-tarballs-0
07xa3r4ac1qi1vpilr7ia43ifw1yxv3hpi4vz4hjypgl12b8h8x7

So I got a different result from aarch64 than from x86_64.


-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux.
  2021-08-17 14:58   ` Thiago Jung Bauermann via Guix-patches via
@ 2021-09-23  7:28     ` Efraim Flashner
  2021-09-28  4:01       ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 1 reply; 48+ messages in thread
From: Efraim Flashner @ 2021-09-23  7:28 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 50091

[-- Attachment #1: Type: text/plain, Size: 3686 bytes --]

On Tue, Aug 17, 2021 at 11:58:44AM -0300, Thiago Jung Bauermann wrote:
> Hello Efraim,
> 
> Em terça-feira, 17 de agosto de 2021, às 07:19:05 -03, Efraim Flashner 
> escreveu:
> > * gnu/packages/dbm.scm (bdb)[arguments]: Modify configure to build for
> > the currect architecture when building for riscv64-linux.
> > ---
> >  gnu/packages/dbm.scm | 23 ++++++++++++-----------
> >  1 file changed, 12 insertions(+), 11 deletions(-)
> > 
> > diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
> > index ce84ef9eda..c2bdaf782a 100644
> > --- a/gnu/packages/dbm.scm
> > +++ b/gnu/packages/dbm.scm
> > @@ -1,7 +1,7 @@
> >  ;;; GNU Guix --- Functional package management for GNU
> >  ;;; Copyright © 2012, 2013, 2014, 2016, 2020 Ludovic Courtès
> > <ludo@gnu.org> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
> > -;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner
> > <efraim@flashner.co.il> +;;; Copyright © 2016, 2017, 2018, 2020, 2021
> > Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017, 2018
> > Marius Bakke <mbakke@fastmail.com>
> >  ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
> >  ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
> > @@ -28,7 +28,8 @@
> >    #:use-module (guix packages)
> >    #:use-module (guix download)
> >    #:use-module (guix build-system gnu)
> > -  #:use-module (guix utils))
> > +  #:use-module (guix utils)
> > +  #:use-module (ice-9 match))
> > 
> >  ;;; Commentary:
> >  ;;;
> > @@ -72,15 +73,15 @@
> >                         (string-append "CONFIG_SHELL=" (which "bash"))
> >                         (string-append "SHELL=" (which "bash"))
> > 
> > -                       ;; Bdb doesn't recognize aarch64 as an
> > architecture. -                       ,@(if (string=? "aarch64-linux"
> > (%current-system)) -                            
> > '("--build=aarch64-unknown-linux-gnu") -                            
> > '())
> > -
> > -                       ;; Bdb doesn't recognize powerpc64le as an
> > architecture. -                       ,@(if (string=?
> > "powerpc64le-linux" (%current-system)) -                            
> > '("--build=powerpc64le-unknown-linux-gnu") -                            
> > '())
> > +                       ;; Bdb doesn't recognize very many architectures.
> > +                       ,@(match (%current-system)
> > +                           ("aarch64-linux"
> > +                            '("--build=aarch64-unknown-linux-gnu"))
> > +                           ("powerpc64le-linux"
> > +                            '("--build=powerpc64le-unknown-linux-gnu"))
> > +                           ("riscv64-linux"
> > +                            '("--build=riscv64-unknown-linux-gnu"))
> > +                           (_ '()))
> > 
> >                         ,@(if (%current-target-system)         ; cross
> > building '((string-append "--host=" target))
> 
> Can this be fixed instead by updating ‘config.guess’ and ‘config.sub’ as 
> done in https://issues.guix.gnu.org/50086#1 ?
> 
> That could possibly even fix cross-building (as it does for ‘pth’) and 
> eliminate the need for all the “,@” forms in the ‘configure’ phase.
> 

Sorry for taking so long to get back to you. I finally tried this but
there seems to be a cycle somewhere between bdb and config, so using
config and dropping the custom --build flag isn't currently an option.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux.
  2021-08-17 10:19 ` [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux Efraim Flashner
  2021-08-24 11:53   ` Efraim Flashner
@ 2021-09-23  7:35   ` Efraim Flashner
  1 sibling, 0 replies; 48+ messages in thread
From: Efraim Flashner @ 2021-09-23  7:35 UTC (permalink / raw)
  To: 50091

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

Anyone want to take a look at this patch? We're definitely past the 2
weeks mark but I'm not comfortable pushing a new architecture without
others chiming in.

Even just a 'I ran the guix time-machine command and got the same hash'
response would be helpful. Or a 'lets make sure to keep the sorting of
the architectures consistent across commencement.scm'.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux.
  2021-09-23  7:28     ` Efraim Flashner
@ 2021-09-28  4:01       ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 0 replies; 48+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-09-28  4:01 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 50091

Hello Efraim,

Em quinta-feira, 23 de setembro de 2021, às 04:28:33 -03, Efraim Flashner 
escreveu:
> On Tue, Aug 17, 2021 at 11:58:44AM -0300, Thiago Jung Bauermann wrote:
> > Hello Efraim,
> > 
> > Em terça-feira, 17 de agosto de 2021, às 07:19:05 -03, Efraim Flashner
> > 
> > escreveu:
> > > @@ -72,15 +73,15 @@
> > > 
> > >                         (string-append "CONFIG_SHELL=" (which
> > >                         "bash"))
> > >                         (string-append "SHELL=" (which "bash"))
> > > 
> > > -                       ;; Bdb doesn't recognize aarch64 as an
> > > architecture. -                       ,@(if (string=? "aarch64-linux"
> > > (%current-system)) -
> > > '("--build=aarch64-unknown-linux-gnu") -
> > > '())
> > > -
> > > -                       ;; Bdb doesn't recognize powerpc64le as an
> > > architecture. -                       ,@(if (string=?
> > > "powerpc64le-linux" (%current-system)) -
> > > '("--build=powerpc64le-unknown-linux-gnu") -
> > > '())
> > > +                       ;; Bdb doesn't recognize very many
> > > architectures. +                       ,@(match (%current-system)
> > > +                           ("aarch64-linux"
> > > +                            '("--build=aarch64-unknown-linux-gnu"))
> > > +                           ("powerpc64le-linux"
> > > +                           
> > > '("--build=powerpc64le-unknown-linux-gnu"))
> > > +                           ("riscv64-linux"
> > > +                            '("--build=riscv64-unknown-linux-gnu"))
> > > +                           (_ '()))
> > > 
> > >                         ,@(if (%current-target-system)         ;
> > >                         cross
> > > 
> > > building '((string-append "--host=" target))
> > 
> > Can this be fixed instead by updating ‘config.guess’ and ‘config.sub’
> > as
> > done in https://issues.guix.gnu.org/50086#1 ?
> > 
> > That could possibly even fix cross-building (as it does for ‘pth’) and
> > eliminate the need for all the “,@” forms in the ‘configure’ phase.
> 
> Sorry for taking so long to get back to you.

Not a problem.

> I finally tried this but there seems to be a cycle somewhere between bdb 
> and config, so using config and dropping the custom --build flag isn't 
> currently an option.

Thanks for trying it out. Interestingly, `guix graph --path` can’t find it, 
even with `-t bag`.

If you’d like to make a second try, some packages get the updated 
‘config.guess’ and ‘config.sub’ files from ‘automake’ instead (e.g., the 
‘indent’ package). I don’t know if there would be a cycle in that case as 
well or not.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2021-09-28  4:12 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 10:10 [bug#50091] [PATCH 00/21] Add riscv64 support Efraim Flashner
2021-08-17 10:18 ` [bug#50091] [PATCH 01/21] utils: Define 'target-riscv?' predicate Efraim Flashner
2021-08-17 10:27   ` Maxime Devos
2021-08-17 10:28     ` Efraim Flashner
2021-08-17 10:30     ` Maxime Devos
2021-08-17 10:19 ` [bug#50091] [PATCH 02/21] gnu: bootstrap: Add support for riscv64-linux Efraim Flashner
2021-08-24 11:53   ` Efraim Flashner
2021-09-23  7:35   ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 03/21] gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 04/21] gnu: %boot3-inputs: Add missing input Efraim Flashner
2021-08-17 10:29   ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux Efraim Flashner
2021-08-17 10:30   ` Efraim Flashner
2021-08-17 10:44   ` Maxime Devos
2021-08-17 10:56     ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 06/21] gnu: %final-inputs: Add implied gcc:lib input Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 07/21] gnu: bdb: Fix building on riscv64-linux Efraim Flashner
2021-08-17 14:58   ` Thiago Jung Bauermann via Guix-patches via
2021-09-23  7:28     ` Efraim Flashner
2021-09-28  4:01       ` Thiago Jung Bauermann via Guix-patches via
2021-08-17 10:19 ` [bug#50091] [PATCH 08/21] gnu: elfutils: " Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 09/21] gnu: pcre: " Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 11/21] gnu: libtool: Fix building " Efraim Flashner
2021-08-17 10:32   ` Efraim Flashner
2021-08-17 10:49   ` Maxime Devos
2021-08-17 10:58     ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 12/21] gnu: openblas: " Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 13/21] gnu: mesa: Add support for riscv64-linux Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 14/21] gnu: pcre2: Fix building on riscv64-linux Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 15/21] gnu: icu4c: Skip tests " Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 16/21] gnu: openblas-ilp64: Add riscv64-linux as a supported architecture Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 17/21] gnu: openlibm: Remove riscv64-linux from supported systems Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 18/21] gnu: texlive-bin: Fix building on riscv64-linux Efraim Flashner
2021-08-17 10:34   ` Efraim Flashner
2021-08-17 15:15     ` Thiago Jung Bauermann via Guix-patches via
2021-08-17 10:19 ` [bug#50091] [PATCH 19/21] gnu: texlive-updmap.cfg: Update hash Efraim Flashner
2021-08-17 15:23   ` Thiago Jung Bauermann via Guix-patches via
2021-08-18  7:10     ` Efraim Flashner
2021-08-18 10:41       ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 20/21] gnu: lz4: Build on riscv64-linux without valgrind Efraim Flashner
2021-08-17 10:35   ` Efraim Flashner
2021-08-17 15:26     ` Thiago Jung Bauermann via Guix-patches via
2021-08-18  9:10       ` Efraim Flashner
2021-08-17 10:19 ` [bug#50091] [PATCH 21/21] gnu: lapack: Fix building on riscv64-linux Efraim Flashner
2021-08-17 19:33 ` [bug#50091] [PATCH 10/21] gnu: openssl: Fix build " Sarah Morgensen
2021-08-18  7:09   ` Efraim Flashner
2021-08-18 10:44     ` Efraim Flashner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.