[packages/pth] Rel 8. Fix build with autoconf 2.72 and GCC 14+

arekm arekm at pld-linux.org
Tue Dec 1 15:15:51 CET 2026


commit 13fbcf938cac9f8f4a0a50d0d74f5c7e1cb45131
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Dec 1 15:14:53 2026 +0100

    Rel 8. Fix build with autoconf 2.72 and GCC 14+

 pth-autoconf.patch        | 16 ++++++++++++++++
 pth-configure-tests.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 pth-test-exit.patch       | 15 +++++++++++++++
 pth.spec                  | 16 +++++++++++-----
 4 files changed, 83 insertions(+), 5 deletions(-)
---
diff --git a/pth.spec b/pth.spec
index 62f197a..616672c 100644
--- a/pth.spec
+++ b/pth.spec
@@ -7,14 +7,17 @@ Summary:	The GNU portable threads
 Summary(pl.UTF-8):	Przenośne wątki GNU
 Name:		pth
 Version:	2.0.7
-Release:	7
+Release:	8
 Epoch:		1
 License:	LGPL
 Group:		Libraries
-Source0:	http://ftp.gnu.org/gnu/pth/%{name}-%{version}.tar.gz
+Source0:	https://ftp.gnu.org/gnu/pth/%{name}-%{version}.tar.gz
 # Source0-md5:	9cb4a25331a4c4db866a31cbe507c793
 Patch0:		%{name}-nolibs.patch
-URL:		http://www.gnu.org/software/pth/
+Patch1:		%{name}-autoconf.patch
+Patch2:		%{name}-configure-tests.patch
+Patch3:		%{name}-test-exit.patch
+URL:		https://www.gnu.org/software/pth/
 BuildRequires:	autoconf >= 2.52
 BuildRequires:	automake
 BuildRequires:	libtool
@@ -68,8 +71,11 @@ Statyczna wersja biblioteki przenośnych wątków GNU.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
 # no aclocal call: aclocal.m4 contains only local macros, libtool.m4 is included from configure.in
-cp -f /usr/share/automake/config.* /usr/share/aclocal/libtool.m4 .
+cp -f /usr/share/automake/config.* %{_aclocaldir}/libtool.m4 .
 mv aclocal.m4 local.m4
 
 %build
@@ -101,7 +107,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 # COPYING contains not only LGPL text
 %doc ANNOUNCE AUTHORS COPYING ChangeLog HISTORY NEWS README SUPPORT TESTS THANKS USERS
-%attr(755,root,root) %{_libdir}/libpth.so.*.*.*
+%{_libdir}/libpth.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libpth.so.20
 
 %files devel
diff --git a/pth-autoconf.patch b/pth-autoconf.patch
new file mode 100644
index 0000000..720139e
--- /dev/null
+++ b/pth-autoconf.patch
@@ -0,0 +1,16 @@
+AC_CHECK_STACKSETUP closes its "if" after the AC_CACHE_VAL body; autoconf
+2.72 wraps that body in "case", and configure dies with a syntax error.
+
+diff -urNp pth-2.0.7.orig/aclocal.m4 pth-2.0.7/aclocal.m4
+--- pth-2.0.7.orig/aclocal.m4	2006-06-08 19:54:01.000000000 +0200
++++ pth-2.0.7/aclocal.m4	2026-12-01 15:10:47.435611371 +0100
+@@ -1609,8 +1609,8 @@ ac_cv_stacksetup_$1='guessed:(skaddr),(s
+ ])
+ dnl #   restore original compile environment
+ CFLAGS="$OCFLAGS"
+-])dnl
+ fi
++])dnl
+ dnl #   extract result ingredients of single cached result value
+ type=`echo $ac_cv_stacksetup_$1 | sed -e 's;:.*$;;'`
+ addr=`echo $ac_cv_stacksetup_$1 | sed -e 's;^.*:;;' -e 's;,.*$;;'`
diff --git a/pth-configure-tests.patch b/pth-configure-tests.patch
new file mode 100644
index 0000000..40b5f99
--- /dev/null
+++ b/pth-configure-tests.patch
@@ -0,0 +1,41 @@
+configure test programs fail to compile with GCC 14+ (implicit exit/memset,
+makecontext() function pointer type), so the checks silently fall back:
+PTH_NSIG drops from 65 to 32 and the mcsc context switching is rejected.
+
+diff -urNp pth-2.0.7.orig/aclocal.m4 pth-2.0.7/aclocal.m4
+--- pth-2.0.7.orig/aclocal.m4	2026-12-01 15:10:47.435611371 +0100
++++ pth-2.0.7/aclocal.m4	2026-12-01 15:10:47.572688635 +0100
+@@ -978,6 +978,8 @@ changequote(<<, >>)dnl
+ #endif
+ 
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <setjmp.h>
+@@ -1134,6 +1136,7 @@ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ 
+@@ -1182,6 +1185,7 @@ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ int main(int argc, char *argv[])
+@@ -1388,7 +1392,7 @@ int main(int argc, char *argv[])
+     uc_child.uc_stack.ss_sp = (char *)stack+(32*1024);
+     uc_child.uc_stack.ss_size = 32*1024;
+     uc_child.uc_stack.ss_flags = 0;
+-    makecontext(&uc_child, child, 2, (void *)12345);
++    makecontext(&uc_child, (void (*)(void))child, 2, (void *)12345);
+ 
+     /* switch into the user context */
+     if (swapcontext(&uc_main, &uc_child) != 0)
diff --git a/pth-test-exit.patch b/pth-test-exit.patch
new file mode 100644
index 0000000..6887ed7
--- /dev/null
+++ b/pth-test-exit.patch
@@ -0,0 +1,15 @@
+"make test" ignored a failing test_std. From Debian:
+https://sources.debian.org/src/pth/2.0.7-22/debian/patches/04-exit_on_failed_test.patch/
+
+diff -urNp pth-2.0.7.orig/Makefile.in pth-2.0.7/Makefile.in
+--- pth-2.0.7.orig/Makefile.in	2006-06-08 19:54:01.000000000 +0200
++++ pth-2.0.7/Makefile.in	2026-12-01 15:10:54.684737537 +0100
+@@ -340,7 +340,7 @@ what-next:
+ #   execute and debug one of the test programs
+ test: test-std
+ test-std: test_std
+-	- at ./test_std; \
++	@./test_std; \
+ 	if [ $$? -eq 0 ]; then \
+ 	    touch .done-test >/dev/null 2>&1 || $(TRUE); \
+ 	    if [ ".`grep $(PLATFORM) $(S)PORTING`" = . ]; then \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pth.git/commitdiff/13fbcf938cac9f8f4a0a50d0d74f5c7e1cb45131



More information about the pld-cvs-commit mailing list