From a877f9a70d648f12b6433f6f94ad2389faf90b40 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Dec 01 2023 18:18:53 +0000 Subject: Fix potential GCC 14 errors Other changes: - Support Emacs 29 - Stop building for 32-bit x86 --- diff --git a/bigloo-configure-c99.patch b/bigloo-configure-c99.patch index 175091c..a0a8a75 100644 --- a/bigloo-configure-c99.patch +++ b/bigloo-configure-c99.patch @@ -4,6 +4,48 @@ Date: Tue Nov 22 08:56:51 2022 -0700 Migrate K&R C in the config scripts to ANSI C +--- api/libbacktrace/src/Clib/bglbacktrace.c.orig 2022-12-29 23:55:22.000000000 -0700 ++++ api/libbacktrace/src/Clib/bglbacktrace.c 2023-12-01 10:05:41.064729924 -0700 +@@ -191,7 +191,6 @@ bgl_backtrace_foreach(void *proc) { + if (env) { + struct backtrace_state *bt_state = libbacktrace_get_state(env); + backtrace_full(bt_state, 0, backtrace_foreach_cb, cbe, proc); +- return BUNSPEC; + } + } + +--- api/ssl/src/C/bglssl.c.orig 2022-12-29 23:55:22.000000000 -0700 ++++ api/ssl/src/C/bglssl.c 2023-12-01 09:51:44.236639443 -0700 +@@ -52,6 +52,11 @@ + # include + #endif + ++// Avoid GCC 14 errors ++extern int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); ++extern void HMAC_CTX_init(HMAC_CTX *ctx); ++extern void HMAC_CTX_cleanup(HMAC_CTX *ctx); ++ + #if( !defined( OPENSSL_NPN_UNSUPPORTED ) ) + # define OPENSSL_NPN_UNSUPPORTED 0 + #endif +@@ -1743,7 +1748,7 @@ bgl_ssl_connection_clear_pending( ssl_co + /* bgl_get_session_callback ... */ + /*---------------------------------------------------------------------*/ + static SSL_SESSION * +-bgl_get_session_callback( SSL *ssl, unsigned char *key, int len, int *copy ) { ++bgl_get_session_callback( SSL *ssl, const unsigned char *key, int len, int *copy ) { + ssl_connection c = (ssl_connection)(SSL_get_app_data( ssl )); + SSL_SESSION *sess = CCON( c )->BgL_z42nextzd2sessionz90; + +@@ -2310,7 +2315,7 @@ bgl_ssl_connection_get_peer_certificate( + } + + STACK_OF(ASN1_OBJECT) *eku = +- (ASN1_OBJECT *)X509_get_ext_d2i( peer_cert, NID_ext_key_usage, NULL, NULL ); ++ (STACK_OF(ASN1_OBJECT) *)X509_get_ext_d2i( peer_cert, NID_ext_key_usage, NULL, NULL ); + if( eku != NULL ) { + char buf[ 256 ]; + int len = sk_ASN1_OBJECT_num( eku ); diff --git autoconf/alsa autoconf/alsa index 028a1979..3d354afb 100755 --- autoconf/alsa @@ -157,6 +199,17 @@ index 2ba133ca..ec8469c0 100755 { exit( 0 ); } +--- autoconf/openssl-getter.orig ++++ autoconf/openssl-getter +@@ -73,7 +73,7 @@ int main( int argc, char *argv[] ) { + DH *dh; + const BIGNUM *key; + DH_get0_key( dh, &key, 0 ); +- return SSL_CTX_get_ssl_method( ctx ); ++ return (SSL_CTX_get_ssl_method( ctx ) == NULL) ? 1 : 0; + } + EOF + diff --git autoconf/openssl-tls13 autoconf/openssl-tls13 index 0981d682..c3a781ea 100755 --- autoconf/openssl-tls13 @@ -305,3 +358,54 @@ index 02cc1893..bd7af72d 100755 { exit( 0 ); } +--- gc/gc-8.2.2.patch.orig 2022-12-29 23:55:22.000000000 -0700 ++++ gc/gc-8.2.2.patch 2023-11-30 15:36:16.039764489 -0700 +@@ -189,3 +189,48 @@ diff -Naur gc-8.2.2.orig/Makefile.in gc- + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backgraph.Plo@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blacklst.Plo@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksums.Plo@am__quote@ # am--include-marker ++diff -Naur gc-8.2.2.orig/configure.ac gc-8.2.2/configure.ac ++--- gc-8.2.2.orig/configure.ac 2022-08-26 12:44:49.000000000 -0600 +++++ gc-8.2.2/configure.ac 2023-11-30 15:32:49.187695181 -0700 ++@@ -833,13 +833,15 @@ ++ AS_IF([test "$THREADS" = posix], ++ [AC_MSG_CHECKING(for pthread_setname_np) ++ old_CFLAGS="$CFLAGS" ++- CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror" ++- AC_TRY_COMPILE([#include ], +++ CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror -pthread" +++ AC_TRY_COMPILE([#define _GNU_SOURCE +++ #include ], ++ [pthread_setname_np("thread-name")], ++ [AC_MSG_RESULT([yes (w/o tid)]) ++ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID], [1], ++ [Define to use 'pthread_setname_np(const char*)' function.])], ++- [AC_TRY_COMPILE([#include ], +++ [AC_TRY_COMPILE([#define _GNU_SOURCE +++ #include ], ++ [pthread_setname_np(pthread_self(), "thread-name-%u", 0)], ++ [AC_MSG_RESULT([yes (with tid and arg)]) ++ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG], [1], ++diff -Naur gc-8.2.2.orig/configure.ac gc-8.2.2/configure.ac ++--- gc-8.2.2.orig/configure 2022-08-26 12:45:05.000000000 -0600 +++++ gc-8.2.2/configure 2023-11-30 15:34:02.851651485 -0700 ++@@ -17565,9 +17565,10 @@ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np" >&5 ++ $as_echo_n "checking for pthread_setname_np... " >&6; } ++ old_CFLAGS="$CFLAGS" ++- CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror" +++ CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror -pthread" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ +++#define _GNU_SOURCE ++ #include ++ int ++ main () ++@@ -17586,6 +17587,7 @@ ++ else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ +++#define _GNU_SOURCE ++ #include ++ int ++ main () diff --git a/bigloo-emacs29.patch b/bigloo-emacs29.patch new file mode 100644 index 0000000..422f05a --- /dev/null +++ b/bigloo-emacs29.patch @@ -0,0 +1,40 @@ +--- autoconf/emacsbrand.orig 2022-12-29 23:55:22.000000000 -0700 ++++ autoconf/emacsbrand 2023-12-01 10:31:24.531044114 -0700 +@@ -35,6 +35,7 @@ done + #* The autodetection ELisp expression */ + #*---------------------------------------------------------------------*/ + expr="(cond \ ++ ((string-match \"GNU Emacs 29\" (emacs-version)) (kill-emacs 29)) \ + ((string-match \"GNU Emacs 28\" (emacs-version)) (kill-emacs 28)) \ + ((string-match \"GNU Emacs 27\" (emacs-version)) (kill-emacs 27)) \ + ((string-match \"GNU Emacs 26\" (emacs-version)) (kill-emacs 26)) \ +@@ -78,6 +79,10 @@ else + else + if [ "$version" = "28" ]; then + echo "emacs28" ++ else ++ if [ "$version" = "29" ]; then ++ echo "emacs29" ++ fi + fi + fi + fi +--- bmacs/Makefile.orig 2022-12-29 23:55:22.000000000 -0700 ++++ bmacs/Makefile 2023-12-01 10:32:09.803412470 -0700 +@@ -116,7 +116,7 @@ POPULATION = Makefile README $(EMACS_SOU + #*---------------------------------------------------------------------*/ + all: $(EMACSBRAND) + +-emacs22 emacs23 emacs24 emacs25 emacs26 emacs27 emacs28: ++emacs22 emacs23 emacs24 emacs25 emacs26 emacs27 emacs28 emacs29: + (expr=load-path; \ + for p in . $(LOADPATH); do \ + expr="(cons \"../$$p\" (cons \"$$p\" $$expr))"; \ +@@ -184,6 +184,7 @@ install.emacs25: doinstall + install.emacs26: doinstall + install.emacs27: doinstall + install.emacs28: doinstall ++install.emacs29: doinstall + install.xemacs: doinstall + + install.generic: diff --git a/bigloo.spec b/bigloo.spec index 7e2abf9..90f6ab0 100644 --- a/bigloo.spec +++ b/bigloo.spec @@ -27,7 +27,7 @@ Name: bigloo Version: 4.5a -Release: 3%{?patch_ver:.%{patch_ver}}%{?prerel:.%{prerel}}%{?dist} +Release: 4%{?patch_ver:.%{patch_ver}}%{?prerel:.%{prerel}}%{?dist} Summary: A compiler for the Scheme programming language # The compiler and tools are GPL-2.0-or-later. @@ -63,10 +63,14 @@ Patch8: %{name}-return.patch # Fix signal numbers in the Java code Patch9: %{name}-java-signum.patch # Migrate K&R C in the config scripts to ANSI C +# https://github.com/manuel-serrano/bigloo/pull/104 Patch10: %{name}-configure-c99.patch +# Support Emacs 29 +Patch11: %{name}-emacs29.patch # See https://bugzilla.redhat.com/show_bug.cgi?id=2160579 -ExcludeArch: ppc64le +# See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: ppc64le %{ix86} BuildRequires: emacs BuildRequires: gcc @@ -365,6 +369,11 @@ fi %changelog +* Fri Dec 1 2023 Jerry James - 4.5a-4.1 +- Fix potential GCC 14 errors +- Support Emacs 29 +- Stop building for 32-bit x86 + * Wed Jul 19 2023 Fedora Release Engineering - 4.5a-3.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild