From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sevan Janiyan Newsgroups: gmane.lisp.guile.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33733"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 41467@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Aug 01 13:12:31 2023 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qQnIk-0008YF-Uk for guile-bugs@m.gmane-mx.org; Tue, 01 Aug 2023 13:12:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQnIW-0005fs-9V; Tue, 01 Aug 2023 07:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQnIK-0005aP-RN for bug-guile@gnu.org; Tue, 01 Aug 2023 07:12:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQnII-0002c6-I6 for bug-guile@gnu.org; Tue, 01 Aug 2023 07:12:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQnIH-0004FC-Um for bug-guile@gnu.org; Tue, 01 Aug 2023 07:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sevan Janiyan Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 01 Aug 2023 11:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41467 X-GNU-PR-Package: guile Original-Received: via spool by 41467-submit@debbugs.gnu.org id=B41467.169088829916285 (code B ref 41467); Tue, 01 Aug 2023 11:12:01 +0000 Original-Received: (at 41467) by debbugs.gnu.org; 1 Aug 2023 11:11:39 +0000 Original-Received: from localhost ([127.0.0.1]:47240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQnHu-0004Eb-OA for submit@debbugs.gnu.org; Tue, 01 Aug 2023 07:11:39 -0400 Original-Received: from host2.hosts.geeklan.co.uk ([2001:470:1f13:8c2::1]:13238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQnHt-0004EN-0e for 41467@debbugs.gnu.org; Tue, 01 Aug 2023 07:11:37 -0400 Original-Received: from host2.hosts.geeklan.co.uk (localhost [127.0.0.1]) by host2.hosts.geeklan.co.uk (OpenSMTPD) with ESMTP id aabfa581 for <41467@debbugs.gnu.org>; Tue, 1 Aug 2023 12:11:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=geeklan.co.uk; h= message-id:date:mime-version:subject:from:to:references :in-reply-to:content-type:content-transfer-encoding; s=geeklan; bh=DsXBzN48s+yECc4mf9kD0gGjjTA=; b=tRz+BU983FOdxTWw/gGkdGMoahip O8mhz3kms5cBC3S0kFPB640c34k+ChfJottKTrLI8naC38uixVDHgu2DTvqpnhQo nilptHCNnNiFx66/6P9sSdUJy591LDoJFbgqt10GBm6IcmvTGTOunJdOjvSXMYlF miJYSuZaSAqfIi3S+INaImmbZXTTXoxI45TKRiJVZhDLftNPYopWyW8jeibvvsOM bCWk0Z8rEtDIJFTrnqQghbDk4QKaMjJ9BQS6aVrI25Odqv25pa20xAZtkkKdWFZb ASF5Br7t/s5JE45hIHTUZuDRpuMml8QXk5Z4ftnsvYkkf5qWxK7vcUdIhg== DomainKey-Signature: a=rsa-sha1; c=nofws; d=geeklan.co.uk; h=message-id :date:mime-version:subject:from:to:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=geeklan; b=TiK 8c0oNQd0eeEgbkQkNtI10TmAtClnBGrsbdRZPShBrBd8wegC302GuDJ2hliVqTzc 0PJvlZAyBlc11hI2aKc7lIo1C9iLF4gqLMcyLJOn8IOXSDNo2yTbk0wsBi0e6Qx8 TzcYGbWObCls251DhgRqy3p7KPhJlU8BVKpiLk83xmjhAWC4JutwI5jQDHNT05sV m64+ovzxbjoDUDd9AiicNPnfGIH+2fusrSwrNHqh0cxLB1IEMLaSIt9IYK16oyTo WpKLWUamtCmd2+gMKTxLe1YxWBqh69jnNtpUqp/TilQINkiFgDoZUAIVSj1dNHYM PMNcJ+cWGOy1zFhl2Jg== Original-Received: by host2.hosts.geeklan.co.uk (OpenSMTPD) with ESMTPSA id b5ad94ca (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <41467@debbugs.gnu.org>; Tue, 1 Aug 2023 12:11:28 +0100 (BST) Content-Language: en-GB Autocrypt: addr=venture37@geeklan.co.uk; keydata= xsFNBFV6/hIBEADFfMfQEOJZZuIsrwq4USHbFSfbafwnGfcz67Q0wHI8lVlPkgcPFLMrH/6w lre2qt8DDpNxofLC912PBlrxYdvDsW5GzCc/icmQY6qlA/Km4K+55X3QpewB81quZXBo+uQn +GYJxCdvE8VSSYP1I2aTTSjsN7Y3p87lkpYZSn8WSG/DsGlZjwRN0rIT66jyfmYBQ51zkMk3 i6/pf5KNHJ6xDbZZvC7yG4CLMYbFwsxERlPT7RUHZFvEelOxmfSM3qp+PqnMhX2+oAYD0mjg Mtx3ZqmXzLKNdybr5QCs34TkKNXP644pxttPGs40eKMr70FAsGDEizCcG4yB7bH+YbGKgDP6 O8o74ikG2I6n6se0LILc/QU1CG7X/4/OfcF5eFJvnfv/5AeMy+vFSRHKhh/cUPAydGNc8IRA aXHO9uYWbGhxD0nODYzjhRwyjWyijxk3d1MOv+xg4RFAC+tm6/npZXFDKxKI1+c6u/bz8ViF 3HFXrwiEtNojatNWJryCHPpHmTQ93JHBGaFsYkyeNOIwx0tpGZpqJjhcDxlUjlWfGXx2+ubN kUUh8ZAbsiYIlyppiKW0vawJn+SjEZ8JnGb07a48WRY5wVK5yZAzA31c8YQki1S+7xqbKyl2 dn+PX3QT/eUO2GNoyWOciqLg8DIJ/6ZA7KlX6tCBoaQldlDmTwARAQABzSdTZXZhbiBKYW5p eWFuIDx2ZW50dXJlMzdAZ2Vla2xhbi5jby51az7CwZkEEwEIAEMCGwMHCwkIBwMCAQYVCAIJ CgsEFgIDAQIeAQIXgAIZARYhBJcIMbgJ6/f In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10646 Archived-At: 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 +#include /* * 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 #include "libguile/inline.h" #include +#include 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 #include +#include #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)