guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/11: DRAFT gnu: gnumach: Fix build for i686-linux.


From: guix-commits
Subject: 11/11: DRAFT gnu: gnumach: Fix build for i686-linux.
Date: Sun, 21 Jan 2024 14:52:18 -0500 (EST)

janneke pushed a commit to branch hurd-team
in repository guix.

commit dc3864f80eb1e199b455193913b7101a5fd998d5
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sun Jan 21 19:40:43 2024 +0100

    DRAFT gnu: gnumach: Fix build for i686-linux.
    
    This still fails the gnumach-undef-bad
    
        [..]
        then cat gnumach-undef-bad; exit 2; else true; fi
        putchar
        puts
        make[2]: *** [Makefile:9665: libgcc-routines.o] Error 2
    
    * gnu/packages/patches/gnumach-fix-x86.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/hurd.scm (gnumach)[arguments]: When building for x86, add
    `fix-build' phase and use it.
    
    Change-Id: Ibec03121f90b30160725c87e999e38f677b2e369
---
 gnu/local.mk                               |  3 ++-
 gnu/packages/hurd.scm                      | 27 +++++++++++++++++----------
 gnu/packages/patches/gnumach-fix-x86.patch | 26 ++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 9a9847466f..ae2b70a0b3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -11,7 +11,7 @@
 # Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 # Copyright © 2016, 2017, 2018, 2019 Alex Vong <alexvong1995@gmail.com>
 # Copyright © 2016-2023 Efraim Flashner <efraim@flashner.co.il>
-# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan (janneke) 
Nieuwenhuizen <janneke@gnu.org>
+# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Janneke 
Nieuwenhuizen <janneke@gnu.org>
 # Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 # Copyright © 2017, 2018, 2023 Clément Lassieur <clement@lassieur.org>
 # Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -1368,6 +1368,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/gnome-settings-daemon-gc.patch          \
   %D%/packages/patches/gnome-session-support-elogind.patch     \
   %D%/packages/patches/gnome-tweaks-search-paths.patch         \
+  %D%/packages/patches/gnumach-fix-x86.patch                   \
   %D%/packages/patches/gnumach-support-noide.patch             \
   %D%/packages/patches/gnupg-default-pinentry.patch            \
   %D%/packages/patches/gnupg-1-build-with-gcc10.patch          \
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index a928aaed8c..eb46fd561d 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -262,19 +262,26 @@ Hurd-minimal package which are needed for both glibc and 
GCC.")
        ((#:make-flags flags ''())
         `(cons "CFLAGS=-fcommon" ,flags))
        ((#:configure-flags flags ''())
-        `(cons* "--enable-kdb" ;enable kernel debugger
+        `(cons* "--enable-kdb"          ;enable kernel debugger
                 "--disable-net-group"
                 "--disable-pcmcia-group"
                 "--disable-wireless-group"
-               ,flags))
+                ,flags))
        ((#:phases phases '%standard-phases)
-        `(modify-phases %standard-phases
-           (add-after 'install 'produce-image
-             (lambda* (#:key outputs #:allow-other-keys)
-               (let* ((out  (assoc-ref outputs "out"))
-                      (boot (string-append out "/boot")))
-                 (invoke "make" "gnumach.gz")
-                 (install-file "gnumach.gz" boot))))))))
+        #~(modify-phases %standard-phases
+            (add-after 'install 'produce-image
+              (lambda _
+                (let ((boot (string-append #$output "/boot")))
+                  (invoke "make" "gnumach.gz")
+                  (install-file "gnumach.gz" boot))))
+            #$@(if (target-x86?)
+                   #~((add-after 'unpack 'fix-build
+                        (lambda _
+                          (let ((patch-file
+                                 #$(local-file
+                                    (search-patch "gnumach-fix-x86.patch"))))
+                            (invoke "patch" "--force" "-p1" "-i" 
patch-file)))))
+                   '())))))
     (native-inputs
      (list autoconf
            automake
@@ -283,7 +290,7 @@ Hurd-minimal package which are needed for both glibc and 
GCC.")
                mig)
            perl
            texinfo-4))
-    (supported-systems %hurd-systems)
+    (supported-systems `("i686-linux" ,@%hurd-systems))
     (synopsis "Microkernel of the GNU system")
     (description
      "GNU Mach is the microkernel upon which a GNU Hurd system is based.")))
diff --git a/gnu/packages/patches/gnumach-fix-x86.patch 
b/gnu/packages/patches/gnumach-fix-x86.patch
new file mode 100644
index 0000000000..f5f92aec07
--- /dev/null
+++ b/gnu/packages/patches/gnumach-fix-x86.patch
@@ -0,0 +1,26 @@
+diff --git a/include/sys/types.h b/include/sys/types.h
+index 8d5af37a..250a5942 100644
+--- a/include/sys/types.h
++++ b/include/sys/types.h
+@@ -60,7 +60,7 @@ typedef      unsigned long long      time_t;
+ #define RAND_MAX      0x7fffffff
+ 
+ /* Symbols not allowed by POSIX */
+-#ifndef _POSIX_SOURCE
++#if 1 //ndef _POSIX_SOURCE
+ 
+ /*
+  * Common type definitions that lots of old files seem to want.
+diff --git a/linux/dev/include/linux/types.h b/linux/dev/include/linux/types.h
+index eb086c20..3baccbb5 100644
+--- a/linux/dev/include/linux/types.h
++++ b/linux/dev/include/linux/types.h
+@@ -4,7 +4,7 @@
+ #include <linux/posix_types.h>
+ #include <asm/types.h>
+ 
+-#ifndef __KERNEL_STRICT_NAMES
++#if 1 //ndef __KERNEL_STRICT_NAMES
+ 
+ typedef __kernel_fd_set               fd_set;
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]