summary refs log tree commit diff
diff options
context:
space:
mode:
authorJean-Pierre De Jesus DIAZ <jean@foundationdevices.com>2023-07-26 17:37:29 +0200
committerLudovic Courtès <ludo@gnu.org>2023-09-17 15:31:03 +0200
commit19b617370844ad48eab68e6fc4b9e47665f71710 (patch)
tree565ae923daa7d9c94a6e15114ff7c8cb019bf6b7
parent04f71edb73205d0bb82404de28a70ae17b897429 (diff)
downloadguix-19b617370844ad48eab68e6fc4b9e47665f71710.tar.gz
transformations: tuned-package: Use target on cross-compile.
* guix/transformations.scm (tuned-package): Use either bag-target if
  available or bag-system to select the CPU architecture of the package
  that is going to be tuned.  This enables the tuning of cross-compiled
  packages.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/transformations.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/transformations.scm b/guix/transformations.scm
index ede914456f..9cba6bedab 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -529,8 +529,9 @@ system that builds code for MICRO-ARCHITECTURE; otherwise raise an error."
     ;; leading to an obscure build error, check whether the compiler is known
     ;; to support MICRO-ARCHITECTURE.  If not, bail out.
     (let* ((lowered      (apply lower args))
-           (architecture (match (string-tokenize (bag-system lowered)
-                                                 %not-hyphen)
+           (target (or (bag-target lowered)
+                       (bag-system lowered)))
+           (architecture (match (string-tokenize target %not-hyphen)
                            ((arch _ ...) arch)))
            (compiler     (any (match-lambda
                                 ((label (? package? p) . _)