From patchwork Wed Mar 27 13:40:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Z572 X-Patchwork-Id: 62278 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1F56527BBE9; Wed, 27 Mar 2024 13:45:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6AA9527BBE2 for ; Wed, 27 Mar 2024 13:45:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpTaX-0001Su-KF; Wed, 27 Mar 2024 09:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpTaS-0001SO-Kx for guix-patches@gnu.org; Wed, 27 Mar 2024 09:45:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpTaR-0001aY-V6 for guix-patches@gnu.org; Wed, 27 Mar 2024 09:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpTaR-0005Zt-Vb for guix-patches@gnu.org; Wed, 27 Mar 2024 09:45:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69944] [PATCH] gnu: dmraid: Fix cross-compiling to riscv64-linux. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Mar 2024 13:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69944 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 69944@debbugs.gnu.org Received: via spool by 69944-submit@debbugs.gnu.org id=B69944.171154705021222 (code B ref 69944); Wed, 27 Mar 2024 13:45:03 +0000 Received: (at 69944) by debbugs.gnu.org; 27 Mar 2024 13:44:10 +0000 Received: from localhost ([127.0.0.1]:36157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpTZZ-0005WD-MR for submit@debbugs.gnu.org; Wed, 27 Mar 2024 09:44:10 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:41644 helo=cstnet.cn) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpTZU-0005T2-6a for 69944@debbugs.gnu.org; Wed, 27 Mar 2024 09:44:08 -0400 Received: from m (unknown [107.174.64.25]) by APP-01 (Coremail) with SMTP id qwCowABHT5+SIgRmYLpWCQ--.48487S2; Wed, 27 Mar 2024 21:43:51 +0800 (CST) References: <875xx7hmhm.fsf@cbaines.net> User-agent: mu4e 1.10.8; emacs 30.0.50 From: Zheng Junjie Date: Wed, 27 Mar 2024 21:40:02 +0800 In-reply-to: <875xx7hmhm.fsf@cbaines.net> Message-ID: <87a5mjg57z.fsf@iscas.ac.cn> MIME-Version: 1.0 X-CM-TRANSID: qwCowABHT5+SIgRmYLpWCQ--.48487S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Gr1ftF1xAw4kZF4kAryxXwb_yoWxArg_Ca 45ZasrGr1kXFZ3Ca4vqFWDCryUZayjqF4F93WIqrWrJrZIvr42q3ZYqrsxA3Z8KF45Ar1x Cr4kZry8Ar9FvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbskYjsxI4VWkCwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1lnx0Ee4C267I2x7xF54xIwI0E7I0Y6sxI4wAS0I0E0xvY zxvE52x082IY62kv0487M2AExVA0xI801c8C04v7Mc02F40EFcxC0VAKzVAqx4xG6I80ew Av7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY 6r1j6r4UM4x0Y48IcVAKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r 4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF 67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2I x0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2 z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73Uj IFyTuYvjxUY-B_UUUUU X-Originating-IP: [107.174.64.25] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Christopher Baines writes: > [[PGP Signed Part:Undecided]] > > Zheng Junjie 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. > > 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]] From 61f56da975095071649e48a6e975ffcdd4dd8063 Mon Sep 17 00:00:00 2001 Message-ID: <61f56da975095071649e48a6e975ffcdd4dd8063.1711546964.git.zhengjunjie@iscas.ac.cn> From: Zheng Junjie 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 ;;; Copyright © 2023 Timotej Lazar ;;; Copyright © 2023 Morgan Smith -;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2023, 2024 Zheng Junjie <873216071@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