GNU bug report logs - #69944
[PATCH] gnu: dmraid: Fix cross-compiling to riscv64-linux.

Previous Next

Package: guix-patches;

Reported by: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>

Date: Fri, 22 Mar 2024 17:16:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 69944 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#69944; Package guix-patches. (Fri, 22 Mar 2024 17:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 Mar 2024 17:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: dmraid: Fix cross-compiling to riscv64-linux.
Date: Sat, 23 Mar 2024 00:44:44 +0800
* gnu/packages/disk.scm (dmraid)
[native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
[arguments]: When target riscv64-linux-gnu, add update-config phase.

Change-Id: I491c43a6ce2c3fc3aed43ecab9d4a2ab251038bb
---
 gnu/packages/disk.scm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index b0117d77ce..5339f54d99 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -27,7 +27,7 @@
 ;;; Copyright © 2022 Disseminate Dissent <disseminatedissent <at> protonmail.com>
 ;;; Copyright © 2023 Timotej Lazar <timotej.lazar <at> araneo.si>
 ;;; Copyright © 2023 Morgan Smith <Morgan.J.Smith <at> outlook.com>
-;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2023, 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1145,7 +1145,12 @@ (define-public dmraid
                 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
     (build-system gnu-build-system)
     (inputs (list lvm2))
-    (native-inputs (list which))
+    (native-inputs
+     (append (if (and (target-riscv64?)
+                      (%current-target-system))
+                 (list config)
+                 '())
+             (list which)))
     (arguments
      `(#:tests? #f                      ; No tests.
        ;; Prevent a race condition where some target would attempt to link
@@ -1158,7 +1163,18 @@ (define-public dmraid
                       (chdir (string-append ,version "/dmraid"))
                       (substitute* "make.tmpl.in"
                         (("/bin/sh") (which "sh")))
-                      #t)))
+                      #t))
+                  ,@(if (and (target-riscv64?)
+                             (%current-target-system))
+                        `((add-after 'unpack 'update-config
+                            (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                              (for-each (lambda (file)
+                                          (install-file
+                                           (search-input-file
+                                            (or native-inputs inputs)
+                                            (string-append "/bin/" file)) "."))
+                                        '("config.guess" "config.sub")))))
+                        '()))
        #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
                                ;; find libdmraid.so.
                                (string-append "LDFLAGS=-Wl,-rpath="

base-commit: 40f53e8fb5b867e3a1e8fa798328423718282aac
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#69944; Package guix-patches. (Wed, 27 Mar 2024 12:46:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Cc: guix-patches <at> gnu.org, 69944 <at> debbugs.gnu.org
Subject: Re: [bug#69944] [PATCH] gnu: dmraid: Fix cross-compiling to
 riscv64-linux.
Date: Wed, 27 Mar 2024 12:44:33 +0000
[Message part 1 (text/plain, inline)]
Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:

> * gnu/packages/disk.scm (dmraid)
> [native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
> [arguments]: When target riscv64-linux-gnu, add update-config phase.
>
> Change-Id: I491c43a6ce2c3fc3aed43ecab9d4a2ab251038bb
> ---
>  gnu/packages/disk.scm | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)

Hi!

Thanks for the patch, this doesn't build for me though:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `riscv64-linux-gnu': machine `riscv64' not recognized
configure: error: /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash autoconf/config.sub riscv64-linux-gnu failed
error: in phase 'configure': uncaught exception:
%exception #<&invoke-error program: "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" arguments: ("./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "--prefix=/gnu/store/gb6ij94hk33ivx193zq87m2vhlhzsm8j-dmraid-1.0.0.rc16-3" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=riscv64-linux-gnu" "LDFLAGS=-Wl,-rpath=/gnu/store/gb6ij94hk33ivx193zq87m2vhlhzsm8j-dmraid-1.0.0.rc16-3/lib") exit-status: 1 term-signal: #f stop-signal: #f> 


https://bordeaux.guix.gnu.org/build/47b7e0bf-b082-4d62-ac4c-8de5c28f5faf/log
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#69944; Package guix-patches. (Wed, 27 Mar 2024 12:46:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#69944; Package guix-patches. (Wed, 27 Mar 2024 13:45:03 GMT) Full text and rfc822 format available.

Message #14 received at 69944 <at> debbugs.gnu.org (full text, mbox):

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 69944 <at> debbugs.gnu.org
Subject: Re: [bug#69944] [PATCH] gnu: dmraid: Fix cross-compiling to
 riscv64-linux.
Date: Wed, 27 Mar 2024 21:40:02 +0800
[Message part 1 (text/plain, inline)]
Christopher Baines <mail <at> cbaines.net> writes:

> [[PGP Signed Part:Undecided]]
>
> Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:
>
>> * gnu/packages/disk.scm (dmraid)
>> [native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
>> [arguments]: When target riscv64-linux-gnu, add update-config phase.
>>
>> Change-Id: I491c43a6ce2c3fc3aed43ecab9d4a2ab251038bb
>> ---
>>  gnu/packages/disk.scm | 22 +++++++++++++++++++---
>>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> Hi!
>
> Thanks for the patch, this doesn't build for me though:

Sorry, this patch should build, and also build to aarch64-linux-gnu.

[0001-gnu-dmraid-Fix-cross-compiling.patch (text/x-patch, inline)]
From 61f56da975095071649e48a6e975ffcdd4dd8063 Mon Sep 17 00:00:00 2001
Message-ID: <61f56da975095071649e48a6e975ffcdd4dd8063.1711546964.git.zhengjunjie <at> iscas.ac.cn>
From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Date: Sat, 23 Mar 2024 00:17:47 +0800
Subject: [PATCH] gnu: dmraid: Fix cross-compiling

* gnu/packages/disk.scm (dmraid)
[native-inputs]: When cross compiling, add config, autoconf, automake.
[arguments]: When cross compiling, add update-config and fix-rpl_malloc phase.

Change-Id: I491c43a6ce2c3fc3aed43ecab9d4a2ab251038bb
---
 gnu/packages/disk.scm | 39 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index b0117d77ce..35e75d89fe 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -27,7 +27,7 @@
 ;;; Copyright © 2022 Disseminate Dissent <disseminatedissent <at> protonmail.com>
 ;;; Copyright © 2023 Timotej Lazar <timotej.lazar <at> araneo.si>
 ;;; Copyright © 2023 Morgan Smith <Morgan.J.Smith <at> outlook.com>
-;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2023, 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1145,7 +1145,13 @@ (define-public dmraid
                 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
     (build-system gnu-build-system)
     (inputs (list lvm2))
-    (native-inputs (list which))
+    (native-inputs
+     (append (if (%current-target-system)
+                 (list config
+                       autoconf
+                       automake)
+                 '())
+             (list which)))
     (arguments
      `(#:tests? #f                      ; No tests.
        ;; Prevent a race condition where some target would attempt to link
@@ -1158,7 +1164,34 @@ (define-public dmraid
                       (chdir (string-append ,version "/dmraid"))
                       (substitute* "make.tmpl.in"
                         (("/bin/sh") (which "sh")))
-                      #t)))
+                      #t))
+                  ,@(if (%current-target-system)
+                        `((add-after 'unpack 'update-config
+                            (lambda* (#:key native-inputs inputs
+                                      #:allow-other-keys)
+                              (with-directory-excursion
+                                  (string-append ,version "/dmraid/autoconf")
+                                (for-each (lambda (file)
+                                            (install-file
+                                             (search-input-file
+                                              (or native-inputs inputs)
+                                              (string-append "/bin/" file))
+                                             "."))
+                                          '("config.guess" "config.sub")))))
+                          (add-after 'unpack 'fix-rpl_malloc
+                            (lambda _
+                              ;; AC_FUNC_MALLOC and AC_FUNC_REALLOC usually
+                              ;; unneeded, see
+                              ;; https://lists.gnu.org/archive/html/autoconf/2003-02/msg00017.html
+                              (with-directory-excursion
+                                  (string-append ,version "/dmraid")
+                                (substitute* "configure.in"
+                                  (("AC_FUNC_MALLOC") "")
+                                  (("AC_FUNC_REALLOC") ""))
+                                (delete-file "./configure")
+                                (copy-file "configure.in" "configure.ac")
+                                (invoke "autoreconf" "-fiv")))))
+                        '()))
        #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
                                ;; find libdmraid.so.
                                (string-append "LDFLAGS=-Wl,-rpath="

base-commit: 656baadf83f2812c0ff79f4f2f0b5f1e927ed8a5
-- 
2.41.0

[Message part 3 (text/plain, inline)]

>
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... Invalid configuration
> `riscv64-linux-gnu': machine `riscv64' not recognized
> configure: error:
> /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash
> autoconf/config.sub riscv64-linux-gnu failed
> error: in phase 'configure': uncaught exception:
> %exception #<&invoke-error program:
> "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash"
> arguments: ("./configure" "CC_FOR_BUILD=gcc"
> "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash"
> "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash"
> "--prefix=/gnu/store/gb6ij94hk33ivx193zq87m2vhlhzsm8j-dmraid-1.0.0.rc16-3"
> "--enable-fast-install" "--build=x86_64-unknown-linux-gnu"
> "--host=riscv64-linux-gnu"
> "LDFLAGS=-Wl,-rpath=/gnu/store/gb6ij94hk33ivx193zq87m2vhlhzsm8j-dmraid-1.0.0.rc16-3/lib")
> exit-status: 1 term-signal: #f stop-signal: #f>
>
>
> https://bordeaux.guix.gnu.org/build/47b7e0bf-b082-4d62-ac4c-8de5c28f5faf/log
>
> [[End of PGP Signed Part]]

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#69944; Package guix-patches. (Sun, 21 Apr 2024 14:04:05 GMT) Full text and rfc822 format available.

Message #17 received at 69944 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Cc: 69944 <at> debbugs.gnu.org
Subject: Re: [bug#69944] [PATCH] gnu: dmraid: Fix cross-compiling to
 riscv64-linux.
Date: Sun, 21 Apr 2024 15:03:36 +0100
[Message part 1 (text/plain, inline)]
Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> [[PGP Signed Part:Undecided]]
>>
>> Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:
>>
>>> * gnu/packages/disk.scm (dmraid)
>>> [native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
>>> [arguments]: When target riscv64-linux-gnu, add update-config phase.
>>>
>>> Change-Id: I491c43a6ce2c3fc3aed43ecab9d4a2ab251038bb
>>> ---
>>>  gnu/packages/disk.scm | 22 +++++++++++++++++++---
>>>  1 file changed, 19 insertions(+), 3 deletions(-)
>>
>> Hi!
>>
>> Thanks for the patch, this doesn't build for me though:
>
> Sorry, this patch should build, and also build to aarch64-linux-gnu.

Thanks, would you be able to rebase this on master and resend, as I
don't think it applies currently?

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.