GNU bug report logs - #72543
[PATCH] gnu: cpu-features: Fix cross-compilation.

Previous Next

Package: guix-patches;

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

Date: Fri, 9 Aug 2024 14:09:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72543 in the body.
You can then email your comments to 72543 AT debbugs.gnu.org in the normal way.

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#72543; Package guix-patches. (Fri, 09 Aug 2024 14:09: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, 09 Aug 2024 14:09: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: cpu-features: Fix cross-compilation.
Date: Fri,  9 Aug 2024 22:07:05 +0800
* gnu/packages/assembly.scm (cpu-features)[arguments]<#:configure-flags>: When
cross-compilation, set CMAKE_SYSTEM_PROCESSOR.

Change-Id: I8b6f9bdeac66b85ab273f81a320e4b8e0d69b5d0
---
 gnu/packages/assembly.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/assembly.scm b/gnu/packages/assembly.scm
index b7ccb153d3..5b2518277c 100644
--- a/gnu/packages/assembly.scm
+++ b/gnu/packages/assembly.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2022 Felix Gruber <felgru <at> posteo.net>
 ;;; Copyright © 2023 Simon South <simon <at> simonsouth.net>
 ;;; Copyright © 2023 B. Wilson <elaexuotee <at> wilsonb.com>
+;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -664,7 +665,24 @@ (define-public cpu-features
       #:tests? #f
       #:configure-flags
       #~(list "-DBUILD_TESTING=off" ;; XXX: insists on using bundled googletest
-              "-DBUILD_SHARED_LIBS=ON")))
+              "-DBUILD_SHARED_LIBS=ON"
+              #$@(let ((target (%current-target-system)))
+                   (if target
+                       (cond ((string-prefix? "arm" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=arm"))
+                             ((string-prefix? "aarch64" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
+                             ((string-prefix? "i686" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=x86"))
+                             ((string-prefix? "x86_64" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
+                             ;; 32-bit and 64-bit
+                             ((string-prefix? "powerpc" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
+                             ((string-prefix? "riscv64" target)
+                              '("-DCMAKE_SYSTEM_PROCESSOR=riscv64"))
+                             (else '()))
+                       '())))))
     (home-page "https://github.com/google/cpu_features")
     (synopsis "Cross platform C99 library to get cpu features at runtime")
     (description

base-commit: 20dbf225f332ccc707578263ed710dcf2a8fb78e
-- 
2.45.2





Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Wed, 14 Aug 2024 10:15:01 GMT) Full text and rfc822 format available.

Notification sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
bug acknowledged by developer. (Wed, 14 Aug 2024 10:15:02 GMT) Full text and rfc822 format available.

Message #10 received at 72543-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Cc: 72543-done <at> debbugs.gnu.org
Subject: Re: [bug#72543] [PATCH] gnu: cpu-features: Fix cross-compilation.
Date: Wed, 14 Aug 2024 11:13:41 +0100
[Message part 1 (text/plain, inline)]
Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:

> * gnu/packages/assembly.scm (cpu-features)[arguments]<#:configure-flags>: When
> cross-compilation, set CMAKE_SYSTEM_PROCESSOR.
>
> Change-Id: I8b6f9bdeac66b85ab273f81a320e4b8e0d69b5d0
> ---
>  gnu/packages/assembly.scm | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)

Looks good to me, I've pushed to master as
e320ed57204363625dc1eb1e393f8535020087e0.

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

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Sep 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 359 days ago.

Previous Next


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