From 7ca78a46c54b649304c4a470a8059457b9bca9fd Mon Sep 17 00:00:00 2001 From: SoftwareRat <40393784+SoftwareRat@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:32:57 +0200 Subject: [PATCH 1/3] Patch pthread_t issue for modern toolchains Added a patch for pthread_t issue in testThreads.c. --- scripts/012-libxml2-2.7.8.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/012-libxml2-2.7.8.sh b/scripts/012-libxml2-2.7.8.sh index c59dbb7..ed11902 100755 --- a/scripts/012-libxml2-2.7.8.sh +++ b/scripts/012-libxml2-2.7.8.sh @@ -19,6 +19,10 @@ echo "Unpacking ${LIBXML2}" extract ../archives/${LIBXML2}.tar.gz cd ${LIBXML2} +## Patch pthread_t issue for modern toolchains +echo "Patching testThreads.c..." +patch -p1 < ../../patches/${LIBXML2}-pthread.patch + ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . From 4824a0b88c2a153e016ed7826f56a9a79a5ffb0f Mon Sep 17 00:00:00 2001 From: SoftwareRat <40393784+SoftwareRat@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:33:38 +0200 Subject: [PATCH 2/3] Fix pthread tid initialization in libxml2 patch Replaced initialization of tid array with memset to ensure proper memory clearing. --- patches/libxml2-2.7.8-pthread.patch | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 patches/libxml2-2.7.8-pthread.patch diff --git a/patches/libxml2-2.7.8-pthread.patch b/patches/libxml2-2.7.8-pthread.patch new file mode 100644 index 0000000..66d29dc --- /dev/null +++ b/patches/libxml2-2.7.8-pthread.patch @@ -0,0 +1,9 @@ +@@ -107,7 +107,7 @@ + #if defined(HAVE_PTHREAD_H) && !defined(_WIN32) + for (i = 0; i < num_threads; i++) { + results[i] = NULL; +- tid[i] = (pthread_t) -1; ++ memset(&tid[i], 0, sizeof(pthread_t)); + } + #endif + for (i = 0; i < num_threads; i++) { From 283c8f71da1f920281f23aa3604c3dc87c043f54 Mon Sep 17 00:00:00 2001 From: SoftwareRat <40393784+SoftwareRat@users.noreply.github.com> Date: Sun, 16 Aug 2026 15:45:40 +0200 Subject: [PATCH 3/3] Fix pthread tid initialization in libxml2 patch --- patches/libxml2-2.7.8-pthread.patch | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/patches/libxml2-2.7.8-pthread.patch b/patches/libxml2-2.7.8-pthread.patch index 66d29dc..8b7b238 100644 --- a/patches/libxml2-2.7.8-pthread.patch +++ b/patches/libxml2-2.7.8-pthread.patch @@ -1,9 +1,12 @@ -@@ -107,7 +107,7 @@ - #if defined(HAVE_PTHREAD_H) && !defined(_WIN32) - for (i = 0; i < num_threads; i++) { - results[i] = NULL; -- tid[i] = (pthread_t) -1; -+ memset(&tid[i], 0, sizeof(pthread_t)); - } - #endif - for (i = 0; i < num_threads; i++) { +diff --git a/testThreads.c b/testThreads.c +index b43cbd0..5c12894 100644 +--- a/testThreads.c ++++ b/testThreads.c +@@ -107,7 +107,6 @@ main(void) + + for (i = 0; i < num_threads; i++) { + results[i] = NULL; +- tid[i] = (pthread_t) -1; + } + + for (i = 0; i < num_threads; i++) {