GNU bug report logs - #50201
[PATCH core-updates-frozen 0/52] Support cross-compilation in glib-or-gtk-build-system and fix cross-compilation errors

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Wed, 25 Aug 2021 17:59:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: 50201 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [bug#50201] [PATCH 04/52] gnu: libcap: Fix cross-compilation build failures.
Date: Wed, 25 Aug 2021 20:02:44 +0200
* gnu/packages/linux.scm
  (libcap)[arguments]<#:phases>{configure}: Don't use non-existent
  '%output' when cross-compiling.
  (libcap)[arguments]<#:make-flags>: Set "CROSS_COMPILE" and "BUILD_CC"
  when cross-compiling.
---
 gnu/packages/linux.scm | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1f52bccee8..0dd8cf4ed4 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2812,20 +2812,32 @@ configuration (iptunnel, ipmaddr).")
               (base32
                "1ych13qc1mvzv8iscbims5b317vxcmy5ffpmfy98zk7bgamz62b6"))))
     (build-system gnu-build-system)
-    (arguments '(#:phases
-                 (modify-phases %standard-phases
-                   (replace 'configure
-                            ;; Add $libdir to the RUNPATH of executables.
-                            (lambda _
-                              (substitute* "Make.Rules"
-                                (("LDFLAGS \\?= #-g")
-                                 (string-append "LDFLAGS ?= -Wl,-rpath="
-                                                %output "/lib"))))))
+    (arguments `(#:phases
+                 ,#~(modify-phases %standard-phases
+                      (replace 'configure
+                        ;; Add $libdir to the RUNPATH of executables.
+                        (lambda _
+                          (substitute* "Make.Rules"
+                            (("LDFLAGS \\?= #-g")
+                             (string-append "LDFLAGS ?= -Wl,-rpath="
+                                            ;; TODO(core-updates): Use #$output
+                                            ;; unconditionally.
+                                            #$(if (%current-target-system)
+                                                  #~#$output
+                                                  '%output)
+                                            "/lib"))))))
                  #:test-target "test"
-                 #:make-flags (list "lib=lib"
-                                    (string-append "prefix="
-                                                   (assoc-ref %outputs "out"))
-                                    "RAISE_SETFCAP=no")))
+                 #:make-flags
+                 (list "lib=lib"
+                       (string-append "prefix=" (assoc-ref %outputs "out"))
+                       "RAISE_SETFCAP=no"
+                       ;; Tell the makefile to use TARGET-gcc and friends
+                       ;; when cross-compiling.
+                       ,@(if (%current-target-system)
+                             `(,(string-append "CROSS_COMPILE="
+                                               (%current-target-system) "-")
+                               "BUILD_CC=gcc")
+                             '()))))
     (native-inputs `(("perl" ,perl)))
     (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "https://sites.google.com/site/fullycapable/")
-- 
2.33.0





This bug report was last modified 3 years and 239 days ago.

Previous Next


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