From 7bf88cd6af4e5b715efc2d1b87ea7ea7dbe96e7a Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 13 Jan 2025 14:31:13 -0700 Subject: [PATCH 1/7] Update to latest git snapshot - Move configuration steps to %conf --- clisp.spec | 12 +++++++++--- sources | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/clisp.spec b/clisp.spec index 3c6c2b8..ec637f5 100644 --- a/clisp.spec +++ b/clisp.spec @@ -1,7 +1,7 @@ # Upstream has not made a new release since 2010 %global srcname clisp -%global commit 9ff8aedb796fbf7c47e594bfc2357b69c8e64dc9 -%global date 20241123 +%global commit c3ec11bab87cfdbeba01523ed88ac2a16b22304d +%global date 20241228 %global forgeurl https://gitlab.com/gnu-clisp/clisp # There is a plus on the end for unreleased versions, not for released versions @@ -24,7 +24,7 @@ Version: 2.49.95 # - src/socket.d and modules/clx/mit-clx/doc.lisp are HPND # - src/xthread.d and modules/asdf/asdf.lisp are X11 License: GPL-2.0-or-later AND (GPL-2.0-or-later OR GFDL-1.2-or-later) AND LGPL-2.1-or-later AND HPND AND X11 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.clisp.org/ VCS: git:%{forgeurl}.git Source0: %{forgesource} @@ -126,6 +126,8 @@ Files necessary for linking CLISP programs. %ifarch %{power64} %autopatch 100 -p0 %endif + +%conf cp -p %{SOURCE1} emacs cp -p %{SOURCE2} %{SOURCE3} src/po @@ -439,6 +441,10 @@ make -C build base-mod-check %changelog +* Mon Jan 13 2025 Jerry James - 2.49.95-2 +- Update to latest git snapshot +- Move configuration steps to %%conf + * Mon Nov 25 2024 Jerry James - 2.49.95-1 - Version 2.49.95 - Drop upstreamed patches: db, c99, bdb-mismatched-pointer, new-clx, pari diff --git a/sources b/sources index c076005..56851c4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (clisp-9ff8aedb796fbf7c47e594bfc2357b69c8e64dc9.tar.bz2) = 7c29ab9c8f3aad9d7b5338d8f95610e85d3d8f6738ad7cfa4e07d105d2a1f15dcf14d72c72f4e6b87e6ccfd566e1d10d44d541420dedac507a544d7ed768052f +SHA512 (clisp-c3ec11bab87cfdbeba01523ed88ac2a16b22304d.tar.bz2) = f1f90de3eec144fd2d7bc9a3b482952c4c187f7ec590c41ce20447b4662961ae35290b260fa91d7399f9a4d1806ec7310ee90a77ead63a9d0f529a8627d2fa17 From 00ea9b0d97ac9958d1839e454c5fd3e611a1b1f2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 13:56:45 +0000 Subject: [PATCH 2/7] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- clisp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clisp.spec b/clisp.spec index ec637f5..6e3928a 100644 --- a/clisp.spec +++ b/clisp.spec @@ -24,7 +24,7 @@ Version: 2.49.95 # - src/socket.d and modules/clx/mit-clx/doc.lisp are HPND # - src/xthread.d and modules/asdf/asdf.lisp are X11 License: GPL-2.0-or-later AND (GPL-2.0-or-later OR GFDL-1.2-or-later) AND LGPL-2.1-or-later AND HPND AND X11 -Release: 2%{?dist} +Release: 3%{?dist} URL: http://www.clisp.org/ VCS: git:%{forgeurl}.git Source0: %{forgesource} @@ -441,6 +441,9 @@ make -C build base-mod-check %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 2.49.95-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Mon Jan 13 2025 Jerry James - 2.49.95-2 - Update to latest git snapshot - Move configuration steps to %%conf From 3f3e034be0633be06f08ba6afdeb53dbcf46fe33 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 7 Feb 2025 12:26:08 -0700 Subject: [PATCH 3/7] Add patch to fix undefined behavior (rhbz#2339979) - Add two patches to fix memory leaks - Do not force -O1 --- clisp-encoding-leak.patch | 10 ++++++++ clisp-iconv-close.patch | 38 ++++++++++++++++++++++++++++ clisp-undefined-behavior.patch | 46 ++++++++++++++++++++++++++++++++++ clisp.spec | 26 +++++++++++++++---- 4 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 clisp-encoding-leak.patch create mode 100644 clisp-iconv-close.patch create mode 100644 clisp-undefined-behavior.patch diff --git a/clisp-encoding-leak.patch b/clisp-encoding-leak.patch new file mode 100644 index 0000000..f2b939a --- /dev/null +++ b/clisp-encoding-leak.patch @@ -0,0 +1,10 @@ +--- src/encoding.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/encoding.d 2025-02-04 20:28:22.743346018 -0700 +@@ -2592,6 +2592,7 @@ local maygc object encoding_from_name (c + pushSTACK(STACK_0); + } + } ++ free(name); + #else + unused const_name; unused context; + pushSTACK(unbound); /* :charset */ diff --git a/clisp-iconv-close.patch b/clisp-iconv-close.patch new file mode 100644 index 0000000..db553ad --- /dev/null +++ b/clisp-iconv-close.patch @@ -0,0 +1,38 @@ +--- src/stream.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/stream.d 2025-02-07 11:47:28.448086694 -0700 +@@ -4239,6 +4239,9 @@ global uintL iconv_wcslen (object encodi + != (size_t)(-1)) { + inptr += sizeof(chart); insize -= sizeof(chart); + } else { ++ var int saved_errno = errno; ++ iconv_close(cd); ++ errno = saved_errno; + if (errno != EILSEQ) { + ANSIC_error(); + } else { +@@ -4247,6 +4250,7 @@ global uintL iconv_wcslen (object encodi + } + } + } else { ++ iconv_close(cd); + end_system_call(); + error_unencodable(encoding,*(const chart*)inptr); + } +@@ -4317,6 +4321,9 @@ global void iconv_wcstombs (object encod + if (iconv(cd,&inptr1,&insize1,&outptr,&outsize) != (size_t)(-1)) { + inptr += sizeof(chart); insize -= sizeof(chart); + } else { ++ var int saved_errno = errno; ++ iconv_close(cd); ++ errno = saved_errno; + if (errno != EILSEQ) { + ANSIC_error(); + } else { +@@ -4325,6 +4332,7 @@ global void iconv_wcstombs (object encod + } + } + } else { ++ iconv_close(cd); + end_system_call(); + error_unencodable(encoding,*(const chart*)inptr); + } diff --git a/clisp-undefined-behavior.patch b/clisp-undefined-behavior.patch new file mode 100644 index 0000000..309c8b2 --- /dev/null +++ b/clisp-undefined-behavior.patch @@ -0,0 +1,46 @@ +See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118779 + +--- src/package.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/package.d 2025-02-07 12:00:00.646094825 -0700 +@@ -188,12 +188,12 @@ local maygc object rehash_symtab (object + first process the symbols, that sit in lists + (maybe Conses become free): */ + { +- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */ ++ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */ + var uintC count = oldsize; + do { + var object oldentry = /* entry with number index in oldtable */ + *(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0], +- (aint)offset)); ++ offset)); + if (consp(oldentry)) /* this time process only non-empty symbol-lists */ + do { + pushSTACK(Cdr(oldentry)); /* save rest-list */ +@@ -205,22 +205,22 @@ local maygc object rehash_symtab (object + newinsert(Car(oldentry),newsize); + oldentry = popSTACK(); /* rest-list */ + } while (consp(oldentry)); +- offset++; ++ offset += sizeof(gcv_object_t); + } while (--count); + } + { /* then process symbols, that sit there collision-free: */ +- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */ ++ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */ + var uintC count; + dotimespC(count,oldsize, { + var object oldentry = /* entry with number index in oldtable */ + *(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0], +- (aint)offset)); ++ offset)); + if (!listp(oldentry)) { /* this time process only symbols /= NIL */ + pushSTACK(oldentry); /* dummy, so that the stack is fine */ + newinsert(oldentry,newsize); /* enter into the new table */ + skipSTACK(1); + } +- offset++; ++ offset += sizeof(gcv_object_t); + }); + } + /* stack layout: tab, oldtable, free-conses, newtable. */ diff --git a/clisp.spec b/clisp.spec index 6e3928a..73f38cb 100644 --- a/clisp.spec +++ b/clisp.spec @@ -44,6 +44,14 @@ Patch1: %{name}-register-volatile.patch Patch2: %{name}-pts-access.patch # Do not call the deprecated siginterrupt function Patch3: %{name}-siginterrupt.patch +# Fix an iconv leak in stream.d +Patch4: %{name}-iconv-close.patch +# Fix a memory leak in encoding.d +# https://gitlab.com/gnu-clisp/clisp/-/merge_requests/11 +Patch5: %{name}-encoding-leak.patch +# Fix undefined behavior in rehash_symtab +# https://gitlab.com/gnu-clisp/clisp/-/merge_requests/12 +Patch6: %{name}-undefined-behavior.patch # Work around a problem inlining a function on ppc64le # See https://bugzilla.redhat.com/show_bug.cgi?id=2049371 @@ -136,8 +144,11 @@ cp -p %{SOURCE2} %{SOURCE3} src/po cp -p src/build-aux/config.rpath config.rpath.orig sed -i -e 's/${wl}-rpath ${wl}/-L/g' src/build-aux/config.rpath -# Fix modules that need access to symbols in libgnu.a -sed -i 's/\(${GLLIB_A}\) \(${LIBS}\)/-Wl,--whole-archive \1 -Wl,--no-whole-archive \2 -ldl/' src/makemake.in +# Do not use -Werror, or we get build failures on every new gcc version +sed -i '/CFLAGS -Werror/d' modules/berkeley-db/configure + +# Do not override our choice of optimization flags +sed -i "/CFLAGS/s/'-O'/''/;/Z_XCFLAGS/s/' -O'//" src/makemake.in # When building modules, put -Wl,--as-needed before the libraries to link sed -i "s/CC='\${CC}'/CC='\${CC} -Wl,--as-needed'/" src/makemake.in @@ -185,9 +196,9 @@ sed -i 's/9090/9096/g' tests/socket.tst --with-ffcall \ --config \ build \ - CPPFLAGS="-I/usr/include/libsvm" \ - CFLAGS="%{build_cflags} -Wa,--noexecstack" \ - LDFLAGS="-Wl,--as-needed -Wl,-z,relro -Wl,-z,noexecstack" + CPPFLAGS='-I/usr/include/libsvm' \ + CFLAGS='%{build_cflags} -Wa,--noexecstack' \ + LDFLAGS='-Wl,--as-needed -Wl,-z,relro -Wl,-z,noexecstack' cd build # Workaround libtool reordering -Wl,--as-needed after all the libraries. @@ -441,6 +452,11 @@ make -C build base-mod-check %changelog +* Fri Feb 7 2025 Jerry James - 2.49.95-3 +- Add patch to fix undefined behavior (rhbz#2339979) +- Add two patches to fix memory leaks +- Do not force -O1 + * Thu Jan 16 2025 Fedora Release Engineering - 2.49.95-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 28d75acd55df9517747f47195717a06ef5053d49 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 14 Feb 2025 21:24:49 -0700 Subject: [PATCH 4/7] Add patches to fix more undefined behavior - Fix misaligned memory accesses on ppc64le - Fix mismatched readline function declarations --- clisp-ppc64le-alignment.patch | 18 +++++++ clisp-readline.patch | 75 +++++++++++++++++++++++++++++ clisp-undefined-behavior-eval.patch | 15 ++++++ clisp-undefined-behavior-io.patch | 15 ++++++ clisp-undefined-behavior-sort.patch | 23 +++++++++ clisp.spec | 20 +++++++- 6 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 clisp-ppc64le-alignment.patch create mode 100644 clisp-readline.patch create mode 100644 clisp-undefined-behavior-eval.patch create mode 100644 clisp-undefined-behavior-io.patch create mode 100644 clisp-undefined-behavior-sort.patch diff --git a/clisp-ppc64le-alignment.patch b/clisp-ppc64le-alignment.patch new file mode 100644 index 0000000..b186bb5 --- /dev/null +++ b/clisp-ppc64le-alignment.patch @@ -0,0 +1,18 @@ +Fixes UBSAN errors such as: + +../src/spvw_typealloc.d:146:450: runtime error: member access within misaligned address 0x17000000009c for type 'struct s8string_', which requires 8 byte alignment +0x17000000009c: note: pointer points here + 53 45 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + ^ + +--- src/lispbibl.d.orig 2025-02-07 19:25:44.207789666 -0700 ++++ src/lispbibl.d 2025-02-10 11:38:31.029348227 -0700 +@@ -6006,7 +6006,7 @@ typedef signed_int_with_n_bits(intVsize) + #if defined(I80386) || defined(POWERPC) || defined(ARM) || defined(S390) + #define varobject_alignment 4 + #endif +-#if defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(DECALPHA) || defined(IA64) || defined(AMD64) || defined(ARM64) || defined(RISCV64) || defined(LOONGARCH64) ++#if defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(DECALPHA) || defined(IA64) || defined(AMD64) || defined(ARM64) || defined(RISCV64) || defined(LOONGARCH64) || defined(POWERPC64) + #define varobject_alignment 8 + #endif + #if (!defined(TYPECODES) || defined(GENERATIONAL_GC)) && (varobject_alignment < 4) diff --git a/clisp-readline.patch b/clisp-readline.patch new file mode 100644 index 0000000..942e67c --- /dev/null +++ b/clisp-readline.patch @@ -0,0 +1,75 @@ +--- modules/readline/readline.lisp.orig 2024-12-28 00:47:59.000000000 -0700 ++++ modules/readline/readline.lisp 2025-02-10 15:17:06.296266455 -0700 +@@ -126,7 +126,7 @@ name in ~/.inputrc. This is preferred wa + (:documentation "Get keymap with given name (e.g., emacs, vi)") + (:arguments (name c-string)) (:return-type keymap)) + +-(def-call-out get-keymap-name (:name "rl_get_keymap_by_name") ; untested ++(def-call-out get-keymap-name (:name "rl_get_keymap_name") ; untested + (:arguments (keymap keymap)) (:return-type c-string)) + + ;;; Binding Keys +@@ -255,7 +255,7 @@ name in ~/.inputrc. This is preferred wa + ;;; Redisplay + + (def-call-out redisplay (:name "rl_redisplay") +- (:arguments) (:return-type int)) ++ (:arguments) (:return-type nil)) + + (def-call-out forced-update-display (:name "rl_forced_update_display") + (:arguments) (:return-type int)) +@@ -308,7 +308,7 @@ name in ~/.inputrc. This is preferred wa + + (def-call-out copy-text (:name "rl_copy_text") ; untested + (:arguments (start int) (end int)) +- (:return-type int)) ++ (:return-type c-string :malloc-free)) + + (def-call-out kill-text (:name "rl_kill_text") ; untested + (:arguments (start int) (end int)) +@@ -316,7 +316,7 @@ name in ~/.inputrc. This is preferred wa + + (def-call-out push-macro-input (:name "rl_push_macro_input") + (:arguments (macro c-string)) +- (:return-type int)) ++ (:return-type nil)) + + ;;; Character input + +@@ -362,7 +362,7 @@ name in ~/.inputrc. This is preferred wa + + (def-call-out extend-line-buffer (:name "rl_extend_line_buffer") ; untested + (:arguments (len int)) +- (:return-type int)) ++ (:return-type nil)) + + (def-call-out ding (:name "rl_ding") + (:arguments) (:return-type int)) +@@ -404,7 +404,7 @@ name in ~/.inputrc. This is preferred wa + (:return-type int)) + + (def-call-out clear-history (:name "rl_clear_history") ; untested +- (:arguments) (:return-type int)) ++ (:arguments) (:return-type nil)) + + (def-call-out get-termcap (:name "rl_get_termcap") ; untested + (:arguments (cap c-string)) +@@ -647,10 +647,16 @@ and the completion character will be ins + (:documentation "reading multiple-key command")) + (def-c-const state-vicmdonce (:name "RL_STATE_VICMDONCE") ; 0x400000 + (:documentation "entered vi command mode at least once")) +-(def-c-const state-redisplaying (:name "RL_STATE_REDISPLAYING") ; 0x800000 ++(def-c-const state-charsearch (:name "RL_STATE_CHARSEARCH") ; 0x800000 ++ (:documentation "vi mode char search")) ++(def-c-const state-redisplaying (:name "RL_STATE_REDISPLAYING") ; 0x1000000 + (:documentation "updating terminal display")) +-(def-c-const state-done (:name "RL_STATE_DONE") ; 0x1000000 ++(def-c-const state-done (:name "RL_STATE_DONE") ; 0x2000000 + (:documentation "done; accepted line")) ++(def-c-const state-timeout (:name "RL_STATE_TIMEOUT") ; 0x4000000 ++ (:documentation "done; timed out")) ++(def-c-const state-eof (:name "RL_STATE_EOF") ; 0x8000000 ++ (:documentation "done; got eof on read")) + + (def-c-const readerr ; (-2) + (:documentation " Input error; can be returned by (*rl_getc_function) diff --git a/clisp-undefined-behavior-eval.patch b/clisp-undefined-behavior-eval.patch new file mode 100644 index 0000000..2e6b8e0 --- /dev/null +++ b/clisp-undefined-behavior-eval.patch @@ -0,0 +1,15 @@ +Fixes this UBSAN error: + +../src/eval.d:5808:11: runtime error: variable length array bound evaluates to non-positive value 0 + +--- src/eval.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/eval.d 2025-02-10 09:39:02.285198247 -0700 +@@ -5805,7 +5805,7 @@ local /*maygc*/ Values interpret_bytecod + var uintL private_SP_length = + (uintL)(((Codevec)codeptr)->ccv_spdepth_1) + + jmpbufsize * (uintL)(((Codevec)codeptr)->ccv_spdepth_jmpbufsize); +- var DYNAMIC_ARRAY(private_SP_space,SPint,private_SP_length); ++ var DYNAMIC_ARRAY(private_SP_space,SPint,private_SP_length+1); + var SPint* private_SP = &private_SP_space[private_SP_length]; + #undef SP_ + #undef _SP_ diff --git a/clisp-undefined-behavior-io.patch b/clisp-undefined-behavior-io.patch new file mode 100644 index 0000000..7a9e72b --- /dev/null +++ b/clisp-undefined-behavior-io.patch @@ -0,0 +1,15 @@ +Fixes this UBSAN error: + +runtime error: variable length array bound evaluates to non-positive value 0 + +--- src/io.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/io.d 2025-02-10 09:50:29.262067759 -0700 +@@ -8158,7 +8158,7 @@ local maygc void pr_array (const gcv_obj + LEVEL_CHECK; + { /* determine rank and fetch dimensions and sub-product: */ + var uintL r = (uintL)Iarray_rank(obj); /* rank */ +- var DYNAMIC_ARRAY(dims_sizes,array_dim_size_t,r); /* dynamically allocated array */ ++ var DYNAMIC_ARRAY(dims_sizes,array_dim_size_t,r?r:1); /* dynamically allocated array */ + iarray_dims_sizes(obj,dims_sizes); /* fill */ + var uintL depth = r; /* depth of recursion */ + var pr_array_locals_t locals; /* local variables */ diff --git a/clisp-undefined-behavior-sort.patch b/clisp-undefined-behavior-sort.patch new file mode 100644 index 0000000..8408d13 --- /dev/null +++ b/clisp-undefined-behavior-sort.patch @@ -0,0 +1,23 @@ +Fixes this USBAN error: + +../src/sort.d:42:18: runtime error: applying non-zero offset 18446744073709551584 to null pointer + +--- src/sort.d.orig 2024-12-28 00:47:59.000000000 -0700 ++++ src/sort.d 2025-02-10 09:33:00.121016044 -0700 +@@ -39,7 +39,7 @@ + /* sort(v,n); sorts the array v[0]..v[n-1] in ascending order. */ + local void SORT(SORTID,sort) (SORT_ELEMENT* v, uintL n) + { +- var SORT_ELEMENT* w = &v[-1]; ++ var SORT_ELEMENT* w; + /* w[1]..w[n] point to the same elements as v[0]..v[n-1] . + We collect the numbers 1,...,n to a balanced binary subtree, + so that k has the children 2*k and 2*k+1. +@@ -70,6 +70,7 @@ local void SORT(SORTID,sort) (SORT_ELEME + } + if (n<=1) /* nothing to do? */ + return; ++ w = &v[-1]; + { /* Because of 2*(floor(n/2)+1) > n, + w[floor(n/2)+1]..w[n] is already sorted. */ + var uintL r; diff --git a/clisp.spec b/clisp.spec index 73f38cb..7a5d99b 100644 --- a/clisp.spec +++ b/clisp.spec @@ -45,13 +45,24 @@ Patch2: %{name}-pts-access.patch # Do not call the deprecated siginterrupt function Patch3: %{name}-siginterrupt.patch # Fix an iconv leak in stream.d -Patch4: %{name}-iconv-close.patch +Patch4: %{name}-iconv-close.patch # Fix a memory leak in encoding.d # https://gitlab.com/gnu-clisp/clisp/-/merge_requests/11 Patch5: %{name}-encoding-leak.patch # Fix undefined behavior in rehash_symtab # https://gitlab.com/gnu-clisp/clisp/-/merge_requests/12 -Patch6: %{name}-undefined-behavior.patch +Patch6: %{name}-undefined-behavior.patch +# Fix undefined behavior in SORT +Patch7: %{name}-undefined-behavior-sort.patch +# Fix undefined behavior in interpret_bytecode_ +Patch8: %{name}-undefined-behavior-eval.patch +# Fix undefined behavior in pr_array +Patch9: %{name}-undefined-behavior-io.patch +# Fix misaligned memory accesses on ppc64le +Patch10: %{name}-ppc64le-alignment.patch +# Fix some mismatched readline function declarations +# https://gitlab.com/gnu-clisp/clisp/-/merge_requests/13 +Patch11: %{name}-readline.patch # Work around a problem inlining a function on ppc64le # See https://bugzilla.redhat.com/show_bug.cgi?id=2049371 @@ -452,6 +463,11 @@ make -C build base-mod-check %changelog +* Fri Feb 14 2025 Jerry James - 2.49.95-3 +- Add patches to fix more undefined behavior +- Fix misaligned memory accesses on ppc64le +- Fix mismatched readline function declarations + * Fri Feb 7 2025 Jerry James - 2.49.95-3 - Add patch to fix undefined behavior (rhbz#2339979) - Add two patches to fix memory leaks From 2f58da3a26fc9de52fdf2509095edd528f0e43de Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 2 Jun 2025 11:01:50 -0600 Subject: [PATCH 5/7] Update to latest git snapshot - Drop one upstreamed patch to fix undefined behavior --- clisp-undefined-behavior.patch | 46 ---------------------------------- clisp.spec | 23 +++++++++-------- sources | 2 +- 3 files changed, 13 insertions(+), 58 deletions(-) delete mode 100644 clisp-undefined-behavior.patch diff --git a/clisp-undefined-behavior.patch b/clisp-undefined-behavior.patch deleted file mode 100644 index 309c8b2..0000000 --- a/clisp-undefined-behavior.patch +++ /dev/null @@ -1,46 +0,0 @@ -See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118779 - ---- src/package.d.orig 2024-12-28 00:47:59.000000000 -0700 -+++ src/package.d 2025-02-07 12:00:00.646094825 -0700 -@@ -188,12 +188,12 @@ local maygc object rehash_symtab (object - first process the symbols, that sit in lists - (maybe Conses become free): */ - { -- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */ -+ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */ - var uintC count = oldsize; - do { - var object oldentry = /* entry with number index in oldtable */ - *(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0], -- (aint)offset)); -+ offset)); - if (consp(oldentry)) /* this time process only non-empty symbol-lists */ - do { - pushSTACK(Cdr(oldentry)); /* save rest-list */ -@@ -205,22 +205,22 @@ local maygc object rehash_symtab (object - newinsert(Car(oldentry),newsize); - oldentry = popSTACK(); /* rest-list */ - } while (consp(oldentry)); -- offset++; -+ offset += sizeof(gcv_object_t); - } while (--count); - } - { /* then process symbols, that sit there collision-free: */ -- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */ -+ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */ - var uintC count; - dotimespC(count,oldsize, { - var object oldentry = /* entry with number index in oldtable */ - *(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0], -- (aint)offset)); -+ offset)); - if (!listp(oldentry)) { /* this time process only symbols /= NIL */ - pushSTACK(oldentry); /* dummy, so that the stack is fine */ - newinsert(oldentry,newsize); /* enter into the new table */ - skipSTACK(1); - } -- offset++; -+ offset += sizeof(gcv_object_t); - }); - } - /* stack layout: tab, oldtable, free-conses, newtable. */ diff --git a/clisp.spec b/clisp.spec index 7a5d99b..3f4aa0f 100644 --- a/clisp.spec +++ b/clisp.spec @@ -1,7 +1,7 @@ # Upstream has not made a new release since 2010 %global srcname clisp -%global commit c3ec11bab87cfdbeba01523ed88ac2a16b22304d -%global date 20241228 +%global commit f66220939ea7d36fd085384afa4a0ec44597d499 +%global date 20250504 %global forgeurl https://gitlab.com/gnu-clisp/clisp # There is a plus on the end for unreleased versions, not for released versions @@ -24,7 +24,7 @@ Version: 2.49.95 # - src/socket.d and modules/clx/mit-clx/doc.lisp are HPND # - src/xthread.d and modules/asdf/asdf.lisp are X11 License: GPL-2.0-or-later AND (GPL-2.0-or-later OR GFDL-1.2-or-later) AND LGPL-2.1-or-later AND HPND AND X11 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://www.clisp.org/ VCS: git:%{forgeurl}.git Source0: %{forgesource} @@ -49,20 +49,17 @@ Patch4: %{name}-iconv-close.patch # Fix a memory leak in encoding.d # https://gitlab.com/gnu-clisp/clisp/-/merge_requests/11 Patch5: %{name}-encoding-leak.patch -# Fix undefined behavior in rehash_symtab -# https://gitlab.com/gnu-clisp/clisp/-/merge_requests/12 -Patch6: %{name}-undefined-behavior.patch # Fix undefined behavior in SORT -Patch7: %{name}-undefined-behavior-sort.patch +Patch6: %{name}-undefined-behavior-sort.patch # Fix undefined behavior in interpret_bytecode_ -Patch8: %{name}-undefined-behavior-eval.patch +Patch7: %{name}-undefined-behavior-eval.patch # Fix undefined behavior in pr_array -Patch9: %{name}-undefined-behavior-io.patch +Patch8: %{name}-undefined-behavior-io.patch # Fix misaligned memory accesses on ppc64le -Patch10: %{name}-ppc64le-alignment.patch +Patch9: %{name}-ppc64le-alignment.patch # Fix some mismatched readline function declarations # https://gitlab.com/gnu-clisp/clisp/-/merge_requests/13 -Patch11: %{name}-readline.patch +Patch10: %{name}-readline.patch # Work around a problem inlining a function on ppc64le # See https://bugzilla.redhat.com/show_bug.cgi?id=2049371 @@ -463,6 +460,10 @@ make -C build base-mod-check %changelog +* Mon Jun 02 2025 Jerry James - 2.49.95-4 +- Update to latest git snapshot +- Drop one upstreamed patch to fix undefined behavior + * Fri Feb 14 2025 Jerry James - 2.49.95-3 - Add patches to fix more undefined behavior - Fix misaligned memory accesses on ppc64le diff --git a/sources b/sources index 56851c4..43b7795 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (clisp-c3ec11bab87cfdbeba01523ed88ac2a16b22304d.tar.bz2) = f1f90de3eec144fd2d7bc9a3b482952c4c187f7ec590c41ce20447b4662961ae35290b260fa91d7399f9a4d1806ec7310ee90a77ead63a9d0f529a8627d2fa17 +SHA512 (clisp-f66220939ea7d36fd085384afa4a0ec44597d499.tar.bz2) = 16d6ccba500d60fe36c20b5bd1d6c9403567996020cef406e42813a302a86d94dc0d5e36aae434b5b846d39ec37d6db2b50565a69d24291b973724bcc0874bd0 From f1acbe937138c482bbe580d0cec1fdc6a40d292f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 18:24:22 +0000 Subject: [PATCH 6/7] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- clisp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clisp.spec b/clisp.spec index 3f4aa0f..4dc6b9b 100644 --- a/clisp.spec +++ b/clisp.spec @@ -24,7 +24,7 @@ Version: 2.49.95 # - src/socket.d and modules/clx/mit-clx/doc.lisp are HPND # - src/xthread.d and modules/asdf/asdf.lisp are X11 License: GPL-2.0-or-later AND (GPL-2.0-or-later OR GFDL-1.2-or-later) AND LGPL-2.1-or-later AND HPND AND X11 -Release: 4%{?dist} +Release: 5%{?dist} URL: http://www.clisp.org/ VCS: git:%{forgeurl}.git Source0: %{forgesource} @@ -460,6 +460,9 @@ make -C build base-mod-check %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 2.49.95-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jun 02 2025 Jerry James - 2.49.95-4 - Update to latest git snapshot - Drop one upstreamed patch to fix undefined behavior From 24dca17a22105a25c185380e1c4af7a40d37b39f Mon Sep 17 00:00:00 2001 From: Jerry James Date: Sun, 11 Jan 2026 18:59:06 -0700 Subject: [PATCH 7/7] Reflow the description text - Minor spec file cleanups --- clisp.spec | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/clisp.spec b/clisp.spec index 4dc6b9b..94e352d 100644 --- a/clisp.spec +++ b/clisp.spec @@ -95,6 +95,7 @@ BuildRequires: pari-devel BuildRequires: pari-gp BuildRequires: libpq-devel BuildRequires: readline-devel +BuildRequires: vim-filesystem BuildRequires: zlib-devel Requires: emacs-filesystem @@ -105,25 +106,24 @@ Requires: vim-filesystem Provides: bundled(gnulib) %description -ANSI Common Lisp is a high-level, general-purpose programming -language. GNU CLISP is a Common Lisp implementation by Bruno Haible -of Karlsruhe University and Michael Stoll of Munich University, both -in Germany. It mostly supports the Lisp described in the ANSI Common -Lisp standard. It runs on most Unix workstations (GNU/Linux, FreeBSD, -NetBSD, OpenBSD, Solaris, Tru64, HP-UX, BeOS, NeXTstep, IRIX, AIX and -others) and on other systems (Windows NT/2000/XP, Windows 95/98/ME) -and needs only 4 MiB of RAM. +ANSI Common Lisp is a high-level, general-purpose programming language. GNU +CLISP is a Common Lisp implementation by Bruno Haible of Karlsruhe University +and Michael Stoll of Munich University, both in Germany. It mostly supports +the Lisp described in the ANSI Common Lisp standard. It runs on most Unix +workstations (GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Tru64, HP-UX, +BeOS, NeXTstep, IRIX, AIX and others) and on other systems (Windows NT/2000/XP, +Windows 95/98/ME) and needs only 4 MiB of RAM. -It is Free Software and may be distributed under the terms of GNU GPL, -while it is possible to distribute commercial proprietary applications -compiled with GNU CLISP. +It is Free Software and may be distributed under the terms of GNU GPL, while +it is possible to distribute commercial proprietary applications compiled with +GNU CLISP. -The user interface comes in English, German, French, Spanish, Dutch, -Russian and Danish, and can be changed at run time. GNU CLISP -includes an interpreter, a compiler, a debugger, CLOS, MOP, a foreign -language interface, sockets, i18n, fast bignums and more. An X11 -interface is available through CLX, Garnet, CLUE/CLIO. GNU CLISP runs -Maxima, ACL2 and many other Common Lisp packages. +The user interface comes in English, German, French, Spanish, Dutch, Russian +and Danish, and can be changed at run time. GNU CLISP includes an +interpreter, a compiler, a debugger, CLOS, MOP, a foreign language interface, +sockets, i18n, fast bignums and more. An X11 interface is available through +CLX, Garnet, CLUE/CLIO. GNU CLISP runs Maxima, ACL2 and many other Common +Lisp packages. %package devel @@ -229,7 +229,7 @@ find %{buildroot}%{_libdir} -name '*.dvi' -exec rm -f {} \+ cat %{name}low.lang >> %{name}.lang # Compile the Emacs interface -pushd %{buildroot}%{_datadir}/emacs/site-lisp +pushd %{buildroot}%{_emacs_sitelispdir} %{_emacs_bytecompile} *.el popd @@ -362,8 +362,8 @@ make -C build base-mod-check %{_libdir}/%{instdir}/rawsock/preload.lisp %dir %{_libdir}/%{instdir}/zlib/ %{_libdir}/%{instdir}/zlib/*.fas -%{_datadir}/emacs/site-lisp/* -%{_datadir}/vim/vimfiles/after/syntax/* +%{_emacs_sitelispdir}/* +%{vimfiles_root}/after/syntax/* %files devel %doc modules/clx/clx-manual @@ -463,7 +463,7 @@ make -C build base-mod-check * Wed Jul 23 2025 Fedora Release Engineering - 2.49.95-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Mon Jun 02 2025 Jerry James - 2.49.95-4 +* Mon Jun 02 2025 Jerry James - 2.49.95-4 - Update to latest git snapshot - Drop one upstreamed patch to fix undefined behavior