GNU bug report logs - #64845
[PATCH] gnu: fcode-utils: Fix cross-compilation.

Previous Next

Package: guix-patches;

Reported by: Zheng Junjie <873216071 <at> qq.com>

Date: Tue, 25 Jul 2023 07:47:02 UTC

Severity: normal

Tags: patch

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

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 64845 in the body.
You can then email your comments to 64845 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 efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Tue, 25 Jul 2023 07:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zheng Junjie <873216071 <at> qq.com>:
New bug report received and forwarded. Copy sent to efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org. (Tue, 25 Jul 2023 07:47:02 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: fcode-utils: Fix cross-compilation.
Date: Tue, 25 Jul 2023 15:45:13 +0800
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: add remove-makefile-strip phase.
---
 gnu/packages/firmware.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 35d3100ac6..01565ed18a 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -387,7 +388,14 @@ (define-public fcode-utils
               (string-append "DESTDIR=" #$output))
       #:phases
       #~(modify-phases %standard-phases
-          (delete 'configure))))        ; No configure script.
+          (delete 'configure)       ; No configure script.
+          (add-after 'unpack 'remove-makefile-strip
+            (lambda _
+              (substitute* '("detok/Makefile"
+                             "romheaders/Makefile"
+                             "toke/Makefile")
+                (("\\$\\(STRIP\\).*")
+                 "")))))))
     (native-inputs
      (list tcsh))
     (home-page "https://www.openfirmware.info/FCODE_suite")

base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Tue, 25 Jul 2023 17:12:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Zheng Junjie <873216071 <at> qq.com>, 64845 <at> debbugs.gnu.org
Cc: Ludovic Court?s <ludo <at> gnu.org>, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#64845] [PATCH] gnu: fcode-utils: Fix cross-compilation.
Date: Tue, 25 Jul 2023 10:11:11 -0700
[Message part 1 (text/plain, inline)]
On 2023-07-25, Zheng Junjie wrote:
> * gnu/packages/firmware.scm (fcode-utils)
> [arguments]: add remove-makefile-strip phase.
> ---
>  gnu/packages/firmware.scm | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
> index 35d3100ac6..01565ed18a 100644
> --- a/gnu/packages/firmware.scm
> +++ b/gnu/packages/firmware.scm
> @@ -9,6 +9,7 @@
>  ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius <at> gnu.org>
>  ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
>  ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> +;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -387,7 +388,14 @@ (define-public fcode-utils
>                (string-append "DESTDIR=" #$output))
>        #:phases
>        #~(modify-phases %standard-phases
> -          (delete 'configure))))        ; No configure script.
> +          (delete 'configure)       ; No configure script.
> +          (add-after 'unpack 'remove-makefile-strip
> +            (lambda _
> +              (substitute* '("detok/Makefile"
> +                             "romheaders/Makefile"
> +                             "toke/Makefile")
> +                (("\\$\\(STRIP\\).*")
> +                 "")))))))

Can you include a brief comment? That is a bit easier than rummaging
around through git history commit messages... :)

>      (native-inputs
>       (list tcsh))
>      (home-page "https://www.openfirmware.info/FCODE_suite")
>
> base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
> -- 
> 2.41.0

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

Information forwarded to efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Wed, 26 Jul 2023 06:04:01 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <873216071 <at> qq.com>
To: 64845 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: fcode-utils: Fix cross-compilation.
Date: Wed, 26 Jul 2023 14:03:31 +0800
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: add remove-makefile-strip phase.
---
 gnu/packages/firmware.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 35d3100ac6..ba8d462af9 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -387,7 +388,16 @@ (define-public fcode-utils
               (string-append "DESTDIR=" #$output))
       #:phases
       #~(modify-phases %standard-phases
-          (delete 'configure))))        ; No configure script.
+          (delete 'configure)       ; No configure script.
+          ;;  makefile will invoke `strip', it break cross-compile,
+          ;;  and we have 'strip phase handled it , so remove it from makefile.
+          (add-after 'unpack 'remove-makefile-strip
+            (lambda _
+              (substitute* '("detok/Makefile"
+                             "romheaders/Makefile"
+                             "toke/Makefile")
+                (("\\$\\(STRIP\\).*")
+                 "")))))))
     (native-inputs
      (list tcsh))
     (home-page "https://www.openfirmware.info/FCODE_suite")

base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Wed, 26 Jul 2023 12:35:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 64845 <at> debbugs.gnu.org, Zhen Junjie <873216071 <at> qq.com>
Subject: Re: [PATCH] gnu: fcode-utils: Fix cross-compilation.
Date: Wed, 26 Jul 2023 14:34:30 +0200
[Message part 1 (text/plain, inline)]
I happened upon this patch ...

setting STRIP to (strip-for-target) in #:make-flags (like done for CC) 
would fix this in a simpler way.

Also, that (string-append "DESTDIR=" #$output)) is bogus; it's a bug (*) 
in the Makefiles that it used $(DESTIDIR) instead of $(DESTDIR)$(PREFIX).

install:
	mkdir -p $(DESTDIR)/bin
	cp $(PROGRAM) $(DESTDIR)/bin/$(PROGRAM)

(*) 
https://people.freebsd.org/~rodrigc/doc/data/doc/en_US.ISO8859-1/books/porters-handbook/porting-prefix.html
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to mail <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Fri, 28 Jul 2023 13:35:02 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <873216071 <at> qq.com>
To: 64845 <at> debbugs.gnu.org
Subject: [PATCH v3 1/2] utils: Add 'strip-for-target'.
Date: Fri, 28 Jul 2023 21:33:52 +0800
* guix/utils.scm (strip-for-target): New procedure.
---
 guix/utils.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/utils.scm b/guix/utils.scm
index e9af33bdeb..7a42b49df2 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Antero Mejr <antero <at> mailbox.org>
 ;;; Copyright © 2023 Philip McGrath <philip <at> philipmcgrath.com>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -111,6 +112,7 @@ (define-module (guix utils)
             cxx-for-target
             ld-for-target
             pkg-config-for-target
+            strip-for-target
 
             version-compare
             version>?
@@ -784,6 +786,11 @@ (define* (pkg-config-for-target #:optional (target (%current-target-system)))
       (string-append target "-pkg-config")
       "pkg-config"))
 
+(define* (strip-for-target #:optional (target (%current-target-system)))
+  (if target
+      (string-append target "-strip")
+      "strip"))
+
 (define version-compare
   (let ((strverscmp
          (let ((sym (or (dynamic-func "strverscmp" (dynamic-link))

base-commit: 35c8d631d2bd63c64e863b5509f29fdcb7f856e6
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#64845; Package guix-patches. (Fri, 28 Jul 2023 13:35:02 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <873216071 <at> qq.com>
To: 64845 <at> debbugs.gnu.org
Subject: [PATCH v3 2/2] gnu: fcode-utils: Fix cross-compilation.
Date: Fri, 28 Jul 2023 21:33:53 +0800
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: use STRIP-FOR-TARGET.
---
 gnu/packages/firmware.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index ff5afbcbe1..70c43a6ad0 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -384,6 +385,7 @@ (define-public fcode-utils
       #:test-target "tests"
       #:make-flags
       #~(list (string-append "CC=" #$(cc-for-target))
+              (string-append "STRIP=" #$(strip-for-target))
               (string-append "DESTDIR=" #$output))
       #:phases
       #~(modify-phases %standard-phases
-- 
2.41.0





Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Thu, 26 Oct 2023 12:42:01 GMT) Full text and rfc822 format available.

Notification sent to Zheng Junjie <873216071 <at> qq.com>:
bug acknowledged by developer. (Thu, 26 Oct 2023 12:42:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Zheng Junjie <873216071 <at> qq.com>
Cc: Vagrant Cascadian <vagrant <at> debian.org>,
 Ludovic Courtès <ludo <at> gnu.org>, 64845-done <at> debbugs.gnu.org,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#64845] [PATCH v3 2/2] gnu: fcode-utils: Fix
 cross-compilation.
Date: Thu, 26 Oct 2023 14:41:17 +0200
> * gnu/packages/firmware.scm (fcode-utils)
> [arguments]: use STRIP-FOR-TARGET.

Applied both patches, thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Nov 2023 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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