unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67859] [PATCH] gnu: libsigsegv: Fix x86_64 cross-compilation.
@ 2023-12-16 22:57 Leo Nikkilä via Guix-patches via
  2023-12-23  9:36 ` Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Nikkilä via Guix-patches via @ 2023-12-16 22:57 UTC (permalink / raw)
  To: 67859; +Cc: Leo Nikkilä

* gnu/packages/libsigsegv.scm (libsigsegv): Set `#:phases' for x86_64.
---
 gnu/packages/libsigsegv.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/libsigsegv.scm b/gnu/packages/libsigsegv.scm
index ebbdd2ad90..39c76cd462 100644
--- a/gnu/packages/libsigsegv.scm
+++ b/gnu/packages/libsigsegv.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2023 Leo Nikkilä <hello@lnikki.la>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +42,21 @@ (define-public libsigsegv
     `(;; The shared library isn't built by default but some packages need it.
       #:configure-flags '("--enable-shared")
 
+      ;; When cross-compiling for x86_64, work around this error:
+      ;;
+      ;; In file included from fault-linux-x86_64-old.h:17,
+      ;;    [...]
+      ;; linux-libre-headers-cross-x86_64-linux-gnu-5.15.49/include/asm/sigcontext.h:317:8: error: redefinition of ‘struct sigcontext’
+      ,@(if (string-contains (or (%current-target-system)
+                                 (%current-system))
+                             "x86_64")
+            `(#:phases (modify-phases %standard-phases
+                         (add-before 'configure 'patch-x86_64-old-h
+                           (lambda _
+                             (substitute* "src/fault-linux-x86_64-old.h"
+                               (("#include <asm/sigcontext\\.h>") ""))))))
+            '())
+
       ;; On MIPS, work around this error:
       ;;
       ;; In file included from fault-linux-mips-old.h:18:0,
@@ -52,8 +68,7 @@ (define-public libsigsegv
                          (add-before 'configure 'patch-mips-old-h
                            (lambda _
                              (substitute* "src/fault-linux-mips-old.h"
-                               (("#include <asm/sigcontext\\.h>") ""))
-                             #t))))
+                               (("#include <asm/sigcontext\\.h>") ""))))))
             '())))
    (description
     "GNU libsigsegv is a library to handle page faults, which occur when a
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#67859] [PATCH] gnu: libsigsegv: Fix x86_64 cross-compilation.
  2023-12-16 22:57 [bug#67859] [PATCH] gnu: libsigsegv: Fix x86_64 cross-compilation Leo Nikkilä via Guix-patches via
@ 2023-12-23  9:36 ` Mathieu Othacehe
  2024-01-07 18:13   ` bug#67859: " Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2023-12-23  9:36 UTC (permalink / raw)
  To: Leo Nikkilä; +Cc: 67859


Hello,

> +                         (add-before 'configure 'patch-x86_64-old-h
> +                           (lambda _
> +                             (substitute* "src/fault-linux-x86_64-old.h"
> +                               (("#include <asm/sigcontext\\.h>") ""))))))

That is almost the same fix as for MIPS so it could be
factorized. Couldn't we do that for all architectures in
src/fault-linux-xxx-old.h?

Is that issue reported upstream?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#67859: [PATCH] gnu: libsigsegv: Fix x86_64 cross-compilation.
  2023-12-23  9:36 ` Mathieu Othacehe
@ 2024-01-07 18:13   ` Mathieu Othacehe
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Othacehe @ 2024-01-07 18:13 UTC (permalink / raw)
  To: Leo Nikkilä; +Cc: 67859-done


Hello,

> That is almost the same fix as for MIPS so it could be
> factorized. Couldn't we do that for all architectures in
> src/fault-linux-xxx-old.h?

Efraim tooks care of it with 9816a5371663396bc092eb359222635e5675b174.

Closing, thanks,

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-07 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16 22:57 [bug#67859] [PATCH] gnu: libsigsegv: Fix x86_64 cross-compilation Leo Nikkilä via Guix-patches via
2023-12-23  9:36 ` Mathieu Othacehe
2024-01-07 18:13   ` bug#67859: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).