unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32
@ 2024-01-02  7:26 Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 1/5] gnu: " Efraim Flashner
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:26 UTC (permalink / raw)
  To: 68202; +Cc: Efraim Flashner

I was reminded recently about a comment I made back in February 2017
about getting guix support for x32, aka x86_64-linux-gnux32, aka
x86_64-linux but with 32-bit data structures.  The idea was that by
using 32-bit pointers there'd be a not insignificant speed-up of code
execution¹.  I am uncertain how true this is, or which packages would
really benefit from this.

Interestingly,
%glibc-cross-x86_64-linux-gnux32-2.35/lib/ld-linux-x32.so.2 --help
suggests that it still benefits from our --tune parameters, which is not
the case for i686-linux's ld-linux.so.2.

¹ https://en.wikipedia.org/wiki/X32_ABI

Efraim Flashner (5):
  gnu: Add support for x86_64-linux-gnux32.
  gnu: Add target-x32?.
  gnu: openssl: Fix building on x86_64-linux-gnux32.
  gnu: gmp: Fix building on x86_64-linux-gnux32.
  gnu: libsigsegv: Fix building for x86_64-linux-gnux32.

 gnu/packages/bootstrap.scm      |  5 ++++-
 gnu/packages/gcc.scm            |  5 ++++-
 gnu/packages/libsigsegv.scm     | 33 +++++++++++++++++----------------
 gnu/packages/multiprecision.scm |  4 +++-
 gnu/packages/tls.scm            |  4 +++-
 guix/platforms/x86.scm          | 10 ++++++++++
 guix/utils.scm                  | 12 +++++++++++-
 7 files changed, 52 insertions(+), 21 deletions(-)


base-commit: f2102cb5b9239be2ed2023b908b726af542e0124
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 1/5] gnu: Add support for x86_64-linux-gnux32.
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
@ 2024-01-02  7:27 ` Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 2/5] gnu: Add target-x32? Efraim Flashner
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:27 UTC (permalink / raw)
  To: 68202
  Cc: Efraim Flashner, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add entry for
x86_64-linux-gnux32.
* gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add
configure-flag for x86_64-linux-gnux32.
* guix/platforms/x86.scm (x86_64-linux-gnux32): New variable.
* guix/utils.scm (gnu-triplet->nix-system): Force x86_64-linux-gnux32 to
output a different nix-system than x86_64-linux-gnu.

Change-Id: I519fea2f8357e4b9895ede05fe8a5e373e9b034a
---
 gnu/packages/bootstrap.scm |  5 ++++-
 gnu/packages/gcc.scm       |  5 ++++-
 guix/platforms/x86.scm     | 10 ++++++++++
 guix/utils.scm             |  4 +++-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 602d8f26c5..a36bb289cd 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018, 2019 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2020, 2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2020, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2019 Carl Dong <contact@carldong.me>
 ;;; Copyright © 2019 Léo Le Bouter <lle-bout@zaclys.net>
@@ -323,6 +323,9 @@ (define* (glibc-dynamic-linker
      ((string=? system "powerpc64-linux") "/lib/ld64.so.1")
      ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
 
+     ;; TODO: Differentiate between x86_64-linux-gnu and x86_64-linux-gnux32.
+     ((string=? system "x86_64-linux-gnux32") "/lib/ld-linux-x32.so.2")
+
      ;; XXX: This one is used bare-bones, without a libc, so add a case
      ;; here just so we can keep going.
      ((string=? system "arm-eabi") "no-ld.so")
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a8b74a3632..5590cd3d7e 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2023 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2015-2018, 2020-2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015-2018, 2020-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2020, 2022 Marius Bakke <marius@gnu.org>
@@ -75,6 +75,9 @@ (define (gcc-configure-flags-for-triplet target)
            "--with-mode=thumb"
            "--with-fpu=neon"))
 
+        ((string-match "x86_64-linux-gnux32" target)
+         '("--with-abi=mx32"))
+
         ((and (string-suffix? "-gnu" target)
               (not (string-contains target "-linux")))
          ;; Cross-compilation of libcilkrts in GCC 5.5.0 to GNU/Hurd fails
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 4ed5638c14..0c8fc7296c 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,7 @@ (define-module (guix platforms x86)
   #:use-module (guix records)
   #:export (i686-linux
             x86_64-linux
+            x86_64-linux-x32
             i686-mingw
             x86_64-mingw
             i586-gnu))
@@ -41,6 +43,14 @@ (define x86_64-linux
    (rust-target "x86_64-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2")))
 
+(define x86_64-linux-x32
+  (platform
+   (target "x86_64-linux-gnux32")
+   (system #f)
+   (linux-architecture "x86_64")
+   (rust-target "x86_64-unknown-linux-gnux32")
+   (glibc-dynamic-linker "/lib/ld-linux-x32.so.2")))
+
 (define i686-mingw
   (platform
    (target "i686-w64-mingw32")
diff --git a/guix/utils.scm b/guix/utils.scm
index 8e71f97e1c..f4bf965e9a 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2018, 2020 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020, 2021, 2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
@@ -634,6 +634,8 @@ (define (gnu-triplet->nix-system triplet)
                        (else triplet))))
     (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet)
            "armhf-linux")
+          ;; Otherwise it will show up as x86_64-linux... which isn't wrong.
+          ((string-match "x86_64-linux-gnux32" triplet) "x86_64-linux-gnux32")
           ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet)
            =>
            (lambda (m)
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 2/5] gnu: Add target-x32?.
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 1/5] gnu: " Efraim Flashner
@ 2024-01-02  7:27 ` Efraim Flashner
  2024-01-08  9:20   ` Simon Tournier
  2024-01-02  7:27 ` [bug#68202] [PATCH 3/5] gnu: openssl: Fix building on x86_64-linux-gnux32 Efraim Flashner
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:27 UTC (permalink / raw)
  To: 68202
  Cc: Efraim Flashner, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

* guix/utils.scm (target-x32?): New procedure.

Change-Id: Ia16c7edce64de01d5ccb126c7bd9a6736f327b5f
---
 guix/utils.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/guix/utils.scm b/guix/utils.scm
index f4bf965e9a..e4e9d922e7 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -97,6 +97,7 @@ (define-module (guix utils)
             target-x86-32?
             target-x86-64?
             target-x86?
+            target-x32?
             target-arm32?
             target-aarch64?
             target-arm?
@@ -712,6 +713,13 @@ (define* (target-x86-64? #:optional (target (or (%current-target-system)
 architecture (x86_64)?"
   (string-prefix? "x86_64-" target))
 
+(define* (target-x32? #:optional (target (or (%current-target-system)
+                                             (%current-system))))
+  "Is the architecture of TARGET a variant of Intel/AMD's 64-bit
+architecture (x86_64) using 32-bit data types?"
+  (and (target-x86-64? target)
+       (string-suffix? "gnux32" target)))
+
 (define* (target-x86? #:optional (target (or (%current-target-system)
                                              (%current-system))))
   (or (target-x86-32? target) (target-x86-64? target)))
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 3/5] gnu: openssl: Fix building on x86_64-linux-gnux32.
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 1/5] gnu: " Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 2/5] gnu: Add target-x32? Efraim Flashner
@ 2024-01-02  7:27 ` Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 4/5] gnu: gmp: " Efraim Flashner
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:27 UTC (permalink / raw)
  To: 68202; +Cc: Efraim Flashner

* gnu/packages/tls.scm (target->openssl-target): Add entry for
x86_64-linux-gnux32.

Change-Id: Icbbdb76134da0811b8493c55ca2d3acdb77c5883
---
 gnu/packages/tls.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 75e6370c72..208a7ff640 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2016, 2017, 2019, 2021-2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2019, 2021-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
@@ -429,6 +429,8 @@ (define (target->openssl-target target)
              (cond
               ((target-x86-32? target)
                "x86")
+              ((target-x32? target)
+               "x32")
               ((target-x86-64? target)
                "x86_64")
               ((target-mips64el? target)
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 4/5] gnu: gmp: Fix building on x86_64-linux-gnux32.
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
                   ` (2 preceding siblings ...)
  2024-01-02  7:27 ` [bug#68202] [PATCH 3/5] gnu: openssl: Fix building on x86_64-linux-gnux32 Efraim Flashner
@ 2024-01-02  7:27 ` Efraim Flashner
  2024-01-02  7:27 ` [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32 Efraim Flashner
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:27 UTC (permalink / raw)
  To: 68202; +Cc: Efraim Flashner

* gnu/packages/multiprecision.scm (gmp)[arguments]: When building for
x86_64-linux-gnux32 add a configure-flag to use the x32 ABI.

Change-Id: I321c707b3f7df5eeb338f03dacf08b29181ecf53
---
 gnu/packages/multiprecision.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 0c6255c129..591170b508 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2018, 2019, 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2019, 2021, 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
@@ -71,6 +71,8 @@ (define-public gmp
                  ;; they produce different headers.  We need shared.
                  `("--disable-static"
                    "--enable-shared"))
+                ((target-x32?)
+                 `("ABI=x32"))
                 (else '())))
       ;; Remove after core-updates merge.
       ;; Workaround for gcc-7 transition breakage, -system and cross-build,
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32.
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
                   ` (3 preceding siblings ...)
  2024-01-02  7:27 ` [bug#68202] [PATCH 4/5] gnu: gmp: " Efraim Flashner
@ 2024-01-02  7:27 ` Efraim Flashner
  2024-01-03  8:43   ` Mathieu Othacehe
  2024-01-05 11:22 ` bug#68202: [PATCH 0/5] Add support " Efraim Flashner
  2024-01-08 17:14 ` [bug#68202] " Ludovic Courtès
  6 siblings, 1 reply; 12+ messages in thread
From: Efraim Flashner @ 2024-01-02  7:27 UTC (permalink / raw)
  To: 68202; +Cc: Efraim Flashner

* gnu/packages/libsigsegv.scm (libsigsegv)[arguments]: When building for
x86_64-linux-gnux32 add a phase to not include extra headers.

Change-Id: Ie2d23fd037ed533dacf08acf52771b7ab1d446ac
---
 gnu/packages/libsigsegv.scm | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/libsigsegv.scm b/gnu/packages/libsigsegv.scm
index ebbdd2ad90..9f4b0dd88d 100644
--- a/gnu/packages/libsigsegv.scm
+++ b/gnu/packages/libsigsegv.scm
@@ -1,6 +1,6 @@
 ;;; 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 © 2017, 2024 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +21,7 @@ (define-module (gnu packages libsigsegv)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu))
 
 (define-public libsigsegv
@@ -40,21 +41,21 @@ (define-public libsigsegv
    (arguments
     `(;; The shared library isn't built by default but some packages need it.
       #:configure-flags '("--enable-shared")
-
-      ;; On MIPS, work around this error:
-      ;;
-      ;; In file included from fault-linux-mips-old.h:18:0,
-      ;;    [...]
-      ;; linux-libre-headers-cross-mips64el-linux-gnu-3.3.8/include/asm/sigcontext.h:57:8: error: redefinition of 'struct sigcontext'
-      ,@(if (string-contains (or (%current-target-system) (%current-system))
-                             "mips64el")
-            `(#:phases (modify-phases %standard-phases
-                         (add-before 'configure 'patch-mips-old-h
-                           (lambda _
-                             (substitute* "src/fault-linux-mips-old.h"
-                               (("#include <asm/sigcontext\\.h>") ""))
-                             #t))))
-            '())))
+      ;; On some architectures 'struct sigcontext' gets redefined from
+      ;; %linux-libre-headers/include/asm/sigcontext.h
+      ,@(cond ((target-mips64el?)
+               `(#:phases (modify-phases %standard-phases
+                            (add-before 'configure 'patch-mips-old-h
+                              (lambda _
+                                (substitute* "src/fault-linux-mips-old.h"
+                                  (("#include <asm/sigcontext\\.h>") "")))))))
+              ((target-x32?)
+               `(#:phases (modify-phases %standard-phases
+                            (add-before 'configure 'patch-linux-x86_64-old-h
+                              (lambda _
+                                (substitute* "src/fault-linux-x86_64-old.h"
+                                  (("#include <asm/sigcontext\\.h>") "")))))))
+              (else '()))))
    (description
     "GNU libsigsegv is a library to handle page faults, which occur when a
 program tries to access an unavailable region of memory, in user mode.  By
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





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

* [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32.
  2024-01-02  7:27 ` [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32 Efraim Flashner
@ 2024-01-03  8:43   ` Mathieu Othacehe
  2024-01-03  8:53     ` Efraim Flashner
  0 siblings, 1 reply; 12+ messages in thread
From: Mathieu Othacehe @ 2024-01-03  8:43 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 68202


Hello Efraim,

> +      ;; On some architectures 'struct sigcontext' gets redefined from
> +      ;; %linux-libre-headers/include/asm/sigcontext.h
> +      ,@(cond ((target-mips64el?)
> +               `(#:phases (modify-phases %standard-phases
> +                            (add-before 'configure 'patch-mips-old-h
> +                              (lambda _
> +                                (substitute* "src/fault-linux-mips-old.h"
> +                                  (("#include <asm/sigcontext\\.h>") "")))))))
> +              ((target-x32?)
> +               `(#:phases (modify-phases %standard-phases
> +                            (add-before 'configure 'patch-linux-x86_64-old-h
> +                              (lambda _
> +                                (substitute* "src/fault-linux-x86_64-old.h"
> +                                  (("#include <asm/sigcontext\\.h>") "")))))))
> +              (else '()))))
>     (description
>      "GNU libsigsegv is a library to handle page faults, which occur when a
>  program tries to access an unavailable region of memory, in user mode.  By

#67859 is doing more or less the same thing, but for x86_64 as a
whole. Could you maybe replace `target-x32` by `target-x86`?

Maybe we should come up with a list of architectures that need that kind
of fix in libsigsegv and patch all the src/fault-linux-xxx-old-h?

The rest of the series seems fine to me.

Thanks,

Mathieu




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

* [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32.
  2024-01-03  8:43   ` Mathieu Othacehe
@ 2024-01-03  8:53     ` Efraim Flashner
  0 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-03  8:53 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 68202

[-- Attachment #1: Type: text/plain, Size: 2183 bytes --]

On Wed, Jan 03, 2024 at 09:43:32AM +0100, Mathieu Othacehe wrote:
> 
> Hello Efraim,
> 
> > +      ;; On some architectures 'struct sigcontext' gets redefined from
> > +      ;; %linux-libre-headers/include/asm/sigcontext.h
> > +      ,@(cond ((target-mips64el?)
> > +               `(#:phases (modify-phases %standard-phases
> > +                            (add-before 'configure 'patch-mips-old-h
> > +                              (lambda _
> > +                                (substitute* "src/fault-linux-mips-old.h"
> > +                                  (("#include <asm/sigcontext\\.h>") "")))))))
> > +              ((target-x32?)
> > +               `(#:phases (modify-phases %standard-phases
> > +                            (add-before 'configure 'patch-linux-x86_64-old-h
> > +                              (lambda _
> > +                                (substitute* "src/fault-linux-x86_64-old.h"
> > +                                  (("#include <asm/sigcontext\\.h>") "")))))))
> > +              (else '()))))
> >     (description
> >      "GNU libsigsegv is a library to handle page faults, which occur when a
> >  program tries to access an unavailable region of memory, in user mode.  By
> 
> #67859 is doing more or less the same thing, but for x86_64 as a
> whole. Could you maybe replace `target-x32` by `target-x86`?
> 
> Maybe we should come up with a list of architectures that need that kind
> of fix in libsigsegv and patch all the src/fault-linux-xxx-old-h?

I don't have a mips machine hooked up so I can't test if its needed
natively. I did check debian's packaging of libsigsegv and they don't
have anything like this for any architecture.  It wouldn't be hard to
change it to (if (%current-target-system)
                ... (substitute* (find-files "src" "fault.*-old\\.h$")
which would hit every instance of this include

> The rest of the series seems fine to me.
> 
> Thanks,
> 
> Mathieu

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* bug#68202: [PATCH 0/5] Add support for x86_64-linux-gnux32
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
                   ` (4 preceding siblings ...)
  2024-01-02  7:27 ` [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32 Efraim Flashner
@ 2024-01-05 11:22 ` Efraim Flashner
  2024-01-08 17:14 ` [bug#68202] " Ludovic Courtès
  6 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-05 11:22 UTC (permalink / raw)
  To: 68202-done

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Patches pushed, with the change to libsigsegv to patch on all
cross-builds.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#68202] [PATCH 2/5] gnu: Add target-x32?.
  2024-01-02  7:27 ` [bug#68202] [PATCH 2/5] gnu: Add target-x32? Efraim Flashner
@ 2024-01-08  9:20   ` Simon Tournier
  2024-01-08 10:05     ` Efraim Flashner
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Tournier @ 2024-01-08  9:20 UTC (permalink / raw)
  To: Efraim Flashner
  Cc: 68202, Josselin Poiret, Mathieu Othacehe, Ludovic Courtès,
	Tobias Geerinckx-Rice, Ricardo Wurmus, Christopher Baines

Hi,

On Tue, 2 Jan 2024 at 08:29, Efraim Flashner <efraim@flashner.co.il> wrote:

> +(define* (target-x32? #:optional (target (or (%current-target-system)
> +                                             (%current-system))))
> +  "Is the architecture of TARGET a variant of Intel/AMD's 64-bit
> +architecture (x86_64) using 32-bit data types?"
> +  (and (target-x86-64? target)
> +       (string-suffix? "gnux32" target)))
> +
>  (define* (target-x86? #:optional (target (or (%current-target-system)
>                                               (%current-system))))
>    (or (target-x86-32? target) (target-x86-64? target)))

Why not add it to target-x86-32? ?

Cheers,
simon




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

* [bug#68202] [PATCH 2/5] gnu: Add target-x32?.
  2024-01-08  9:20   ` Simon Tournier
@ 2024-01-08 10:05     ` Efraim Flashner
  0 siblings, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2024-01-08 10:05 UTC (permalink / raw)
  To: Simon Tournier
  Cc: 68202, Josselin Poiret, Mathieu Othacehe, Ludovic Courtès,
	Tobias Geerinckx-Rice, Ricardo Wurmus, Christopher Baines

[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]

On Mon, Jan 08, 2024 at 10:20:36AM +0100, Simon Tournier wrote:
> Hi,
> 
> On Tue, 2 Jan 2024 at 08:29, Efraim Flashner <efraim@flashner.co.il> wrote:
> 
> > +(define* (target-x32? #:optional (target (or (%current-target-system)
> > +                                             (%current-system))))
> > +  "Is the architecture of TARGET a variant of Intel/AMD's 64-bit
> > +architecture (x86_64) using 32-bit data types?"
> > +  (and (target-x86-64? target)
> > +       (string-suffix? "gnux32" target)))
> > +
> >  (define* (target-x86? #:optional (target (or (%current-target-system)
> >                                               (%current-system))))
> >    (or (target-x86-32? target) (target-x86-64? target)))
> 
> Why not add it to target-x86-32? ?

It won't run on 32-bit only systems.

The preprocessor macro test is __x86_64__ and __ILP32__

I wasn't exactly sure where to put it, but ld.so --help gave the output
with the glibc-hwcaps optimization paths exactly like x86_64-linux and
pretty much every other piece of software which needed adjusting for it
stressed that it was x86_64.

There's a #debian-x32 channel on libera.chat, they might have some
suggestions about tagging it as 32-bit or 64-bit.  As-is it's currently
labeled as 64-bit.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32
  2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
                   ` (5 preceding siblings ...)
  2024-01-05 11:22 ` bug#68202: [PATCH 0/5] Add support " Efraim Flashner
@ 2024-01-08 17:14 ` Ludovic Courtès
  6 siblings, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2024-01-08 17:14 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 68202

Hi,

Efraim Flashner <efraim@flashner.co.il> skribis:

> I was reminded recently about a comment I made back in February 2017
> about getting guix support for x32, aka x86_64-linux-gnux32, aka
> x86_64-linux but with 32-bit data structures.  The idea was that by
> using 32-bit pointers there'd be a not insignificant speed-up of code
> execution¹.  I am uncertain how true this is, or which packages would
> really benefit from this.

Interesting!

I’m not sure why this target hasn’t been picked up by ci.guix.  (gnu ci)
calls ‘targets’, which returns it.  Weird.

> ¹ https://en.wikipedia.org/wiki/X32_ABI

It’s not clear how long support for this ABI will live on in the
toolchain…

Cheers,
Ludo’.




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

end of thread, other threads:[~2024-01-08 17:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02  7:26 [bug#68202] [PATCH 0/5] Add support for x86_64-linux-gnux32 Efraim Flashner
2024-01-02  7:27 ` [bug#68202] [PATCH 1/5] gnu: " Efraim Flashner
2024-01-02  7:27 ` [bug#68202] [PATCH 2/5] gnu: Add target-x32? Efraim Flashner
2024-01-08  9:20   ` Simon Tournier
2024-01-08 10:05     ` Efraim Flashner
2024-01-02  7:27 ` [bug#68202] [PATCH 3/5] gnu: openssl: Fix building on x86_64-linux-gnux32 Efraim Flashner
2024-01-02  7:27 ` [bug#68202] [PATCH 4/5] gnu: gmp: " Efraim Flashner
2024-01-02  7:27 ` [bug#68202] [PATCH 5/5] gnu: libsigsegv: Fix building for x86_64-linux-gnux32 Efraim Flashner
2024-01-03  8:43   ` Mathieu Othacehe
2024-01-03  8:53     ` Efraim Flashner
2024-01-05 11:22 ` bug#68202: [PATCH 0/5] Add support " Efraim Flashner
2024-01-08 17:14 ` [bug#68202] " Ludovic Courtès

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).