[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/05: gnu: guile@3.0.8: Get correct type sizes when cross-compiling.
From: |
guix-commits |
Subject: |
01/05: gnu: guile@3.0.8: Get correct type sizes when cross-compiling. |
Date: |
Tue, 1 Mar 2022 06:34:52 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit e9b7adde0ddc8489e63d843a8bd8b76dc6bd6ead
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Mar 1 10:23:13 2022 +0100
gnu: guile@3.0.8: Get correct type sizes when cross-compiling.
This works around <https://issues.guix.gnu.org/54198>, whereby
cross-compilation from (say) x86_64-linux to i586-pc-gnu would produce a
broken Guile that crashes at startup.
* gnu/packages/patches/guile-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/guile.scm (guile-3.0-latest)[source]: Use it.
---
gnu/local.mk | 1 +
gnu/packages/guile.scm | 3 +-
gnu/packages/patches/guile-cross-compilation.patch | 55 ++++++++++++++++++++++
3 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index bc214b3443..cfcbb38b84 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1228,6 +1228,7 @@ dist_patch_DATA =
\
%D%/packages/patches/guile-3.0-relocatable.patch \
%D%/packages/patches/guile-linux-syscalls.patch \
%D%/packages/patches/guile-3.0-linux-syscalls.patch \
+ %D%/packages/patches/guile-cross-compilation.patch \
%D%/packages/patches/guile-fibers-destroy-peer-schedulers.patch \
%D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \
%D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index f74a389da5..fc969f3bb5 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -398,7 +398,8 @@ without requiring the source code to be rewritten.")
version ".tar.xz"))
(sha256
(base32
- "04wagg0zr0sib0w9ly5jm91jplgfigzfgmy8fjdlx07jaq50d9ys"))))
+ "04wagg0zr0sib0w9ly5jm91jplgfigzfgmy8fjdlx07jaq50d9ys"))
+ (patches (search-patches "guile-cross-compilation.patch"))))
(arguments
(substitute-keyword-arguments (package-arguments guile-3.0)
;; Guile 3.0.8 is bit-reproducible when built in parallel, thanks to
diff --git a/gnu/packages/patches/guile-cross-compilation.patch
b/gnu/packages/patches/guile-cross-compilation.patch
new file mode 100644
index 0000000000..a594cb9421
--- /dev/null
+++ b/gnu/packages/patches/guile-cross-compilation.patch
@@ -0,0 +1,55 @@
+When cross-compiling, get type sizes of the host system, not the build system.
+
+This is Guile commit 24b30130ca75653bdbacea84ce0443608379d630, which
+fixes <https://issues.guix.gnu.org/54198>, with one difference: it uses
+8 instead of SIZEOF_INTMAX_T, such that we do not need to modify
+'configure.ac' to check for the size of 'intmax_t' and to run 'autoreconf'
+(libguile/numbers.c expects SCM_SIZEOF_INTMAX_T = 8).
+
+diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
+index 01b14f14d..691ebd0af 100644
+--- a/libguile/gen-scmconfig.c
++++ b/libguile/gen-scmconfig.c
+@@ -1,4 +1,4 @@
+-/* Copyright 2003-2013,2018,2020,2021
++/* Copyright 2003-2013, 2018, 2020-2022
+ Free Software Foundation, Inc.
+
+ This file is part of Guile.
+@@ -238,21 +238,21 @@ main (int argc, char *argv[])
+ pf ("\n");
+ pf ("/* Standard types. */\n");
+
+- pf ("#define SCM_SIZEOF_CHAR %zu\n", sizeof (char));
+- pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %zu\n", sizeof (unsigned char));
+- pf ("#define SCM_SIZEOF_SHORT %zu\n", sizeof (short));
+- pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %zu\n", sizeof (unsigned short));
+- pf ("#define SCM_SIZEOF_LONG %zu\n", sizeof (long));
+- pf ("#define SCM_SIZEOF_UNSIGNED_LONG %zu\n", sizeof (unsigned long));
+- pf ("#define SCM_SIZEOF_INT %zu\n", sizeof (int));
+- pf ("#define SCM_SIZEOF_UNSIGNED_INT %zu\n", sizeof (unsigned int));
+- pf ("#define SCM_SIZEOF_SIZE_T %zu\n", sizeof (size_t));
+- pf ("#define SCM_SIZEOF_LONG_LONG %zu\n", sizeof (long long));
+- pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %zu\n", sizeof (unsigned long
long));
+- pf ("#define SCM_SIZEOF_INTMAX %zu\n", sizeof (intmax_t));
+- pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %zu\n", sizeof (ptrdiff_t));
+- pf ("#define SCM_SIZEOF_INTPTR_T %zu\n", sizeof (intptr_t));
+- pf ("#define SCM_SIZEOF_UINTPTR_T %zu\n", sizeof (uintptr_t));
++ pf ("#define SCM_SIZEOF_CHAR %d\n", SIZEOF_CHAR);
++ pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %d\n", SIZEOF_UNSIGNED_CHAR);
++ pf ("#define SCM_SIZEOF_SHORT %d\n", SIZEOF_SHORT);
++ pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %d\n", SIZEOF_UNSIGNED_SHORT);
++ pf ("#define SCM_SIZEOF_LONG %d\n", SIZEOF_LONG);
++ pf ("#define SCM_SIZEOF_UNSIGNED_LONG %d\n", SIZEOF_UNSIGNED_LONG);
++ pf ("#define SCM_SIZEOF_INT %d\n", SIZEOF_INT);
++ pf ("#define SCM_SIZEOF_UNSIGNED_INT %d\n", SIZEOF_UNSIGNED_INT);
++ pf ("#define SCM_SIZEOF_SIZE_T %d\n", SIZEOF_SIZE_T);
++ pf ("#define SCM_SIZEOF_LONG_LONG %d\n", SIZEOF_LONG_LONG);
++ pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %d\n",
SIZEOF_UNSIGNED_LONG_LONG);
++ pf ("#define SCM_SIZEOF_INTMAX %d\n", 8); /* like SIZEOF_INTMAX_T */
++ pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %d\n", SIZEOF_PTRDIFF_T);
++ pf ("#define SCM_SIZEOF_INTPTR_T %d\n", SIZEOF_INTPTR_T);
++ pf ("#define SCM_SIZEOF_UINTPTR_T %d\n", SIZEOF_UINTPTR_T);
+
+ pf ("\n");
+ pf ("/* same as POSIX \"struct timespec\" -- always defined */\n");