guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] branch main updated: build: When cross-compiling, get ty


From: Ludovic Courtès
Subject: [Guile-commits] branch main updated: build: When cross-compiling, get type sizes of the target system.
Date: Mon, 28 Feb 2022 18:41:39 -0500

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch main
in repository guile.

The following commit(s) were added to refs/heads/main by this push:
     new 24b30130c build: When cross-compiling, get type sizes of the target 
system.
24b30130c is described below

commit 24b30130ca75653bdbacea84ce0443608379d630
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Feb 28 22:57:52 2022 +0100

    build: When cross-compiling, get type sizes of the target system.
    
    Fixes <https://issues.guix.gnu.org/54198>.
    
    As noted in the comment at the top, 'SIZEOF_TYPE' must be used instead
    of 'sizeof (TYPE)' to support cross-compilation.
    
    The regression was introduced in
    5e5afde06fd9dd0992294d6c7dc9f9966c0caa37 but only became apparent with
    717e787da6ae75bbaa53139c0ef3791cd758a9d8.
    
    * libguile/gen-scmconfig.c (main): Replace uses of 'sizeof' by
    references to the SIZEOF_* macros.
    * configure.ac: Add 'AC_CHECK_SIZEOF' call for 'intmax_t'.
---
 configure.ac             |  1 +
 libguile/gen-scmconfig.c | 32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 827e1c09d..ad7ff12c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -357,6 +357,7 @@ AC_CHECK_SIZEOF(uintptr_t)
 AC_CHECK_SIZEOF(ptrdiff_t)
 AC_CHECK_SIZEOF(size_t)
 AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(intmax_t)
 
 if test "$ac_cv_sizeof_long" -gt "$ac_cv_sizeof_void_p"; then
   AC_MSG_ERROR(long does not fit into a void*)
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", 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");



reply via email to

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