unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Sevan Janiyan <venture37@geeklan.co.uk>
To: 41467@debbugs.gnu.org
Subject: bug#41467: Compiling extensions using Guile 3.0.2 headers doesn't work with clang without -std=c11
Date: Tue, 1 Aug 2023 12:11:28 +0100	[thread overview]
Message-ID: <b032a1ad-a2af-190e-da03-a69e9d15d542@geeklan.co.uk> (raw)
In-Reply-To: <ca4a9ed0-3cd9-026c-c7f8-36451cbf8569@geeklan.co.uk>

On 01/08/2023 02:38, Sevan Janiyan wrote:
> There's more issues after addressing these. I will follow up with a 
> patch of what I took out for the build to succeed (not necessarily 
> correct but to highlight where the issues are).

Here's the changes related to redefinitions I made in order to be able 
to mostly compile Guile 3.0.9 with GCC 4.0.1 on PowerPC Mac OS X 10.4. I 
say mostly as I'm not sure if there are further redefinition issues 
since I'm currently stuck with issues related to the supplied 
32-bit-big-endian image and regenerating it.

The MAX macro in socket.h conflicts with the MAX macro in the system 
header files.

diff -ur /tmp/guile-3.0.9/libguile/dynstack.h ./libguile/dynstack.h
--- /tmp/guile-3.0.9/libguile/dynstack.h	2018-09-22 21:51:40.000000000 +0100
+++ ./libguile/dynstack.h	2023-07-26 16:47:37.000000000 +0100
@@ -28,7 +28,7 @@
  #include "libguile/scm.h"



-
+#undef scm_t_dynstack;
  typedef struct scm_dynstack
  {
    scm_t_bits *base;
diff -ur /tmp/guile-3.0.9/libguile/foreign.h ./libguile/foreign.h
--- /tmp/guile-3.0.9/libguile/foreign.h	2022-01-10 16:58:37.000000000 +0000
+++ ./libguile/foreign.h	2023-07-26 17:33:42.000000000 +0100
@@ -22,6 +22,7 @@

  #include "libguile/gc.h"
  #include "libguile/snarf.h"
+#include "libguile/print.h"

  /* A "foreign pointer" is a wrapped C pointer.  It is represented by a
     cell whose second word is a pointer.  The first word has the
diff -ur /tmp/guile-3.0.9/libguile/pairs.h ./libguile/pairs.h
--- /tmp/guile-3.0.9/libguile/pairs.h	2018-09-22 21:51:40.000000000 +0100
+++ ./libguile/pairs.h	2023-07-26 17:30:00.000000000 +0100
@@ -200,6 +200,7 @@
  #endif

  #ifdef BUILDING_LIBGUILE
+/*
  #ifndef HAVE_GC_IS_HEAP_PTR
  static int
  GC_is_heap_ptr (void *ptr)
@@ -207,6 +208,7 @@
    return GC_base (ptr) != NULL;
  }
  #endif
+*/

  static inline int
  scm_is_mutable_pair (SCM x)
diff -ur /tmp/guile-3.0.9/libguile/programs.h ./libguile/programs.h
--- /tmp/guile-3.0.9/libguile/programs.h	2018-09-22 21:51:40.000000000 +0100
+++ ./libguile/programs.h	2023-07-26 17:32:06.000000000 +0100
@@ -21,6 +21,7 @@
  #define _SCM_PROGRAMS_H_

  #include <libguile/gc.h>
+#include <libguile/print.h>

  /*
   * Programs
diff -ur /tmp/guile-3.0.9/libguile/scm.h ./libguile/scm.h
--- /tmp/guile-3.0.9/libguile/scm.h	2020-05-27 21:48:00.000000000 +0100
+++ ./libguile/scm.h	2023-07-26 16:48:30.000000000 +0100
@@ -821,8 +821,8 @@
  #endif

  typedef struct scm_dynamic_state scm_t_dynamic_state;
-typedef struct scm_print_state scm_print_state;
-typedef struct scm_dynstack scm_t_dynstack;
+/* typedef struct scm_print_state scm_print_state;
+typedef struct scm_dynstack scm_t_dynstack; */
  typedef int32_t scm_t_wchar;
  struct scm_frame;
  struct scm_vm;
diff -ur /tmp/guile-3.0.9/libguile/socket.c ./libguile/socket.c
--- /tmp/guile-3.0.9/libguile/socket.c	2022-10-21 16:39:38.000000000 +0100
+++ ./libguile/socket.c	2023-07-26 17:14:20.000000000 +0100
@@ -774,7 +774,7 @@
     proc is the name of the original procedure.
     size returns the size of the structure allocated.  */

-#define MAX(A, B) ((A) >= (B) ? (A) : (B))
+#define AMAX(A, B) ((A) >= (B) ? (A) : (B))

  static struct sockaddr *
  scm_fill_sockaddr (int fam, SCM address, SCM *args, int which_arg,
@@ -864,7 +864,7 @@
  	   connect/bind etc., to fail.  sun_path is always the last
  	   member of the structure.  */
  	addr_size = sizeof (struct sockaddr_un)
-	  + MAX (0, c_address_size + 1 - (sizeof soka->sun_path));
+	  + AMAX (0, c_address_size + 1 - (sizeof soka->sun_path));
  	soka = (struct sockaddr_un *) scm_malloc (addr_size);
  	memset (soka, 0, addr_size);
  	soka->sun_family = AF_UNIX;
diff -ur /tmp/guile-3.0.9/libguile/strings.h ./libguile/strings.h
--- /tmp/guile-3.0.9/libguile/strings.h	2022-02-04 10:15:39.000000000 +0000
+++ ./libguile/strings.h	2023-07-26 17:43:11.000000000 +0100
@@ -26,6 +26,7 @@
  #include <libguile/error.h>
  #include "libguile/inline.h"
  #include <libguile/snarf.h>
+#include <libguile/print.h>




diff -ur /tmp/guile-3.0.9/libguile/threads.h ./libguile/threads.h
--- /tmp/guile-3.0.9/libguile/threads.h	2020-02-08 14:11:34.000000000 +0000
+++ ./libguile/threads.h	2023-07-26 16:41:30.000000000 +0100
@@ -28,6 +28,7 @@
  #include "libguile/iselect.h"
  #include "libguile/smob.h"
  #include "libguile/vm.h"
+#include "libguile/scm.h"

  #if SCM_USE_PTHREAD_THREADS
  #include "libguile/pthread-threads.h"
diff -ur /tmp/guile-3.0.9/libguile/vm.h ./libguile/vm.h
--- /tmp/guile-3.0.9/libguile/vm.h	2019-12-14 17:28:57.000000000 +0000
+++ ./libguile/vm.h	2023-07-26 17:36:53.000000000 +0100
@@ -24,6 +24,7 @@

  #include <libguile/gc.h>
  #include <libguile/programs.h>
+#include <libguile/dynstack.h>

  #define SCM_VM_REGULAR_ENGINE 0
  #define SCM_VM_DEBUG_ENGINE 1
diff -ur /tmp/guile-3.0.9/libguile/weak-set.c ./libguile/weak-set.c
--- /tmp/guile-3.0.9/libguile/weak-set.c	2020-03-27 11:33:32.000000000 +0000
+++ ./libguile/weak-set.c	2023-07-26 17:46:25.000000000 +0100
@@ -165,6 +165,7 @@
      return size - origin + k;
  }

+/*
  #ifndef HAVE_GC_MOVE_DISAPPEARING_LINK
  static void
  GC_move_disappearing_link (void **from, void **to)
@@ -173,6 +174,7 @@
    SCM_I_REGISTER_DISAPPEARING_LINK (to, *to);
  }
  #endif
+*/

  static void
  move_weak_entry (scm_t_weak_entry *from, scm_t_weak_entry *to)






  reply	other threads:[~2023-08-01 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 20:42 bug#41467: Compiling extensions using Guile 3.0.2 headers doesn't work with clang without -std=c11 Vadim Zeitlin
2023-08-01  1:38 ` Sevan Janiyan
2023-08-01 11:11   ` Sevan Janiyan [this message]
2023-08-01 11:22     ` Sevan Janiyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b032a1ad-a2af-190e-da03-a69e9d15d542@geeklan.co.uk \
    --to=venture37@geeklan.co.uk \
    --cc=41467@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).