diff -ur slackware64-current.2/source/a/aaa_base/aaa_base.SlackBuild slackware64-current.3/source/a/aaa_base/aaa_base.SlackBuild
--- slackware64-current.2/source/a/aaa_base/aaa_base.SlackBuild	2021-07-17 19:46:57.879947846 +0200
+++ slackware64-current.3/source/a/aaa_base/aaa_base.SlackBuild	2021-09-18 13:42:52.406871391 +0200
@@ -79,9 +79,14 @@
   echo "VERSION_CODENAME=stable" >> $PKG/etc/os-release
 fi
 
-# Add lib64 directories on x86_64:
-if [ "$ARCH" = "x86_64" ]; then
-  mkdir -p $PKG/lib64 $PKG/usr/lib64 $PKG/usr/local/lib64
+# Add lib64 directories on x86_64 and aarch64:
+if [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
+  LIBDIRSUFFIX="64"
+else
+  LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
+fi
+if [ "$LIBDIRSUFFIX" != "" ]; then
+  mkdir -p $PKG/lib$LIBDIRSUFFIX $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/local/lib$LIBDIRSUFFIX
 fi
 
 # Build the package:
diff -ur slackware64-current.2/source/a/bcachefs-tools/bcachefs-tools.SlackBuild slackware64-current.3/source/a/bcachefs-tools/bcachefs-tools.SlackBuild
--- slackware64-current.2/source/a/bcachefs-tools/bcachefs-tools.SlackBuild	2024-12-04 19:59:20.007907516 +0100
+++ slackware64-current.3/source/a/bcachefs-tools/bcachefs-tools.SlackBuild	2025-05-12 20:02:25.948997972 +0200
@@ -65,10 +65,21 @@
 rm -rf $PKG
 mkdir -p $TMP $PKG
 
+C_ONLY=${C_ONLY:-0}
+which rustc
+if [ $? -ne 0 ] ; then
+  C_ONLY=1
+fi
+
 cd $TMP
-rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.zst || exit 1
-cd $PKGNAM-$VERSION || exit 1
+rm -rf $PKGNAM-*$VERSION
+if [ $C_ONLY -eq 0 ] ; then
+  tar xvf $CWD/$SRCNAM-$VERSION.tar.zst || exit 1
+else
+  tar xvf $CWD/c_only/$PKGNAM-*$VERSION.tar.*z* || exit 1
+fi
+cd $PKGNAM-*$VERSION || exit 1
+ 
 
 chown -R root:root .
 find . \
@@ -80,6 +90,11 @@
   cat $CWD/packed_aligned_breaks_32-bit.diff | patch -p1 --verbose || exit 1
 fi
 
+if [ "$SLKLDFLAGS" != "" ]
+then
+  export LDFLAGS="$SLKLDFLAGS"
+fi
+
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
   make $NUMJOBS \
@@ -99,9 +110,13 @@
 
 # Install completions:
 mkdir -p $PKG/usr/share/bash-completion/completions
-$PKG/sbin/bcachefs completions bash > $PKG/usr/share/bash-completion/completions/bcachefs
-mkdir -p $PKG/usr/share/zsh/site-functions
-$PKG/sbin/bcachefs completions zsh > $PKG/usr/share/zsh/site-functions/_bcachefs
+if [ $C_ONLY -eq 0 ]; then
+  $PKG/sbin/bcachefs completions bash > $PKG/usr/share/bash-completion/completions/bcachefs
+  mkdir -p $PKG/usr/share/zsh/site-functions
+  $PKG/sbin/bcachefs completions zsh > $PKG/usr/share/zsh/site-functions/_bcachefs
+else
+  (cd $PKG/usr/share; tar xvf $CWD/completion.tar.gz)
+fi
 
 # Strip binaries:
 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
diff -ur slackware64-current.2/source/a/cpufrequtils/cpufrequtils.SlackBuild slackware64-current.3/source/a/cpufrequtils/cpufrequtils.SlackBuild
--- slackware64-current.2/source/a/cpufrequtils/cpufrequtils.SlackBuild	2021-02-13 06:31:50.074945733 +0100
+++ slackware64-current.3/source/a/cpufrequtils/cpufrequtils.SlackBuild	2021-09-18 13:42:52.486875429 +0200
@@ -76,6 +76,8 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+zcat $CWD/0001-Only-x86-has-cpuid-instruction.patch.gz | patch -p1
+
 # Build and install:
 make libdir=/usr/lib${LIBDIRSUFFIX} || exit 1
 make install libdir=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/a/efivar/efivar.SlackBuild slackware64-current.3/source/a/efivar/efivar.SlackBuild
--- slackware64-current.2/source/a/efivar/efivar.SlackBuild	2021-03-13 20:11:05.646092497 +0100
+++ slackware64-current.3/source/a/efivar/efivar.SlackBuild	2021-09-18 13:42:52.646883505 +0200
@@ -78,6 +78,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Patch native march
+zcat $CWD/host_march.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/a/elogind/elogind.SlackBuild slackware64-current.3/source/a/elogind/elogind.SlackBuild
--- slackware64-current.2/source/a/elogind/elogind.SlackBuild	2021-09-15 21:42:41.116049529 +0200
+++ slackware64-current.3/source/a/elogind/elogind.SlackBuild	2021-09-18 13:42:52.716887039 +0200
@@ -79,6 +79,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Add new architectures (OpenRISC, LoongARCH, etc.)
+zcat $CWD/openrisc-loongarch.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/a/etc/etc.SlackBuild slackware64-current.3/source/a/etc/etc.SlackBuild
--- slackware64-current.2/source/a/etc/etc.SlackBuild	2021-09-15 21:42:41.116049529 +0200
+++ slackware64-current.3/source/a/etc/etc.SlackBuild	2021-09-18 13:42:52.716887039 +0200
@@ -55,8 +55,14 @@
 # Fix for ARCH:
 sed -i -e "s#/i586-slackware-linux#/${ARCH}-slackware-linux#" etc/ld.so.conf.new
 # Fix paths if lib64 is needed:
-if [ "$ARCH" = "x86_64" ]; then
-  sed -i -e "s#/lib#/lib64#" etc/ld.so.conf.new
+if [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
+  LIBDIRSUFFIX="64"
+else
+  LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
+fi
+
+if [ "$LIBDIRSUFFIX" != "" ]; then
+  sed -i -e "s#/lib#/lib${LIBDIRSUFFIX}#" etc/ld.so.conf.new
 fi
 cat $CWD/nsswitch.conf > $PKG/etc/nsswitch.conf.new
 
diff -ur slackware64-current.2/source/a/gettext/gettext.SlackBuild slackware64-current.3/source/a/gettext/gettext.SlackBuild
--- slackware64-current.2/source/a/gettext/gettext.SlackBuild	2025-02-28 06:43:45.617025164 +0100
+++ slackware64-current.3/source/a/gettext/gettext.SlackBuild	2025-05-18 21:10:41.439987652 +0200
@@ -66,6 +66,15 @@
 # Don't use icecream:
 PATH=$(echo $PATH | sed "s|/usr/libexec/icecc/bin||g" | tr -s : | sed "s/^://g" | sed "s/:$//g")
 
+if [ "${ARCH::3}" = "ppc" ]
+then
+  # Some architectures do not have a fully working d compiler:
+  # - armv7hl: "d21: error: cannot find source code for runtime library file 'object.d'" (problem with time64 access/birth/modify)
+  # - ppc*: gnu/libintl/libintl.d:35:8: error: unable to read module 'conv'
+  #         gnu/libintl/libintl.d:35:8: note: Expected 'std/conv.d' or 'std/conv/package.d' 
+  EXTRACONF="--disable-d"
+fi
+
 rm -rf $PKG
 mkdir -p $TMP $PKG
 cd $TMP
@@ -94,6 +103,7 @@
   --mandir=/usr/man \
   --docdir=/usr/doc/gettext-$VERSION \
   --disable-static \
+  $EXTRACONF \
   --build=$ARCH-slackware-linux || exit 1
 make $NUMJOBS || make || exit 1
 make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/a/grub/grub.SlackBuild slackware64-current.3/source/a/grub/grub.SlackBuild
--- slackware64-current.2/source/a/grub/grub.SlackBuild	2021-09-15 21:42:41.116049529 +0200
+++ slackware64-current.3/source/a/grub/grub.SlackBuild	2021-09-18 13:42:52.716887039 +0200
@@ -91,11 +91,25 @@
 rm -rf $PKG
 mkdir -p $TMP $PKG
 
+if [ "$ARCH" = "mips64el" ]
+then
+  # Preinstall unifont, needed for loongson
+  mkdir /usr/share/fonts/unifont
+  mkdir -p $PKG/usr/share/fonts/unifont
+  cp -p $CWD/unifont-*.pcf.gz /usr/share/fonts/unifont/unifont.pcf.gz
+  cp -p $CWD/unifont-*.pcf.gz $PKG/usr/share/fonts/unifont/unifont.pcf.gz
+fi
+
 cd $TMP
 rm -rf $PKGNAM-$VERSION
 tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix missing non-mandatory fence.i instruction in riscv64:
+zcat $CWD/riscv64_fence.i_not_implemented.diff.gz | patch -p1 --verbose || exit 1
+# Fix missing arichitectures for plthook_elf.c:
+zcat $CWD/jump_slot_new_archs.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/a/haveged/haveged.SlackBuild slackware64-current.3/source/a/haveged/haveged.SlackBuild
--- slackware64-current.2/source/a/haveged/haveged.SlackBuild	2021-10-02 08:48:59.022671049 -0000
+++ slackware64-current.3/source/a/haveged/haveged.SlackBuild	2023-06-16 16:57:35.763314459 -0000
@@ -68,6 +68,10 @@
 rm -rf $PKGNAM-$VERSION
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
+
+# Disable v9 assembler code for sparc 32-bit:
+zcat $CWD/disable_sparcv9_asm.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find -L . \
  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
diff -ur slackware64-current.2/source/a/kbd/kbd.SlackBuild slackware64-current.3/source/a/kbd/kbd.SlackBuild
--- slackware64-current.2/source/a/kbd/kbd.SlackBuild	2025-09-23 18:48:48.767860182 +0200
+++ slackware64-current.3/source/a/kbd/kbd.SlackBuild	2025-09-23 18:57:48.913938865 +0200
@@ -70,6 +70,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix time64 on 32 bit machines for kbdfile-zlib:
+sed -i -e 's/\(#include.*config.h\)/#define _DONOTFORCE_TIME_BITS\n\n\1/' src/libkbdfile/kbdfile-zlib.c
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current.2/source/a/lrzip/lrzip.SlackBuild slackware64-current.3/source/a/lrzip/lrzip.SlackBuild
--- slackware64-current.2/source/a/lrzip/lrzip.SlackBuild	2021-02-17 20:23:56.793004089 +0100
+++ slackware64-current.3/source/a/lrzip/lrzip.SlackBuild	2025-02-28 13:10:23.559170370 +0100
@@ -46,10 +46,14 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+ASM="--enable-asm=no" # Disable assembly code by default
+
 if [ "$ARCH" = "i686" ]; then
+  ASM="" # Enable assembly for x86
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
+  ASM="" # Enable assembly for x86
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   LIBDIRSUFFIX="64"
 else
@@ -85,6 +89,7 @@
   --mandir=/usr/man \
   --docdir=/usr/doc/$PKGNAM-$VERSION \
   --disable-static \
+  $ASM \
   --build=$ARCH-slackware-linux || exit 1
 
 make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/a/pkgtools/pkgtools.SlackBuild slackware64-current.3/source/a/pkgtools/pkgtools.SlackBuild
--- slackware64-current.2/source/a/pkgtools/pkgtools.SlackBuild.orig	2024-10-08 20:19:27.185871331 +0200
+++ slackware64-current.3/source/a/pkgtools/pkgtools.SlackBuild	2024-10-09 15:15:34.908009722 +0200
@@ -20,6 +20,7 @@
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 # Set initial variables:
+PARCH="noarch"
 cd $(dirname $0) ; CWD=$(pwd)
 if [ "$TMP" = "" ]; then
   TMP=/tmp
@@ -36,7 +37,7 @@
 # the name of the created package would be, and then exit. This information
 # could be useful to other scripts.
 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
-  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+  echo "$PKGNAM-$VERSION-$PARCH-$BUILD.txz"
   exit 0
 fi
 
@@ -89,6 +90,21 @@
   chmod 755 $PKG/var/lib/pkgtools/setup/setup.*
   # Add a link for makebootstick:
   ( cd $PKG/sbin ; ln -sf ../var/lib/pkgtools/setup/setup.80.make-bootdisk makebootstick )
+  # Make customized default configuration for xz in makepkg:
+  ( cd $PKG/sbin
+    if [ `readelf -h /usr/bin/readelf|grep -c 80386` -gt 0 ] ; then
+      # x86 do not set ARCH environment, force it
+      ARCH="i586"
+    fi
+    if [ "x$ARCH" != "x" ] ; then
+      # Single-thread consumes less memory and compress better:
+      zcat $CWD/single_thread.diff.gz | patch -p0 --verbose || exit 1
+    fi
+    if [ "$ARCH" = "arm" -o "$ARCH" = "ppc" -o "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "or1k" -o "$ARCH" = "hppa" -o "$ARCH" = "sh4" -o "ARCH" = "sparc" -o "$ARCH" = "i586" -o "$ARCH" = "riscv64" ] ; then
+      # For small-systems, force the compression to -4 (5MB memory for decompression, 48 MB for compression):
+      zcat $CWD/low_memory.diff.gz | patch -p0 --verbose || exit 1
+    fi
+  )
   # Add the make-kernel backup script:
   mkdir -p $PKG/boot
   cp -a $CWD/scripts/make-kernel-backup $PKG/boot
@@ -106,7 +122,7 @@
 
 # Build the package:
 cd $PKG
-makepkg -l y -c n $TMP/pkgtools-$VERSION-$ARCH-$BUILD.txz
+makepkg -l y -c n $TMP/pkgtools-$VERSION-$PARCH-$BUILD.txz
 
 echo
 echo "HEY -- did you remember to update the version numbers in the setup scripts?"
diff -ur slackware64-current.2/source/a/userspace-rcu/userspace-rcu.SlackBuild slackware64-current.3/source/a/userspace-rcu/userspace-rcu.SlackBuild
--- slackware64-current.2/source/a/userspace-rcu/userspace-rcu.SlackBuild.orig	2023-06-14 13:40:53.759525094 +0200
+++ slackware64-current.3/source/a/userspace-rcu/userspace-rcu.SlackBuild	2023-06-14 21:33:32.256133108 +0200
@@ -78,6 +78,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Add generic-gcc implementation for atomic operations on unknown architectures:
+zcat $CWD/unknown_architecture_gcc_generic.diff.gz | patch --verbose -p1 || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/a/util-linux/util-linux.SlackBuild slackware64-current.3/source/a/util-linux/util-linux.SlackBuild
--- slackware64-current.2/source/a/util-linux/util-linux.SlackBuild	2024-07-05 12:29:02.648696930 +0200
+++ slackware64-current.3/source/a/util-linux/util-linux.SlackBuild	2024-07-06 00:45:07.240347899 +0200
@@ -274,6 +274,10 @@
 cd adjtimex-$ADJTIMEXVERS || exit 1
 chown -R root:root .
 zcat $CWD/adjtimex_1.29-2.2.diff.gz | patch -p1 || exit 1
+# Be 2038 time compatible:
+zcat $CWD/time64_on_32bit.diff.gz | patch -p1 || exit 1
+# Fix compilation with gcc 15 (no more needed due to next -std=gnu17 flag):
+#zcat $CWD/adjtimex_gcc15.diff.gz | patch -p1 || exit 1
 CFLAGS="$SLKCFLAGS -std=gnu17" ./configure --prefix=/usr || exit 1
 make || exit 1
 strip adjtimex
diff -ur slackware64-current.2/source/ap/bc/bc.SlackBuild slackware64-current.3/source/ap/bc/bc.SlackBuild
--- slackware64-current.2/source/ap/bc/bc.SlackBuild	2025-01-01 19:54:22.988810719 +0100
+++ slackware64-current.3/source/ap/bc/bc.SlackBuild	2025-01-03 17:35:32.487158650 +0100
@@ -69,6 +69,10 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# On loongarch64 running fix-libmath_h from make raise an error:
+# introducing explict bash call
+sed -i 's/^ed/#!\/bin\/bash\ned/' bc/fix-libmath_h
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/ap/cdparanoia/cdparanoia.SlackBuild slackware64-current.3/source/ap/cdparanoia/cdparanoia.SlackBuild
--- slackware64-current.2/source/ap/cdparanoia/cdparanoia.SlackBuild	2021-02-13 06:31:52.671945590 +0100
+++ slackware64-current.3/source/ap/cdparanoia/cdparanoia.SlackBuild	2021-09-18 13:42:53.026902686 +0200
@@ -72,6 +72,10 @@
 # Patch for changes in cdda headers:
 zcat $CWD/cdparanoia-III-10.2_cdda_private.patch.gz | patch -p3 --verbose --backup --suffix=.orig || exit 1
 
+# Add AArch64 architecture (and new architectures):
+\cp /usr/share/libtool/build-aux/config.sub configure.sub
+\cp /usr/share/libtool/build-aux/config.guess configure.guess
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/ap/cdrtools/cdrtools.SlackBuild slackware64-current.3/source/ap/cdrtools/cdrtools.SlackBuild
--- slackware64-current.2/source/ap/cdrtools/cdrtools.SlackBuild	2021-02-13 06:31:52.716945587 +0100
+++ slackware64-current.3/source/ap/cdrtools/cdrtools.SlackBuild	2021-09-18 13:42:53.056904200 +0200
@@ -59,6 +59,10 @@
 rm -rf cdrtools-$(echo $VERSION | cut -f 1 -d a)
 tar xvf $CWD/cdrtools-$VERSION.tar.?z || exit 1
 cd cdrtools-$(echo $VERSION | cut -f 1 -d a) || exit 1
+
+# Add symlinks for riscv64:
+zcat $CWD/riscv64-support.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/ap/dmapi/dmapi.SlackBuild slackware64-current.3/source/ap/dmapi/dmapi.SlackBuild
--- slackware64-current.2/source/ap/dmapi/dmapi.SlackBuild	2021-02-13 06:31:52.897945577 +0100
+++ slackware64-current.3/source/ap/dmapi/dmapi.SlackBuild	2021-09-18 13:42:53.106906724 +0200
@@ -71,6 +71,10 @@
 # Thanks, Debian
 zcat $CWD/bug799162.patch.gz | patch -p1 --verbose || exit 1
 
+# AArch64 specific patch
+zcat $CWD/missing-sys_getdents.patch.gz | patch -p1 --verbose || exit 1
+
+
 # Make sure you have the same version of autoconf as the
 # developers did...  ;-)
 autoreconf -vif
diff -ur slackware64-current.2/source/ap/ghostscript/ghostscript.SlackBuild slackware64-current.3/source/ap/ghostscript/ghostscript.SlackBuild
--- slackware64-current.2/source/ap/ghostscript/ghostscript.SlackBuild	2022-09-20 14:28:06.207562315 +0200
+++ slackware64-current.3/source/ap/ghostscript/ghostscript.SlackBuild	2023-05-15 12:32:03.237565466 +0200
@@ -83,6 +83,12 @@
 # Remove unmaintained garbage:
 rm -rf freetype jpeg lcms2 libpng libtiff png tiff zlib
 
+# Disable NEON instruction for arm (TesserACT won't compile):
+zcat $CWD/disable_neon.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix mixed code declaration (seems buggy only on armv7hl):
+zcat $CWD/fix_mixed_code_declaration.diff.gz | patch -p1 --verbose || exit 1
+
 # Regenerate ./configure.  Needed if patched, or to prevent libtool mismatch.
 autoreconf --force --install
 ( cd jbig2dec ; autoreconf --force --install )
@@ -88,6 +88,11 @@
 ( cd jbig2dec ; autoreconf --force --install )
 ( cd ijs ; autoreconf --force --install )
 
+# Patch lcms2 and psi bundled libraries to correctly handle alignment on ARMv5 and SPARC 
+# (64bit load/store should be aligned on 8-byte boundary even if 32bit architectures):
+zcat $CWD/arm_unaligned_64bit_load-store.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/arm_sparc_psi_align8.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
@@ -114,6 +114,7 @@
 
 # Configure:
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
diff -ur slackware64-current.2/source/ap/linuxdoc-tools/linuxdoc-tools.build slackware64-current.3/source/ap/linuxdoc-tools/linuxdoc-tools.build
--- slackware64-current.2/source/ap/linuxdoc-tools/linuxdoc-tools.build	2021-08-12 14:42:11.000000000 +0200
+++ slackware64-current.3/source/ap/linuxdoc-tools/linuxdoc-tools.build	2021-09-18 13:42:53.266914800 +0200
@@ -45,7 +45,11 @@
 
 # Determine the general CFLAGS for the known architectures:
 case $ARCH in
-  arm*)    export SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -mtune=generic-armv7-a -mabi=aapcs-linux"
+  arm) export SLKCFLAGS="-O2 -march=armv5te -mfloat-abi=soft"
+           export LIBDIRSUFFIX=""
+           export HOSTTARGET="-gnueabi"
+           ;;
+  armv7hl) export SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -mtune=generic-armv7-a -mabi=aapcs-linux"
            export LIBDIRSUFFIX=""
            export HOSTTARGET="-gnueabihf"
            ;;
diff -ur slackware64-current.2/source/ap/lxc/lxc.SlackBuild slackware64-current.3/source/ap/lxc/lxc.SlackBuild
--- slackware64-current.2/source/ap/lxc/lxc.SlackBuild	2021-08-09 20:04:20.644977839 +0200
+++ slackware64-current.3/source/ap/lxc/lxc.SlackBuild	2021-09-18 13:42:53.346918839 +0200
@@ -81,6 +81,12 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [[ "$ARCH" = "ppc" ]]
+then
+  # Use ld.bfd on ppc ("unsupported -mbss-plt code" with gold)
+  sed -i 's/fuse-ld=gold/fuse-ld=bfd/' meson.build
+fi
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
diff -ur slackware64-current.2/source/ap/mariadb/mariadb.SlackBuild slackware64-current.3/source/ap/mariadb/mariadb.SlackBuild
--- slackware64-current.2/source/ap/mariadb/mariadb.SlackBuild	2025-01-07 13:26:22.636553320 +0100
+++ slackware64-current.3/source/ap/mariadb/mariadb.SlackBuild	2025-01-07 13:31:20.012459950 +0100
@@ -88,6 +88,16 @@
 tar xf $CWD/${PKGNAM}-$VERSION.tar.?z || exit 1
 cd ${PKGNAM}-$VERSION || exit 1
 
+# Disabling HTM instruction set for PowerPC64, since gcc is targeted 
+# for the most generic processor without HTM instruction set
+zcat $CWD/disable_htm_ppc64.diff.gz | patch -p1 --verbose || exit 1
+
+# Removing incorrect asm v9 instructions for sparc-v8:
+zcat $CWD/sparc_pre-v9.diff.gz | patch -p1 --verbose || exit 1
+
+# Missing accelerated crc32c function for i586:
+zcat $CWD/disable_i386_crc32_accel.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -105,7 +115,7 @@
 
 mkdir build
 cd build
-cmake \
+LDFLAGS="$SLKLDFLAGS" cmake \
   -DCMAKE_C_FLAGS="$SLKCFLAGS" \
   -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
   -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -189,6 +199,12 @@
     mv $PKG/lib/security $PKG/lib${LIBDIRSUFFIX}/security
     rmdir $PKG/lib 2> /dev/null
   fi
+elif [ -d $PKG/lib64/security ]; then
+  if [ ! "lib64" = "lib${LIBDIRSUFFIX}" ]; then
+    mkdir -p $PKG/lib${LIBDIRSUFFIX}
+    mv $PKG/lib64/security $PKG/lib${LIBDIRSUFFIX}/security
+    rmdir $PKG/lib64 2> /dev/null
+  fi
 fi
 
 # The ./configure option to omit this has gone away, so we'll omit it
diff -ur slackware64-current.2/source/ap/mpg123/mpg123.SlackBuild slackware64-current.3/source/ap/mpg123/mpg123.SlackBuild
--- slackware64-current.2/source/ap/mpg123/mpg123.SlackBuild	2021-03-24 04:49:35.709449607 +0100
+++ slackware64-current.3/source/ap/mpg123/mpg123.SlackBuild	2021-09-18 13:42:53.426922877 +0200
@@ -86,15 +86,25 @@
 # --with-cpu=i586		Use code optimized for i586 processors
 # --with-cpu=i586_dither	Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
 # --with-cpu=3dnow		Use code optimized for 3DNow processors
+# --with-cpu=3dnow_vintage	Use code optimized for older 3DNow processors (K6 family)
 # --with-cpu=3dnowext		Use code optimized for 3DNowExt processors (K6-3+, Athlon)
 # --with-cpu=3dnowext_alone	Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
+# --with-cpu=3dnowext_vintage	Use code optimized for older extended 3DNow processors (like K6-III+)
 # --with-cpu=mmx		Use code optimized for MMX processors
 # --with-cpu=mmx_alone		Really only MMX decoder, without i586 fallback for flexible rate
 # --with-cpu=sse		Use code optimized for SSE processors
+# --with-cpu=sse_vintage	Use code optimized for older SSE processors (plain C DCT36)
 # --with-cpu=sse_alone		Really only SSE decoder, without i586 fallback for flexible rate
+# --with-cpu=avx		Use code optimized for x86-64 with AVX processors
 # --with-cpu=x86		Pack all x86 opts into one binary (excluding i486, including dither)
 # --with-cpu=x86-64		Use code optimized for x86-64 processors (AMD64 and Intel64, including dithered generic)
-# --with-cpu=arm_nofpu		Use code optimized for ARM processors with fixed point arithmetic (experimental)
+# --with-cpu=altivec		Use code optimized for Altivec processors (PowerPC G4 and G5)
+# --with-cpu=ppc_nofpu		Use code optimized for PowerPC processors with fixed point arithmetic
+# --with-cpu=neon		Use code optimized for ARM NEON SIMD engine (Cortex-A series)
+# --with-cpu=arm_fpu		Pack neon and generic[_dither] decoders, for ARM processors with FPU and/or NEON
+# --with-cpu=arm_nofpu		Use code optimized for ARM processors with fixed point arithmetic
+# --with-cpu=neon64		Use code optimized for AArch64 NEON SIMD engine
+# --with-cpu=aarch64		Pack neon64 and generic[_dither] decoders, for 64bit ARM processors
 
 rm -rf $PKG
 mkdir -p $PKG $TMP
diff -ur slackware64-current.2/source/ap/rpm/rpm.SlackBuild slackware64-current.3/source/ap/rpm/rpm.SlackBuild
--- slackware64-current.2/source/ap/rpm/rpm.SlackBuild	2024-12-07 11:50:19.857184891 +0100
+++ slackware64-current.3/source/ap/rpm/rpm.SlackBuild	2024-12-20 09:48:56.134740995 +0100
@@ -85,6 +85,13 @@
 rm -rf rpm-$VERSION
 tar xvf $CWD/rpm-$VERSION.tar.?z || exit 1
 cd rpm-$VERSION || exit 1
+
+# Revert old behaviour by replacing "archive_entry_copy_stat" with single
+# property-set functions. This is needed in mips64el where libarchive and
+# rpm have different macro definition __USE_FILE_OFFSET64 for "struct stat"
+# (different offsets)
+zcat $CWD/revert_archive_entry_copy_stat.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/d/binutils/binutils.SlackBuild slackware64-current.3/source/d/binutils/binutils.SlackBuild
--- slackware64-current.2/source/d/binutils/binutils.SlackBuild	2024-08-05 01:50:07.704731508 +0200
+++ slackware64-current.3/source/d/binutils/binutils.SlackBuild	2025-08-05 12:02:35.789498689 +0200
@@ -53,13 +53,23 @@
 # Set to ld.gold or ld.bfd:
 DEFAULT_LD=ld.bfd
 
-if [ "$ARCH" = "i686" ]; then
+ENABLE_GOLD=${ENABLE_GOLD:-"yes"}
+
+if [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  ADDTARGET="i386-efi-pe,bpf-unknown-none,"
+  # The config option below is currently needed to compile on x86:
+  WERROR="--enable-werror=no"
+  LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
+  ADDTARGET="i386-efi-pe,bpf-unknown-none,"
   # The config option below is currently needed to compile on x86:
   WERROR="--enable-werror=no"
   LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
+  ADDTARGET="i386-efi-pe,bpf-unknown-none,"
   LIBDIRSUFFIX="64"
 else
   SLKCFLAGS="-O2"
@@ -71,6 +81,12 @@
     *)    TARGET=$ARCH-slackware-linux ;;
 esac
 
+# Remove targets in mips since it does not compiles gold with it:
+case "$ARCH" in
+    mips*) ADDTARGET="" ;;
+    *)     ADDTARGET="--enable-targets=${ADDTARGET}$TARGET" ;;
+esac
+
 TMP=${TMP:-/tmp}
 PKG=$TMP/package-binutils
 
@@ -94,6 +110,9 @@
 # Don't check to see if "config.h" was included in the installed headers:
 zcat $CWD/patches/binutils-no-config-h-check.patch.gz | patch -p1 --verbose || exit 1
 
+# Enable 64bit time_t in 32bit system (disable it only on gprofng):
+zcat $CWD/patches/enable_time64_on_32bit.diff.gz | patch -p1 --verbose || exit 1
+
 # Set %version to something halfway meaningful:
 zcat $CWD/patches/binutils-version.patch.gz | patch -p1 --verbose || exit 1
 sed -i -e 's/%''{release}/slack151/g' bfd/Makefile{.am,.in}
@@ -138,6 +157,7 @@
 
 # Build for an x86 glibc2-based Linux system:
 CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -151,7 +171,7 @@
   --enable-64-bit-bfd \
   --enable-plugins \
   --enable-threads \
-  --enable-targets=i386-efi-pe,bpf-unknown-none,${TARGET} \
+  ${ADDTARGET} \
   --enable-install-libiberty \
   --enable-ld=default \
   --enable-initfini-array \
diff -ur slackware64-current.2/source/d/cargo-vendor-filterer/cargo-vendor-filterer.SlackBuild slackware64-current.3/source/d/cargo-vendor-filterer/cargo-vendor-filterer.SlackBuild
--- slackware64-current.2/source/d/cargo-vendor-filterer/cargo-vendor-filterer.SlackBuild	2023-04-19 20:21:42.773010844 +0200
+++ slackware64-current.3/source/d/cargo-vendor-filterer/cargo-vendor-filterer.SlackBuild	2023-09-22 15:09:55.325656914 +0200
@@ -98,18 +98,60 @@
 directory = "vendor"
 EOF
 
+# rustix uses now by default linux_raw backend for syscalls, but seems supported only
+# for aarch64, arm, mipsel, mips64el, powerpc64le, riscv64, x86, and x86_64.
+# Re-add real errno for other architectures, or you can pass "--cfg=rustix_use_libc" 
+# to force libc usage.
+case "$ARCH" in
+  mips|ppc|ppc64|s390x|loongarch64) 
+    (cd vendor
+     rm -rf errno
+     tar xvf $CWD/errno-*.tar.lz
+     #cd rustix
+     #perl -n -e '
+     #  if(m/dependencies.libc_errno/) { $status=1; }
+     #  if($status && m/"0\.3\.1"/) {
+     #	 s/"0.3.1"/"0.3.3"/;
+     #	 $status=0;
+     #  }
+     #  print;
+     #' Cargo.toml > Cargo.toml.tmp
+     #\mv Cargo.toml.tmp Cargo.toml
+     #cat .cargo-checksum.json  | perl -e '($newck)=split(" ",$ARGV[0]);while(<STDIN>) { s/("Cargo.toml":)"(\S+?)"/$1"$newck"/; print;}' `sha256sum Cargo.toml` > .cargo-checksum.json.tmp
+     #\mv .cargo-checksum.json.tmp .cargo-checksum.json
+    )
+    #SLKRUSTFLAGS="--cfg=rustix_use_libc"
+    ;;
+esac
+
+# Add support for EXT4 ioctl and FICLONE to loongarch64
+#case "$ARCH" in
+#  loongarch64|mips|ppc64|s390x) 
+#    (cd vendor
+#     cd rustix
+#     zcat $CWD/rustix-syscall_loongarch64.diff.gz | patch -p3 --verbose
+#     cat .cargo-checksum.json  | perl -e '($newck)=split(" ",$ARGV[0]);while(<STDIN>) { s|("src/backend/libc/io/syscalls.rs":)"(\S+?)"|$1"$newck"|; print;}' `sha256sum src/backend/libc/io/syscalls.rs` > .cargo-checksum.json.tmp
+#     \mv .cargo-checksum.json.tmp .cargo-checksum.json
+#    )
+#  ;;
+#esac
+
+# Support for Loongarch64 in linux-raw-sys was introduced in 0.3.2, but rustix 
+# targets version 0.1.2 (raised to 0.1.4). Replace version 0.1.4 with 0.4.3 and
+# fix rustix Cargo.toml. See https://github.com/sunfishcode/linux-raw-sys/issues/34
+
+RUSTFLAGS="$SLKRUSTFLAGS" \
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
 OPENSSL_NO_VENDOR=1 \
 cargo build \
   --offline \
   --release \
-  --target $ARCH-unknown-linux-gnu \
-  $NUMJOBS
+  $NUMJOBS || exit 1
 
 mkdir -p $PKG/usr/bin
-install -m 755 target/$ARCH-unknown-linux-gnu/release/cargo-vendor-filterer \
-  $PKG/usr/bin/
+install -m 755 target/release/cargo-vendor-filterer \
+  $PKG/usr/bin/ || exit 1
 
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff -ur slackware64-current.2/source/d/cbindgen/cbindgen.SlackBuild slackware64-current.3/source/d/cbindgen/cbindgen.SlackBuild
--- slackware64-current.2/source/d/cbindgen/cbindgen.SlackBuild	2021-09-09 19:19:52.527012986 +0200
+++ slackware64-current.3/source/d/cbindgen/cbindgen.SlackBuild	2021-09-18 13:42:54.186961238 +0200
@@ -104,12 +104,11 @@
 cargo build \
   --offline \
   --release \
-  --target $ARCH-unknown-linux-gnu \
   --verbose \
   $NUMJOBS || exit 1
 
 mkdir -p $PKG/usr/bin
-install -m 755 target/$ARCH-unknown-linux-gnu/release/cbindgen $PKG/usr/bin
+install -m 755 target/release/cbindgen $PKG/usr/bin || exit 1
 
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff -ur slackware64-current.2/source/d/clisp/clisp.SlackBuild slackware64-current.3/source/d/clisp/clisp.SlackBuild
--- slackware64-current.2/source/d/clisp/clisp.SlackBuild	2021-10-02 10:49:12.993388643 +0200
+++ slackware64-current.3/source/d/clisp/clisp.SlackBuild	2023-06-23 11:36:11.929328955 +0200
@@ -86,6 +86,12 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Disabled SPARCv8plus instructions (-mcpu=v9):
+sed -i 's/ -mcpu=v9//' configure
+
+# Force eabi for arm:
+sed -i 's/{HOST_CPU_C_ABI}-old/{HOST_CPU_C_ABI}-eabi/' configure
+
 CFLAGS="$SLKCFLAGS" \
 ./configure \
   --prefix=/usr \
diff -ur slackware64-current.2/source/d/cmake/cmake.SlackBuild slackware64-current.3/source/d/cmake/cmake.SlackBuild
--- slackware64-current.2/source/d/cmake/cmake.SlackBuild	2022-04-30 21:32:40.309799140 +0200
+++ slackware64-current.3/source/d/cmake/cmake.SlackBuild	2023-07-25 11:47:33.216720484 +0200
@@ -78,6 +81,7 @@
 cd cmake-build
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
   ../configure \
   --prefix=/usr \
   --docdir=/doc/$PKGNAM-$VERSION \
diff -ur slackware64-current.2/source/d/gcc/gcc.SlackBuild slackware64-current.3/source/d/gcc/gcc.SlackBuild
--- slackware64-current.2/source/d/gcc/gcc.SlackBuild	2024-08-30 05:19:51.000606322 +0200
+++ slackware64-current.3/source/d/gcc/gcc.SlackBuild	2025-06-21 22:16:40.745911309 +0200
@@ -69,7 +69,7 @@
 
 # Which compilers do we want to build?
 if [ -z $LANGS ]; then
-  LANGS="ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust"
+  LANGS="c,c++,fortran,lto,m2,objc,obj-c++"
   # Add COBOL on supported $ARCH:
   if [ "$(uname -m)" = "x86_64" -o "$(uname -m)" = "aarch64" ]; then
     LANGS="${LANGS},cobol"
@@ -99,10 +99,10 @@
 # Try to figure out if we want multilib (or set MULTILIB= manually).
 # BTW, --disable-multilib is only ever used on x86_64.
 # Using it elsewhere will break the build.
-if [ "$ARCH" = "x86_64" -a ! -L /lib/ld-linux.so.2 ]; then
-  MULTILIB=${MULTILIB:-"--disable-multilib"}
-else
+if [ "$ARCH" = "x86_64" -a -L /lib/ld-linux.so.2 ]; then
   MULTILIB=${MULTILIB:-"--enable-multilib"}
+else
+  MULTILIB=${MULTILIB:-"--disable-multilib"}
 fi
 
 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
@@ -143,6 +143,28 @@
     *)    TARGET=$ARCH-slackware-linux ;;
 esac
 
+addlang=""
+if [ "$ARCH" != "hppa" -a "$ARCH" != "or1k" -a "$ARCH" != "loongarch64" -a "$ARCH" != "sh4" ]; then
+  # libgo not support syscall for hppa, or1k, and loongarch64. On sh4 "Unhandled trap 0x180".
+  addlang="go,"
+fi
+
+which gnat 2> /dev/null 
+if [ $? -eq 0 ] ; then
+  addlang="${addlang}ada,"
+fi
+
+which gdc 2> /dev/null 
+if [ $? -eq 0 ] ; then
+  addlang="${addlang}d,"
+fi
+
+which cargo 2> /dev/null 
+if [ $? -eq 0 -a "$ARCH" != "s390x" ] ; then
+  # segment violation while building librust on s390x...
+  addlang="${addlang}rust,"
+fi
+
 # Temporary build location:
 TMP=${TMP:-/tmp}
 
@@ -196,6 +203,23 @@
   fi
 done
 
+if [ "$ARCH" = "arm" -o "$ARCH" = "sparc" ]
+then
+  # Ada tools now requires 64 bits atomic operation, need to link atomic library for arm and sparc:
+  zcat $CWD/patches/gcc.ada.atomic.armdiff.gz | patch -p1 --verbose || exit 1
+fi
+
+if [ `gcc -dM -E - < /dev/null | grep -c LP64.*1` -eq 0 ]
+then
+  # Fix ada time_t bits:
+  cp gcc/ada/libgnat/s-parame__posix2008.ads  gcc/ada/libgnat/s-parame.ads
+fi
+
+# Disabling c++ double128 compatibility on PowerPC platform
+#sed -i  's/powerpc\*-\*-linux\*/xpowerpc/' libstdc++-v3/configure
+# Disabling c++ double128 compatibility on Sparc(32bit) platform
+#sed -i  's/sparc\*-\*-linux\*/sparc64-*-linux*/' gcc-$VERSION/libstdc++-v3/configure
+
 # Fix perms/owners:
 chown -R root:root .
 find . \
@@ -374,21 +398,37 @@
 ( mkdir gcc.build.lnx
   cd gcc.build.lnx
 
-  if [ "$ARCH" = "x86_64" ]; then
-    GCC_ARCHOPTS="--with-arch=x86-64"
-  else
+  if [ "$ARCH" == "armv7hl" ]; then
+    GCC_ARCHOPTS="--with-tune=cortex-a8 --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-abi=aapcs-linux"
+  elif [ "$ARCH" == "arm" ]; then
+    GCC_ARCHOPTS="--with-arch=armv5te --with-float=soft"
+  elif [ "$ARCH" == "aarch64" ]; then
+    GCC_ARCHOPTS="--with-arch=armv8-a"
+  elif [ "$ARCH" == "mips" ]; then
+    GCC_ARCHOPTS="--with-arch=mips32r2"
+  elif [ "$ARCH" == "mipsel" ]; then
+    GCC_ARCHOPTS="--with-arch=mips32r2"
+  elif [ "$ARCH" == "mips64el" ]; then
+    GCC_ARCHOPTS="--with-arch=mips64r2"
+  elif [ "$ARCH" == "sparc" ]; then
+    GCC_ARCHOPTS="--with-cpu=leon3 --with-float=hard --disable-libitm"
+  elif [ "$ARCH" == "sparc64" ]; then
+    GCC_ARCHOPTS="--with-cpu=ultrasparc --with-float=hard"
+  elif [ `echo "$ARCH" | grep -cE '^i.86$'` -gt 0 ]; then
     GCC_ARCHOPTS="--with-arch=$ARCH"
   fi
  
-  CFLAGS="$SLKCFLAGS" \
-  CXXFLAGS="$SLKCFLAGS" \
+  CFLAGS="$SLKCFLAGS -D_DONOTFORCE_TIME_BITS_DISABLED" \
+  CXXFLAGS="$SLKCFLAGS -D_DONOTFORCE_TIME_BITS_DISABLED" \
+  LDFLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" \
+  BOOT_LDFLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" \
   ../configure --prefix=/usr \
      --libdir=/usr/lib$LIBDIRSUFFIX \
      --mandir=/usr/man \
      --infodir=/usr/info \
      --enable-shared \
      --enable-bootstrap \
-     --enable-languages=${LANGS} \
+     --enable-languages=${addlang}${LANGS} \
      --enable-threads=posix \
      --enable-checking=release \
      --with-system-zlib \
@@ -421,6 +461,7 @@
   # Include all debugging info (for now):
   make $NUMJOBS bootstrap || exit 1
 
+  if [ `echo $addlang | grep -c 'ada,'` -gt 0 ] ; then
   ( cd gcc
     make $NUMJOBS gnatlib GNATLIBCFLAGS="$SLKCFLAGS" || exit 1
     # This wants a shared -ladd2line?
@@ -430,6 +471,7 @@
     CXXFLAGS="$SLKCFLAGS" \
     make $NUMJOBS gnattools || exit 1
   ) || exit 1
+  fi
   make info || exit 1
 
   # Set GCCCHECK=something to run the tests
@@ -439,6 +481,11 @@
 
   make install DESTDIR=$PKG1 || exit 1
 
+  if [ -d "$PKG1/usr/lib$LIBDIRSUFFIX/"'!m4' ]
+  then
+    (cd "$PKG1/usr/lib$LIBDIRSUFFIX/"'!m4' ; mv * .. ; cd .. ; rmdir '!m4')
+  fi
+
   # Move gdb pretty printers to the correct place
   mkdir -p $PKG1/usr/share/gdb/auto-load/usr/lib$LIBDIRSUFFIX
   mv $PKG1/usr/lib$LIBDIRSUFFIX/*-gdb.py \
@@ -451,7 +498,7 @@
 
   # Make our 64bit gcc look for 32bit gcc binaries in ./32 subdirectory.
   # This is needed only for x86_64 + --disable-multilib.
-  if [ "$ARCH" = "x86_64" -a "$MULTILIB" = "--disable-multilib" ]; then
+  if [ "$LIBDIRSUFFIX" = "64" -a "$MULTILIB" = "--disable-multilib" ]; then
     sed -i 's#;.\(:../lib !m64 m32;\)$#;32\1#' \
       $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs
   fi
@@ -499,6 +546,15 @@
     cat $CWD/c89.sh > c89
     cat $CWD/c99.sh > c99
     chmod 755 c89 c99
+    if [ "$TARGET" != "${ARCH}-slackware-linux" ]
+    then
+      for b in gm2 c++ g++ cc gcc gcc-ar gcc-nm gcc-ranlib gccgo gdc gfortran
+      do
+	if [ -f $b ]; then
+     	  ln -s $b ${ARCH}-slackware-linux-$b
+	fi
+      done
+    fi
   )
 
   ( cd $PKG1/usr/man
@@ -564,7 +620,7 @@
     mkdir -p usr/lib
     mv $PKG1/usr/lib/*++* usr/lib
   fi
-)
+) || exit 1
 
 # gcc-gfortran:
 ( cd $PKG3
@@ -594,8 +650,9 @@
     mv $PKG1/usr/lib/gcc/$TARGET/$VERSION/finclude usr/lib/gcc/$TARGET/$VERSION
     mv $PKG1/usr/lib/gcc/$TARGET/$VERSION/libgfortran* usr/lib/gcc/$TARGET/$VERSION
   fi
-)
+) || exit 1
 
+if [ `echo $addlang | grep -c 'ada,'` -gt 0 ] ; then
 # gcc-gnat:
 ( cd $PKG4
   mkdir -p usr/bin
@@ -617,7 +674,8 @@
     mv $PKG1/usr/lib64/gcc/$TARGET/$VERSION/32/adalib usr/lib/gcc/$TARGET/$VERSION
     ln -sf /usr/lib/gcc/$TARGET/$VERSION/adalib usr/lib64/gcc/$TARGET/$VERSION/32/adalib
   fi
-)
+) || exit 1
+fi
 
 # gcc-objc:
 ( cd $PKG6
@@ -625,7 +683,6 @@
   mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1obj usr/libexec/gcc/$TARGET/$VERSION
   mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1objplus usr/libexec/gcc/$TARGET/$VERSION
   mkdir -p usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
-  mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/objc usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
   mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/cc1objplus usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
   # Libraries:
   # As a rule, we don't package static libraries.
@@ -638,8 +695,11 @@
     mkdir -p usr/lib
     mv $PKG1/usr/lib/libobjc* usr/lib
   fi
-)
+  # Move this at the end to be sure it exists and will not generate error
+  mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/objc usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+) || exit 1
 
+if [ `echo $addlang | grep -c 'go,'` -gt 0 ] ; then
 # gcc-go:
 ( cd $PKG8
   mkdir -p usr/bin
@@ -667,7 +727,9 @@
     rm -f $PKG1/usr/lib/libgo.a
   fi
 ) || exit 1
+fi
 
+if [ `echo $addlang | grep -c 'd,'` -gt 0 ] ; then
 # gcc-gdc:
 ( cd $PKG10
   mkdir -p usr/bin
@@ -704,6 +766,7 @@
     #rm -f usr/lib/libgdruntime.a
   fi
 )
+fi
 
 # gcc-gm2:
 ( cd $PKG11
@@ -738,6 +801,7 @@
   fi
 )
 
+if [ `echo $addlang | grep -c 'rust,'` -gt 0 ] ; then
 # gcc-rust:
 ( cd $PKG12
   mkdir -p usr/bin
@@ -745,6 +809,7 @@
   mkdir -p usr/libexec/gcc/$TARGET/$VERSION
   mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/crab1 usr/libexec/gcc/$TARGET/$VERSION
 ) || exit 1
+fi
 
 # gcc-cobol:
 if echo $LANGS | grep -q cobol ; then
@@ -771,18 +836,26 @@
   makepkg -l y -c n $TMP/gcc-g++-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
 ( cd $PKG3
   makepkg -l y -c n $TMP/gcc-gfortran-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+if [ `echo $addlang | grep -c 'ada,'` -gt 0 ] ; then
 ( cd $PKG4
   makepkg -l y -c n $TMP/gcc-gnat-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+fi
 ( cd $PKG6
   makepkg -l y -c n $TMP/gcc-objc-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+if [ `echo $addlang | grep -c 'go,'` -gt 0 ] ; then
 ( cd $PKG8
   makepkg -l y -c n $TMP/gcc-go-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+fi
+if [ `echo $addlang | grep -c 'd,'` -gt 0 ] ; then
 ( cd $PKG10
   makepkg -l y -c n $TMP/gcc-gdc-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+fi
 ( cd $PKG11
   makepkg -l y -c n $TMP/gcc-gm2-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+if [ `echo $addlang | grep -c 'rust,'` -gt 0 ] ; then
 ( cd $PKG12
   makepkg -l y -c n $TMP/gcc-rust-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
+fi
 if echo $LANGS | grep -q cobol ; then
   ( cd $PKG13
     makepkg -l y -c n $TMP/gcc-gcobol-${VERSION}${VERTAG}-$ARCH-${BUILD}${TAG}.txz )
diff -ur slackware64-current.2/source/d/gdb/gdb.SlackBuild slackware64-current.3/source/d/gdb/gdb.SlackBuild
--- slackware64-current.2/source/d/gdb/gdb.SlackBuild	2025-01-07 13:26:22.986572044 +0100
+++ slackware64-current.3/source/d/gdb/gdb.SlackBuild	2025-01-07 13:31:20.532487765 +0100
@@ -73,6 +73,11 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" ] ; then
+  # Avoid overflow on simulator for MIPS32:
+  zcat $CWD/mips32_overflow.diff.gz | patch -p1 --verbose || exit 1
+fi
+
 # This has been perpetually broken, so we'll default to turning it off:
 GUILE_OPTION=${GUILE_OPTION:-"--without-guile"}
 
diff -ur slackware64-current.2/source/d/gettext-tools/gettext-tools.SlackBuild slackware64-current.3/source/d/gettext-tools/gettext-tools.SlackBuild
--- slackware64-current.2/source/d/gettext-tools/gettext-tools.SlackBuild	2025-05-14 21:58:46.434661672 +0200
+++ slackware64-current.3/source/d/gettext-tools/gettext-tools.SlackBuild	2025-05-19 11:01:33.762814404 +0200
@@ -67,6 +67,15 @@
 # Don't use icecream:
 PATH=$(echo $PATH | sed "s|/usr/libexec/icecc/bin||g" | tr -s : | sed "s/^://g" | sed "s/:$//g")
 
+if [ "$ARCH" = "armv7hl" -o "${ARCH::3}" = "ppc" -o "$ARCH" = "or1k" -o "$ARCH" ]
+then
+  # Some architectures do not have a fully working d compiler:
+  # - armv7hl, or1k: "d21: error: cannot find source code for runtime library file 'object.d'"
+  # - ppc*: gnu/libintl/libintl.d:35:8: error: unable to read module 'conv'
+  #         gnu/libintl/libintl.d:35:8: note: Expected 'std/conv.d' or 'std/conv/package.d' 
+  EXTRACONF="--disable-d"
+fi
+
 rm -rf $PKG
 mkdir -p $TMP $PKG
 cd $TMP
@@ -90,6 +99,7 @@
   --infodir=/usr/info \
   --mandir=/usr/man \
   --docdir=/usr/doc/gettext-tools-$VERSION \
+  $EXTRACONF \
   --build=$ARCH-slackware-linux || exit 1
 
 make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/d/guile/guile.SlackBuild slackware64-current.3/source/d/guile/guile.SlackBuild
--- slackware64-current.2/source/d/guile/guile.SlackBuild	2021-04-28 20:11:00.493022067 +0200
+++ slackware64-current.3/source/d/guile/guile.SlackBuild	2021-09-18 13:42:53.586930953 +0200
@@ -73,6 +73,9 @@
 tar xvf $CWD/guile-$VERSION.tar.?z || exit 1
 cd guile-$VERSION || exit 1
 
+# Remove 32-bit-big-endian prebuilt, since it does not work:
+rm -rf prebuilt/32-bit-big-endian
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -90,6 +93,7 @@
   --disable-static \
   --disable-rpath \
   --disable-error-on-warning \
+  $EXTRAGUILE \
   --build=$ARCH-slackware-linux || exit 1
 
 # Does not like parallel make...
diff -ur slackware64-current.2/source/d/libgccjit/libgccjit.SlackBuild slackware64-current.3/source/d/libgccjit/libgccjit.SlackBuild
--- slackware64-current.2/source/d/libgccjit/libgccjit.SlackBuild	2024-02-13 22:27:32.208514310 +0100
+++ slackware64-current.3/source/d/libgccjit/libgccjit.SlackBuild.new	2024-02-13 23:36:51.525931524 +0100
@@ -150,7 +149,23 @@
 ( mkdir gcc.build.lnx
   cd gcc.build.lnx
 
-  if [ "$ARCH" != "x86_64" ]; then
+  if [ "$ARCH" == "armv7hl" ]; then
+    GCC_ARCHOPTS="--with-tune=cortex-a8 --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-abi=aapcs-linux"
+  elif [ "$ARCH" == "arm" ]; then
+    GCC_ARCHOPTS="--with-arch=armv5te --with-float=soft"
+  elif [ "$ARCH" == "aarch64" ]; then
+    GCC_ARCHOPTS="--with-arch=armv8-a"
+  elif [ "$ARCH" == "mips" ]; then
+    GCC_ARCHOPTS="--with-arch=mips32r2"
+  elif [ "$ARCH" == "mipsel" ]; then
+    GCC_ARCHOPTS="--with-arch=mips32r2"
+  elif [ "$ARCH" == "mips64el" ]; then
+    GCC_ARCHOPTS="--with-arch=mips64r2 --disable-multilib"
+  elif [ "$ARCH" == "sparc" ]; then
+    GCC_ARCHOPTS="--with-cpu=leon3 --with-float=hard --disable-multilib --disable-libitm"
+  elif [ "$ARCH" == "sparc64" ]; then
+    GCC_ARCHOPTS="--with-cpu=ultrasparc --with-float=hard --disable-multilib"
+  elif [ `echo "$ARCH" | grep -cE '^i.86$'` -gt 0 ]; then
     GCC_ARCHOPTS="--with-arch=$ARCH"
   else
     GCC_ARCHOPTS="--disable-multilib"
diff -ur slackware64-current.2/source/d/llvm/llvm.SlackBuild slackware64-current.3/source/d/llvm/llvm.SlackBuild
--- slackware64-current.2/source/d/llvm/llvm.SlackBuild	2024-06-20 23:25:05.566400028 +0200
+++ slackware64-current.3/source/d/llvm/llvm.SlackBuild	2024-07-03 01:34:21.643239525 +0200
@@ -33,23 +33,12 @@
 
 if [ -z "$ARCH" ]; then
   case "$( uname -m )" in
-    i?86) ARCH=i686 ;;
+    i?86) ARCH=i586 ;;
     arm*) ARCH=arm ;;
        *) ARCH=$( uname -m ) ;;
   esac
 fi
 
-# Select projects to build:
-if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
-  # bolt and flang are not available on 32-bit
-  LLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS:-"clang;clang-tools-extra;compiler-rt;lld;lldb;llvm;mlir;openmp;polly"}
-else
-  LLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS:-"bolt;clang;clang-tools-extra;compiler-rt;flang;lld;lldb;llvm;mlir;openmp;polly"}
-fi
-
-# Select runtimes to build:
-LLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES:-"libcxx;libcxxabi"}
-
 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
 # the name of the created package would be, and then exit. This information
 # could be useful to other scripts.
@@ -66,6 +55,8 @@
 # massive warning spew:
 IGNORE_GNU_EXTENSIONS=${IGNORE_GNU_EXTENSIONS:--Wno-unknown-warning-option -Wno-gnu-line-marker -Wno-gnu-anonymous-struct -Wno-gnu-include-next}
 
+LINKER="lld"
+
 if [ "$ARCH" = "i586" ]; then
   SLKCFLAGS="-O2 -march=i586 -mtune=i686 $IGNORE_GNU_EXTENSIONS"
   LIBDIRSUFFIX=""
@@ -80,6 +71,104 @@
   LIBDIRSUFFIX=""
 fi
 
+# Building lld will be determined automatically unless BUILD_LLD is
+# preset to YES or NO:
+if [ -z $BUILD_LLD ]; then
+  if [ "$ARCH" =  "or1k" -o "$ARCH" = "sh4" -o "$ARCH" = "alpha" -o "$ARCH" = "hppa" ]; then
+    BUILD_LLD=NO
+  else
+    BUILD_LLD=YES
+  fi
+fi
+
+# Building lldb will be determined automatically unless BUILD_LLDB is
+# preset to YES or NO:
+if [ -z $BUILD_LLDB ]; then
+  if [ "$ARCH" = "riscv64" -o "$ARCH" = "ppc" -o "${ARCH::4}" = "mips"  -o "$ARCH" =  "or1k" -o "$ARCH" = "sh4" -o "$ARCH" = "alpha" -o "$ARCH" = "hppa" -o "${ARCH::5}" = "sparc" ]; then
+    BUILD_LLDB=NO
+  else
+    BUILD_LLDB=YES
+  fi
+fi
+
+# Building OpenMP will be determined automatically unless BUILD_OPENMP is
+# preset to YES or NO:
+if [ -z $BUILD_OPENMP ]; then
+  if [ "$ARCH" = "ppc" -o "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "riscv64" -o "$ARCH" = "s390x" -o "$ARCH" =  "or1k" -o "$ARCH" = "sh4" -o "$ARCH" = "alpha" -o "$ARCH" = "hppa" -o "${ARCH::5}" = "sparc" ]; then
+    # OpenMP not supported on PowerPC 32 bits / RISC-V / zArchitecture
+    BUILD_OPENMP=NO
+  else
+    BUILD_OPENMP=YES
+  fi
+fi
+
+# Building Host clang will be determined automatically unless BUILD_HOST is
+# preset to YES or NO:
+if [ -z $BUILD_HOST ]; then
+  if [ "$ARCH" = "sh4" -o "$ARCH" = "or1k" -o "$ARCH" = "hppa" -o "$ARCH" = "alpha" ]; then
+    # clang not supported on sh4, or1k, hppa, alpha
+    BUILD_HOST=NO
+  else
+    BUILD_HOST=YES
+  fi
+fi
+
+if [ -z $BUILD_BOLT ]; then
+  if [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
+    BUILD_BOLT=YES
+  else
+    BUILD_BOLT=NO
+  fi
+fi
+
+if [ -z $BUILD_FLANG ]; then
+  if [ `gcc -dM -E - < /dev/null | grep -c __LP64__` -eq 0 -o "$BUILD_HOST" = "NO" ]; then
+    # flang not supported on 32-bit CPUs
+    BUILD_FLANG=NO
+  else
+    if [ "$ARCH" = "mips64el" -o "$ARCH" = "s390x" ]; then
+      BUILD_FLANG=NO
+    else
+      BUILD_FLANG=YES
+    fi
+  fi
+fi
+
+
+LLVM_ENABLE_PROJECTS="llvm;mlir"
+
+if [ "$BUILD_HOST" = "YES" ]; then
+  ADD_HOST="host;"
+  # Select projects to build:
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};compiler-rt;clang;clang-tools-extra;polly"
+  # Select runtimes to build:
+  LLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES:-"libcxx;libcxxabi"}
+else
+  ADD_HOST=""
+  # Select projects to build:
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};clang"
+fi
+
+if [ "$BUILD_LLD" = "YES" ]; then
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};lld"
+fi
+
+if [ "$BUILD_LLDB" = "YES" ]; then
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};lldb"
+fi
+
+if [ "$BUILD_OPENMP" = "YES" ]; then
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};openmp"
+fi
+
+if [ "$BUILD_BOLT" = "YES" ]; then
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};bolt"
+fi
+
+if [ "$BUILD_FLANG" = "YES" ]; then
+  LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS};flang"
+fi
+
 # Python3 short version:
 PY3=$(python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())' | cut -f 2 -d n | cut -f 1 -d /)
 
@@ -100,6 +182,42 @@
 # Support GCC built for i?86-slackware-linux:
 zcat $CWD/clang.toolchains.32-bit.triple.diff.gz | patch -p2 --verbose || exit 1
 
+# Patch arm: soft float, invalid conversion from unwind state:
+zcat $CWD/arm_soft.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/unwind_state_invalid_conversion.diff.gz | patch -p1 --verbose || exit 1
+
+if [ "${ARCH::3}" = "arm" ]; then
+  # Re-enabling system libunwind, since it searches for aeabi_unwind* function that are
+  # not present in bundled one
+  zcat $CWD/arm_enable_system_libunwind.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" ]; then
+  # Disabling FLOAT16, since it requires mips64 instructions
+  zcat $CWD/mips_disable_float16.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+if [ "$BUILD_HOST" = "NO" ]; then
+  # Disabling arch/triple autodetection, since it does not work without host target
+  zcat $CWD/disable_default_arch_detect.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+# Patch riscv64: AllWinner D1 does not have fence.tso instruction:
+zcat $CWD/riscv64-no-fence.tso.diff.gz | patch -p1 --verbose || exit 1
+
+# Patch alpha: Fix invalid variable name __alpha:
+zcat $CWD/alpha_fix_variable_name.diff.gz | patch -p1 --verbose || exit 1
+
+# Add new architectures (loongarch64, or1k, etc...) to cmake config.guess and config-ix.cmake:
+\cp /usr/share/libtool/build-aux/config.* llvm/cmake/
+zcat $CWD/newarchs.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix incorrect sanitizer data structures for enabled 64bit time_t on 32bit architectures:
+zcat $CWD/sanitizer_time64.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix failing test on mips 32 bit with comparison of long with int:
+zcat $CWD/interception_test_disable_mips.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -107,11 +220,26 @@
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# In bootstrap system, or for architectures that does not support host llvm,
+# clang is not yet available or it could not compile c(++) sources, use gcc
+which clang 2> /dev/null
+if [ $? -eq 0 -a `file -L $(which clang) | grep -c 'shell script'` -eq 0 ]
+then
+  C_COMPILER="clang"
+  CXX_COMPILER="clang++"
+else
+  C_COMPILER="gcc"
+  CXX_COMPILER="g++"
+  LINKER="bfd"
+fi
+
+SLKCFLAGS="$SLKCFLAGS $IGNORE_GNU_EXTENSIONS"
+
 mkdir build
 cd build
   cmake -GNinja \
-    -DCMAKE_C_COMPILER="clang" \
-    -DCMAKE_CXX_COMPILER="clang++" \
+    -DCMAKE_C_COMPILER="$C_COMPILER" \
+    -DCMAKE_CXX_COMPILER="$CXX_COMPILER" \
     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_INSTALL_PREFIX=/usr \
@@ -120,7 +248,7 @@
     -DLLVM_BUILD_LLVM_DYLIB=ON \
     -DLLVM_LINK_LLVM_DYLIB=ON \
     -DCLANG_LINK_CLANG_DYLIB=ON \
-    -DLLVM_USE_LINKER=lld \
+    -DLLVM_USE_LINKER=$LINKER \
     -DLLVM_ENABLE_PROJECTS="$LLVM_ENABLE_PROJECTS" \
     -DLLVM_ENABLE_RUNTIMES="$LLVM_ENABLE_RUNTIMES" \
     -DLLVM_ENABLE_RTTI=ON \
@@ -131,7 +259,8 @@
     -DLLVM_INSTALL_UTILS=ON \
     -DLLVM_BINUTILS_INCDIR=/usr/include \
     -DCLANG_RESOURCE_DIR="../lib${LIBDIRSUFFIX}/clang/$(echo $VERSION | cut -f 1 -d .)" \
-    -DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF;WebAssembly" \
+    -DLLVM_TARGETS_TO_BUILD="${ADD_HOST}AMDGPU;BPF;WebAssembly" \
+    $CMAKE_EXTRA \
     -DLLVM_INCLUDE_BENCHMARKS=OFF \
     -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
     -DCLANG_DEFAULT_PIE_ON_LINUX=ON \
@@ -145,11 +274,28 @@
   DESTDIR=$PKG "$NINJA" install || exit 1
 cd ..
 
+case "$ARCH" in
+  arm) TARGET=$ARCH-slackware-linux-gnueabi ;;
+  armv7hl) TARGET=$ARCH-slackware-linux-gnueabihf ;;
+  mips64el) TARGET=$ARCH-slackware-linux-gnueabi64 ;;
+     *) TARGET=$ARCH-slackware-linux ;;
+esac
+
 # Add symlinks for $ARCH-slackware-linux-{clang,clang++}:
 ( cd $PKG/usr/bin
-  ln -sf clang $ARCH-slackware-linux-clang
-  ln -sf clang++ $ARCH-slackware-linux-clang++
+  ln -sf clang $TARGET-clang
+  ln -sf clang++ $TARGET-clang++
+)
+
+# Add clang target if host clang not built:
+if [ "$BUILD_HOST" = "NO" ]; then
+( cd $PKG/usr/bin
+  SHORTVER=`echo clang-[0-9][0-9] | sed 's/clang-//'`
+  mv clang-$SHORTVER clang-$SHORTVER.orig
+  cat $CWD/clang.target | sed "s/-XX/-$SHORTVER/g" > clang-$SHORTVER
+  chmod 755 clang-$SHORTVER
 )
+fi
 
 # Install clang-static-analyzer:
 for i in ccc c++; do
diff -ur slackware64-current.2/source/d/m4/m4.SlackBuild slackware64-current.3/source/d/m4/m4.SlackBuild
--- slackware64-current.2/source/d/m4/m4.SlackBuild	2021-05-31 21:24:21.170031455 +0200
+++ slackware64-current.3/source/d/m4/m4.SlackBuild	2023-06-15 09:15:36.667957641 +0200
@@ -81,6 +81,9 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Disabled SPARCv8plus instructions (-mcpu=v9):
+sed -i 's/ -mcpu=v9//' configure
+
 CFLAGS="$SLKCFLAGS" \
 ./configure \
   --prefix=/usr \
diff -ur slackware64-current.2/source/d/meson/meson.SlackBuild slackware64-current.3/source/d/meson/meson.SlackBuild
--- slackware64-current.2/source/d/meson/meson.SlackBuild	2021-06-08 22:36:48.082202988 +0200
+++ slackware64-current.3/source/d/meson/meson.SlackBuild	2021-09-18 13:42:53.796941553 +0200
@@ -65,6 +65,16 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
 
+# Meson check only if the compiler supports NEON instructions without
+# checking if CAN compile NEON instructions with selected architecture.
+# Disabling simd-neon for ARMv5 ("arm" ARCH):
+if [ "$ARCH" = "arm" ]; then
+  zcat $CWD/disabling_neon_armv5.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+# Adding new architectures (openrisc):
+zcat $CWD/new_architectures.diff.gz | patch -p1 --verbose || exit 1
+
 python3 setup.py install --root=$PKG || exit 1
 
 mv $PKG/usr/share/man $PKG/usr/
diff -ur slackware64-current.2/source/d/oprofile/oprofile.SlackBuild slackware64-current.3/source/d/oprofile/oprofile.SlackBuild
--- slackware64-current.2/source/d/oprofile/oprofile.SlackBuild	2021-08-28 21:45:51.897177190 +0200
+++ slackware64-current.3/source/d/oprofile/oprofile.SlackBuild	2021-09-18 13:42:53.846944077 +0200
@@ -82,6 +82,11 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Disabling PFMLIB for powerpc platform:
+zcat $CWD/disable_pfm.patch.gz | patch -p1 --verbose || exit 1
+# Adding rmb definition for riscv:
+zcat $CWD/riscv_rmb_definition.diff.gz | patch -p1 --verbose || exit 1
+
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
 ./configure \
diff -ur slackware64-current.2/source/d/perl/perl.SlackBuild slackware64-current.3/source/d/perl/perl.SlackBuild
--- slackware64-current.2/source/d/perl/perl.SlackBuild	2021-05-21 06:51:21.743866987 +0200
+++ slackware64-current.3/source/d/perl/perl.SlackBuild	2025-08-06 10:26:43.536998375 +0200
@@ -146,7 +146,7 @@
 #
 USE_THREADS="-Dusethreads -Duseithreads"
 
-if [ "$ARCH" = "x86_64" ]; then # adopted from "Cross Linux From Scratch"
+if [ "$LIBDIRSUFFIX" = "64" ]; then # adopted from "Cross Linux From Scratch"
   # Configure must be told to also use lib64:
   zcat $CWD/perl.configure.multilib.patch.gz | patch -p1 --verbose || exit 1
   # "perl -V" should report that libc is in /lib64
@@ -181,6 +181,7 @@
   -Dsitelib="/usr/local/share/perl5" \
   -Dsitearch="/usr/local/lib${LIBDIRSUFFIX}/perl5" \
   -Darchlib="/usr/lib${LIBDIRSUFFIX}/perl5" \
+  -Duse64bitint \
   -Dvendorprefix=/usr \
   -Dprivlib="/usr/share/perl5" \
   -Dvendorlib="/usr/share/perl5/vendor_perl" \
diff -ur slackware64-current.2/source/d/poke/poke.SlackBuild slackware64-current.3/source/d/poke/poke.SlackBuild
--- slackware64-current.2/source/d/poke/poke.SlackBuild	2022-01-31 09:45:37.918393279 +0100
+++ slackware64-current.3/source/d/poke/poke.SlackBuild	2023-07-07 15:32:31.178365617 +0200
@@ -86,6 +86,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Disable v9-assembly for sparc32:
+zcat $CWD/jitter_disable_assembly_for_sparc32.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/d/python2/python2.SlackBuild slackware64-current.3/source/d/python2/python2.SlackBuild
--- slackware64-current.2/source/d/python2/python2.SlackBuild	2021-02-13 06:31:55.408945438 +0100
+++ slackware64-current.3/source/d/python2/python2.SlackBuild	2021-09-18 13:42:54.126958210 +0200
@@ -81,12 +81,15 @@
 # We don't want a large libpython*.a:
 zcat $CWD/python.no-static-library.diff.gz | patch -p1 --verbose || exit 1
 
-if [ "$ARCH" = "x86_64" ]; then
+if [ "$LIBDIRSUFFIX" = "64" ]; then
   # Install to lib64 instead of lib and 
   # Python must report /usr/lib64/python2.7/site-packages as python_lib_dir:
   zcat $CWD/python.x86_64.diff.gz | patch -p1 --verbose || exit 1
 fi
 
+# Add _ctypes support for MIPS64
+zcat $CWD/python.mips64-missing-n32-functions.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/d/rust/rust.SlackBuild slackware64-current.3/source/d/rust/rust.SlackBuild
--- slackware64-current.2/source/d/rust/rust.SlackBuild	2024-12-08 23:30:08.167236525 +0100
+++ slackware64-current.3/source/d/rust/rust.SlackBuild	2025-01-07 13:31:22.892614001 +0100
@@ -74,14 +74,18 @@
 fi
 
 # Fail on undeclared variables and broken pipes:
-set -u -o pipefail
+set -o pipefail
 
 # If the bootstrap binaries are present, use those. Otherwise bootstrap from
 # installed compiler.
-if /bin/ls *-unknown-linux-gnu.tar.?z 1> /dev/null 2> /dev/null ; then
+if /bin/ls *-unknown-linux-gnu*.tar.?z 1> /dev/null 2> /dev/null ; then
   LOCAL_BOOTSTRAP=no
 else
-  LOCAL_BOOTSTRAP=yes
+  if [ "$LOCAL_BOOTSTRAP" = "" ] && [ -x /usr/bin/cargo ] && [ -x /usr/bin/rustc ] ; then
+    LOCAL_BOOTSTRAP=yes
+  else
+    LOCAL_BOOTSTRAP=no
+  fi
 fi
 
 # https://forge.rust-lang.org/platform-support.html
@@ -97,6 +101,21 @@
 elif [ "$ARCH" = "armv7hl" ]; then
   BARCH="armv7"
   TARCH="$BARCH"
+elif [ "$ARCH" = "arm" ]; then
+  BARCH="armv5te"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc" ]; then
+  BARCH="powerpc"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc64" ]; then
+  BARCH="powerpc64"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc64le" ]; then
+  BARCH="powerpc64le"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "riscv64" ]; then
+  BARCH="riscv64gc"
+  TARCH="$BARCH"
 else
   BARCH="$ARCH"
   TARCH="$ARCH"
@@ -105,6 +124,10 @@
 # Bootstrapping ABI:
 if [ "$ARCH" = "armv7hl" ]; then
   BABI="gnueabihf"
+elif [ "$ARCH" = "arm" ]; then
+  BABI="gnueabi"
+elif [ "$ARCH" = "mips64el" ]; then
+  BABI="gnuabi64"
 else
   BABI="gnu"
 fi
@@ -129,7 +149,8 @@
 
 # Not needed, as the build will automatically use as many jobs as there are
 # threads.
-#NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+JOBS=`echo $NUMJOBS  | sed 's/-j//'`
 
 if [ "$ARCH" = "i586" ]; then
   LIBDIRSUFFIX=""
@@ -144,15 +167,32 @@
 # Support libdir other than "lib":
 cat $CWD/141729.patch | patch -p1 --verbose || exit 1
 
+# Patch armv5te atomic operations (already defined in libgcc) and rls AtomicU64
+if [ "${ARCH}" = "arm" ]; then
+  (
+  cd vendor/compiler_builtins*
+  ckorig=`sha256sum src/arm_linux.rs | cut -f1 -d' '`
+  zcat $CWD/atomic_builtins_gcc9.diff.gz | patch -p3 --verbose || exit 1
+  cknew=`sha256sum src/arm_linux.rs | cut -f1 -d' '`
+  # Fix cargo checksum for above patch
+  sed -i "s/$ckorig/$cknew/" .cargo-checksum.json
+  ) || exit 1
+fi
+
+# rust-lld was enabled by default in 1.88 even when using external llvm.
+# Reverting behaviour:
+# https://github.com/rust-lang/rust/pull/143255
+zcat $CWD/disable_rust-lld_by_default.diff.gz | patch -p1 --verbose || exit 1
+
 if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
   # rust requires bootstrapping with the previous rust version.
   # versions are defined in src/stage0.txt.
   mkdir -p build/cache/$RSTAGE0_DIR
-  cp $CWD/$PKGNAM-std-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z \
-     $CWD/$SRCNAM-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z \
+  cp $CWD/$PKGNAM-std-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z \
+     $CWD/$SRCNAM-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z \
      build/cache/$RSTAGE0_DIR
   mkdir -p build/cache/$CSTAGE0_DIR
-  cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z build/cache/$CSTAGE0_DIR
+  cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z build/cache/$CSTAGE0_DIR
 fi
 
 # Build configuration:
@@ -192,7 +212,6 @@
 profile = "dist"
 
 [llvm]
-ccache = "/usr/bin/ccache"
 link-shared = true
 download-ci-llvm = false
 
@@ -208,6 +229,7 @@
 # Do not query new versions of dependencies online.
 locked-deps = true
 $BUILDDOCS_OPTION
+jobs = $JOBS
 
 [install]
 prefix = "/usr"
@@ -201,8 +236,45 @@
 [target.x86_64-unknown-linux-gnu]
 llvm-config = "/usr/bin/llvm-config"
 
+[target.arm-unknown-linux-gnueabi]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.armv5te-unknown-linux-gnueabi]
+llvm-config = "/usr/bin/llvm-config"
+
 [target.armv7-unknown-linux-gnueabihf]
 llvm-config = "/usr/bin/llvm-config"
+
+[target.aarch64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc64le-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mips-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mipsel-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mips64el-unknown-linux-gnuabi64]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.riscv64gc-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.s390x-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.loongarch64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
 EOF
 fi
 
@@ -236,6 +308,12 @@
   fi
 fi
 
+# On mips[el] from rust 1.74, the error "Undefined temporary symbol $BB217_1" will raise by newer rust. 
+# Adding "-C opt-level=1" is a workaround
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" ]; then
+  export RUSTFLAGS="$RUSTFLAGS -C opt-level=1"
+fi
+
 # Fix path to the rust libraries in rust-analyzer:
 if [ -r src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs ]; then
   if [ ! "$LIBDIRSUFFIX" = "" ]; then
@@ -283,7 +361,7 @@
 
 # Evidently there are a lot of duplicated libraries in this tree, so let's
 # try to save some space:
-( cd $PKG/usr/lib${LIBDIRSUFFIX}/rustlib/*-linux-gnu/lib && for file in *.so ; do if cmp -s $file ../../../$file ; then ln -sf ../../../$file .; fi; done )
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/rustlib/*-linux-gnu*/lib && for file in *.so ; do if cmp -s $file ../../../$file ; then ln -sf ../../../$file .; fi; done )
 
 # Strip ELF objects:
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
diff -ur slackware64-current.2/source/d/rust-bindgen/rust-bindgen.SlackBuild slackware64-current.3/source/d/rust-bindgen/rust-bindgen.SlackBuild
--- slackware64-current.2/source/d/rust-bindgen/rust-bindgen.SlackBuild	2021-09-09 19:19:52.527012986 +0200
+++ slackware64-current.3/source/d/rust-bindgen/rust-bindgen.SlackBuild	2021-09-18 13:42:54.186961238 +0200
@@ -98,6 +98,37 @@
 directory = "vendor"
 EOF
 
+# rustix uses now by default linux_raw backend for syscalls, but seems supported only
+# for aarch64, arm, mipsel, mips64el, powerpc64le, riscv64, x86, and x86_64.
+# Re-add real errno for other architectures, or you can pass "--cfg=rustix_use_libc" 
+# to force libc usage.
+case "$ARCH" in
+  mips|ppc|ppc64|s390x|loongarch64) 
+    (cd vendor
+     rm -rf errno
+     tar xvf $CWD/errno-*.tar.lz
+     for r in rustix*
+     do
+       (cd $r
+       perl -n -e '
+	 if(m/dependencies.libc_errno/) { $status=1; }
+	 if($status && m/"0.3.[012]"/) {
+	   s/"0.3.[012]"/"0.3.3"/;
+	   $status=0;
+	 }
+	 print;
+       ' Cargo.toml > Cargo.toml.tmp
+       \mv Cargo.toml.tmp Cargo.toml
+       cat .cargo-checksum.json  | perl -e '($newck)=split(" ",$ARGV[0]);while(<STDIN>) { s/("Cargo.toml":)"(\S+?)"/$1"$newck"/; print;}' `sha256sum Cargo.toml` > .cargo-checksum.json.tmp
+       \mv .cargo-checksum.json.tmp .cargo-checksum.json
+       )
+     done
+    )
+    #SLKRUSTFLAGS="--cfg=rustix_use_libc"
+    ;;
+esac
+
+RUSTFLAGS="$SLKRUSTFLAGS" \
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
 RUSTONIG_DYNAMIC_LIBONIG=1 \
@@ -104,13 +104,12 @@
 cargo build \
   --offline \
   --release \
-  --target $ARCH-unknown-linux-gnu \
   --verbose \
   $NUMJOBS || exit 1
 
 mkdir -p $PKG/usr/bin
-install -m 755 target/$ARCH-unknown-linux-gnu/release/bindgen \
-  $PKG/usr/bin/
+install -m 755 target/release/bindgen \
+  $PKG/usr/bin/ || exit 1
 
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff -ur slackware64-current/source/d/slacktrack/slacktrack.SlackBuild slackware64-current.2/source/d/slacktrack/slacktrack.SlackBuild
--- slackware64-current/source/d/slacktrack/slacktrack.SlackBuild	2024-11-22 09:34:48.000000000 +0100
+++ slackware64-current.2/source/d/slacktrack/slacktrack.SlackBuild	2025-01-07 13:31:22.992619350 +0100
@@ -8,6 +8,7 @@
 PKGNAM=slacktrack
 export VERSION=2.24
 # Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
 case "$( uname -m )" in
   i?86)    export ARCH=i686
            PKGEXT=txz ;;
@@ -15,6 +16,7 @@
      *)    export ARCH=$( uname -m )
            PKGEXT=txz ;;
 esac
+fi
 BUILD=${BUILD:-1}
 export BUILD
 
@@ -34,5 +36,8 @@
 tar xvf $CWD/slacktrack-$VERSION-source.tar.xz
 cd slacktrack-project || exit 1
 
+# Fix incorrect ARCH assignment if already set
+zcat $CWD/fix_already_set_arch.patch.gz | patch -p1
+
 # Start the "real" SlackBuild:
 ./slacktrack.SlackBuild
diff -ur slackware64-current.2/source/d/vala/vala.SlackBuild slackware64-current.3/source/d/vala/vala.SlackBuild
--- slackware64-current.2/source/d/vala/vala.SlackBuild	2025-06-13 14:37:05.659192007 +0200
+++ slackware64-current.3/source/d/vala/vala.SlackBuild	2025-07-17 13:38:22.584141419 +0200
@@ -99,6 +99,13 @@
 fi
 
 make $NUMJOBS || make || exit 1
+
+# or1k not able to build devhelp from vala 0.56.18, put a placeholder to avoid installation errors
+if [ `ls doc/manual/devhelp/ | wc -l` -eq 0 ]
+then
+  echo "Unable to build devhelp" > doc/manual/devhelp/placeholder.txt
+fi
+
 make install DESTDIR=$PKG || exit 1
 
 # Don't ship .la files:
diff -ur slackware64-current/source/e/emacs/emacs.SlackBuild slackware64-current.2/source/e/emacs/emacs.SlackBuild
--- slackware64-current/source/e/emacs/emacs.SlackBuild	2024-07-21 04:37:31.065159446 +0200
+++ slackware64-current.2/source/e/emacs/emacs.SlackBuild	2025-01-07 13:31:23.262633792 +0100
@@ -115,6 +115,9 @@
 tar xvf $CWD/$SRCNAM-$TARBALLVER.tar.xz || exit 1
 cd $SRCNAM-$SRCDIRVER || exit 1
 
+# Fix incorrect SIGSTKSZ on or1k:
+zcat $CWD/sigstksz_or1k.diff.gz  | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/installer/build_installer.sh slackware64-current.3/source/installer/build_installer.sh
--- slackware64-current.2/source/installer/build_installer.sh	2024-09-12 22:19:54.662013459 +0200
+++ slackware64-current.3/source/installer/build_installer.sh	2024-09-13 13:44:37.107966821 +0200
@@ -97,7 +97,7 @@
     ADD_ALLMODS=0         # add all the kernel modules
     ADD_MANPAGES=1
     COMPRESS_MODS=0       # already compressed in a/kernel-modules.t?z package already
-    COMPRESSSUFFIX=".xz"  # if the modules are compressed already we might need this
+    #COMPRESSSUFFIX=".xz"  # if the modules are compressed already we might need this
     DISTRODIR=${DISTRODIR:-"slackware"} # below this you find a,ap,d,..,y
     LIBDIRSUFFIX=${LIBDIRSUFFIX:-""} # the default
     RECOMPILE=1           # recompile busybox/dropbear and add new binaries
@@ -152,10 +152,10 @@
     ADD_NETMODS=1         # add network modules
     ADD_PCMCIAMODS=1      # add pcmcia modules
     ADD_MANPAGES=1        # Add preprocessed manpages
-    DISTRODIR=${DISTRODIR:-"slackware"} # below this you find a,ap,d,..,y
+    #DISTRODIR=${DISTRODIR:-"slackware"} # below this you find a,ap,d,..,y
     COMPRESS_MODS=1       # compress kernel modules
     COMPRESSSUFFIX=""
-    LIBDIRSUFFIX=""       # the default
+    #LIBDIRSUFFIX=""       # the default
     RECOMPILE=0           # re-use binaries from existing initrd and packages
     SPLIT_INITRD=0        # Do not create separate initrd for each kernel
     USBBOOT=0             # do not build the USB boot image
diff -ur slackware64-current.2/source/installer/installer.SlackBuild slackware64-current.3/source/installer/installer.SlackBuild
--- slackware64-current.2/source/installer/installer.SlackBuild	2022-09-06 20:27:30.645132064 +0200
+++ slackware64-current.3/source/installer/installer.SlackBuild	2023-05-01 20:57:27.969137234 +0200
@@ -49,6 +49,10 @@
   export ARCH
 fi
 
+if [ -z "$OUTPUT" ]; then
+  OUTPUT=$TMP/installer
+fi
+
 NUMJOBS=${NUMJOBS:-" -j7 "}
 
 mkdir -p $OUTPUT
diff -ur slackware64-current.2/source/kde/kde/cmake/akonadi slackware64-current.3/source/kde/kde/cmake/akonadi
--- slackware64-current.2/source/kde/kde/cmake/akonadi	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/akonadi	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,28 @@
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "arm" -o "$ARCH" = "ppc" -o "$ARCH" = "sh4" -o "$ARCH" = "or1k" -o "$ARCH" = "sparc" ]
+then
+  CMAKE_EXTRA="-DCMAKE_EXE_LINKER_FLAGS=-latomic"
+fi
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DLIBEXEC_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    $CMAKE_EXTRA \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/cmake/digikam slackware64-current.3/source/kde/kde/cmake/digikam
--- slackware64-current.2/source/kde/kde/cmake/digikam	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/digikam	2021-09-18 13:42:54.216962753 +0200
@@ -1,3 +1,8 @@
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "arm" -o "$ARCH" = "ppc" ]
+then
+  CMAKE_EXTRA="-DCMAKE_SHARED_LINKER_FLAGS=-latomic"
+fi
+
 mkdir cmake-build
 cd cmake-build
   cmake \
@@ -17,6 +22,7 @@
     -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
     -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
     -DBUILD_TESTING=OFF \
+    $CMAKE_EXTRA \
     -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
     -DPYTHON_EXECUTABLE=/usr/bin/python3 \
     -DENABLE_KFILEMETADATASUPPORT=ON \
diff -ur slackware64-current.2/source/kde/kde/cmake/kdenetwork-filesharing slackware64-current.3/source/kde/kde/cmake/kdenetwork-filesharing
--- slackware64-current.2/source/kde/kde/cmake/kdenetwork-filesharing	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/kdenetwork-filesharing	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,29 @@
+if [ "$ARCH" = "riscv64" ]
+then
+  CMAKE_EXTRA="-DCMAKE_MODULE_LINKER_FLAGS=-latomic"
+fi
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    -DPYTHON_EXECUTABLE=/usr/bin/python3 \
+    $CMAKE_EXTRA \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/cmake/kmouth slackware64-current.3/source/kde/kde/cmake/kmouth
--- slackware64-current.2/source/kde/kde/cmake/kmouth	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/kmouth	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,23 @@
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DKF_IGNORE_PLATFORM_CHECK=TRUE \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/cmake/krita slackware64-current.3/source/kde/kde/cmake/krita
--- slackware64-current.2/source/kde/kde/cmake/krita	2021-09-30 19:56:09.556980609 +0200
+++ slackware64-current.3/source/kde/kde/cmake/krita	2022-07-26 12:11:11.111111111 +0200
@@ -1,3 +1,12 @@
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "arm" -o "$ARCH" = "riscv64" -o "$ARCH" = "sh4" -o "$ARCH" = "or1k" -o "$ARCH" = "sparc" ]
+then
+  CMAKE_EXTRA="-DCMAKE_SHARED_LINKER_FLAGS=-latomic"
+fi
+if [ "$ARCH" = "or1k" ]
+then
+  SLKCFLAGS="-O2 -mcmodel=large"
+fi
+
 mkdir cmake-build
 cd cmake-build
   cmake \
@@ -17,6 +22,7 @@
     -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
     -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
     -DBUILD_TESTING=OFF \
+    $CMAKE_EXTRA \
     -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
     -DPYTHON_EXECUTABLE=/usr/bin/python3 \
     -DBUILD_KRITA_QT_DESIGNER_PLUGINS=ON \
diff -ur slackware64-current.2/source/kde/kde/cmake/ktimer slackware64-current.3/source/kde/kde/cmake/ktimer
--- slackware64-current.2/source/kde/kde/cmake/ktimer	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/ktimer	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,23 @@
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DKF_IGNORE_PLATFORM_CHECK=TRUE \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/cmake/kwin slackware64-current.3/source/kde/kde/cmake/kwin
--- slackware64-current.2/source/kde/kde/cmake/kwin	2000-01-01 01:01:01.000000000 +0200
+++ slackware64-current.3/source/kde/kde/cmake/kwin		2024-03-19 11:09:56.174717894 +0100
@@ -0,0 +1,29 @@
+if [ "$ARCH" = "or1k" ]
+then
+  SLKCFLAGS="-O2 -mcmodel=large"
+fi
+
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    -DPYTHON_EXECUTABLE=/usr/bin/python3 \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/cmake/syntax-highlighting slackware64-current.3/source/kde/kde/cmake/syntax-highlighting
--- slackware64-current.2/source/kde/kde/cmake/syntax-highlighting	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/cmake/syntax-highlighting	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,28 @@
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" -o "$ARCH" = "arm" -o "$ARCH" = "ppc" -o "$ARCH" = "or1k" -o "$ARCH" = "sh4" ]
+then
+  CMAKE_EXTRA="-DCMAKE_SHARED_LINKER_FLAGS=-latomic"
+fi
+mkdir cmake-build
+cd cmake-build
+  cmake \
+    $KDE_OPT_ARGS \
+    -DKDE_PLATFORM_FEATURE_DISABLE_DEPRECATED=TRUE \
+    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DMAN_INSTALL_DIR=/usr/man \
+    -DSYSCONF_INSTALL_DIR=/etc/kde \
+    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DLIB_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DLIBEXEC_INSTALL_DIR=lib$LIBDIRSUFFIX \
+    -DQT_PLUGIN_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/plugins \
+    -DQML_INSTALL_DIR=lib$LIBDIRSUFFIX/qt5/qml \
+    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
+    -DBUILD_TESTING=OFF \
+    -DQca-qt5_DIR=/usr/lib${LIBDIRSUFFIX}/cmake/Qca \
+    $CMAKE_EXTRA \
+    ..
+
diff -ur slackware64-current.2/source/kde/kde/patch/calligra/upstream_Small-CMake-modernization.patch slackware64-current.3/source/kde/kde/patch/calligra/upstream_Small-CMake-modernization.patch
--- slackware64-current.2/source/kde/kde/patch/calligra/upstream_Small-CMake-modernization.patch	2022-03-20 09:16:28.000000000 +0100
+++ slackware64-current.3/source/kde/kde/patch/calligra/upstream_Small-CMake-modernization.patch	2025-07-06 21:28:25.271607422 +0200
@@ -18,7 +18,7 @@
 index fe6502493ed..b237f68fcb6 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -4,24 +4,9 @@ project(calligra)
+@@ -4,24 +4,6 @@ project(calligra)
  
  message(STATUS "Using CMake version: ${CMAKE_VERSION}")
  
@@ -28,9 +28,9 @@
 -if (POLICY CMP0017)
 -    cmake_policy(SET CMP0017 NEW)
 -endif ()
- if (POLICY CMP0022)
-     cmake_policy(SET CMP0022 OLD)
- endif ()
+-if (POLICY CMP0022)
+-    cmake_policy(SET CMP0022 OLD)
+-endif ()
 -if (POLICY CMP0026)
 -    cmake_policy(SET CMP0026 OLD)
 -endif()
diff -ur slackware64-current.2/source/kde/kde/patch/digikam.patch slackware64-current.3/source/kde/kde/patch/digikam.patch
--- slackware64-current.2/source/kde/kde/patch/digikam.patch	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/patch/digikam.patch	2021-10-18 10:41:27.365616223 +0200
@@ -0,0 +1,2 @@
+# Fix missing bigendian on MIPS32:
+cat $CWD/patch/digikam/bigendian.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/kde/kde/patch/extra-cmake-modules.patch.disabled slackware64-current.3/source/kde/kde/patch/extra-cmake-modules.patch.disabled
--- slackware64-current.2/source/kde/kde/patch/extra-cmake-modules.patch.disabled	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/patch/extra-cmake-modules.patch.disabled	2021-09-18 13:42:54.216962753 +0200
@@ -0,0 +1,2 @@
+# Fix incorrect generation for aarch64:
+cat $CWD/patch/extra-cmake-modules/sip_generator.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/kde/kde/patch/kdevelop-pg-qt.patch slackware64-current.3/source/kde/kde/patch/kdevelop-pg-qt.patch
--- slackware64-current.2/source/kde/kde/patch/kdevelop-pg-qt.patch	2020-10-15 01:30:57.815498320 +0200
+++ slackware64-current.3/source/kde/kde/patch/kdevelop-pg-qt.patch	2023-05-12 19:59:17.441802793 +0200
@@ -0,0 +1,2 @@
+# Fix misaligned allocation (only MIPS64 and SPARC64 are affected):
+cat $CWD/patch/kdevelop-pg-qt/aligned_allocate.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/kde/kde/patch/kdevelop.patch slackware64-current.3/source/kde/kde/patch/kdevelop.patch
--- slackware64-current.2/source/kde/kde/patch/kdevelop.patch	2025-07-09 02:07:08.322085211 +0200
+++ slackware64-current.3/source/kde/kde/patch/kdevelop.patch	2025-07-15 19:30:25.103910116 +0200
@@ -0,0 +1 @@
+cat $CWD/patch/kdevelop/cmake_CMP0063.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/kde/kde/patch/umbrello.patch slackware64-current.3/source/kde/kde/patch/umbrello.patch
--- slackware64-current.2/source/kde/kde/patch/umbrello.patch	2025-07-09 02:07:08.322085211 +0200
+++ slackware64-current.3/source/kde/kde/patch/umbrello.patch	2025-07-16 13:26:21.373788380 +0200
@@ -0,0 +1 @@
+cat $CWD/patch/umbrello/cmake_CMP0028.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/l/Imath/Imath.SlackBuild slackware64-current.3/source/l/Imath/Imath.SlackBuild
--- slackware64-current.2/source/l/Imath/Imath.SlackBuild	2025-08-27 21:09:46.882269320 +0200
+++ slackware64-current.3/source/l/Imath/Imath.SlackBuild	2025-08-29 20:44:50.207554691 +0200
@@ -72,6 +72,11 @@
 rm -rf $PKGNAM-$VERSION
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
 cd $PKGNAM-$VERSION || exit 1
+
+# On Alpha, cmake is not able to detect numpy include dir.
+# Make a symbolic link into sources:
+ln -s  /usr/lib$LIBDIRSUFFIX/python3*/site-packages/numpy/_core/include/numpy src/Imath/numpy
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/aalib/aalib.SlackBuild slackware64-current.3/source/l/aalib/aalib.SlackBuild
--- slackware64-current.2/source/l/aalib/aalib.SlackBuild	2021-02-13 06:31:56.092945400 +0100
+++ slackware64-current.3/source/l/aalib/aalib.SlackBuild	2021-09-18 13:42:54.276965781 +0200
@@ -71,7 +71,8 @@
 tar xvf $CWD/${PKGNAM}-$VERSION.tar.gz || exit 1
 cd ${PKGNAM}-${SRCVER} || exit 1
 #cp /usr/share/libtool/config.{guess,sub} .             # libtool-1.x
-cp /usr/share/libtool/config/config.{guess,sub} .       # libtool-2.x
+#cp /usr/share/libtool/config/config.{guess,sub} .       # libtool-2.x
+\cp /usr/share/libtool/build-aux/config.* . 
 sed -i -e "s# -lslang# -lslang1#" configure
 
 zcat $CWD/aalib-aclocal.patch.gz | patch -p1 --verbose || exit 1
diff -ur slackware64-current.2/source/l/abseil-cpp/abseil-cpp.SlackBuild slackware64-current.3/source/l/abseil-cpp/abseil-cpp.SlackBuild
--- slackware64-current.2/source/l/abseil-cpp/abseil-cpp.SlackBuild	2024-04-06 20:29:52.442582216 +0200
+++ slackware64-current.3/source/l/abseil-cpp/abseil-cpp.SlackBuild	2024-05-30 11:34:14.793585046 +0200
@@ -78,6 +78,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Adding or1k in the list of architectures supporting mmap2 and program counter context:
+zcat $CWD/adding_or1k_support.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -94,6 +94,7 @@
     -DMAN_INSTALL_DIR=/usr/man \
     -DCMAKE_CXX_STANDARD=17 \
     -DBUILD_SHARED_LIBS=ON \
+    $CMAKE_EXTRA \
     .. || exit 1
   make $NUMJOBS || make || exit 1
   make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/l/aom/aom.SlackBuild slackware64-current.3/source/l/aom/aom.SlackBuild
--- slackware64-current.2/source/l/aom/aom.SlackBuild	2024-05-10 13:31:52.270717603 +0200
+++ slackware64-current.3/source/l/aom/aom.SlackBuild	2025-02-18 16:15:48.244901196 +0100
@@ -80,6 +80,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# AOM incorrectly redefines neon gcc's builtins: comment out them:
+zcat $CWD/arm_no_neon_redefine.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -99,6 +99,7 @@
     -DENABLE_DOCS=0 \
     -DBUILD_SHARED_LIBS=1 \
     -DENABLE_TESTS=0 \
+    $CMAKE_EXTRA \
     .. || exit 1
   make $NUMJOBS || make || exit 1
   make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/l/apr/apr.SlackBuild slackware64-current.3/source/l/apr/apr.SlackBuild
--- slackware64-current.2/source/l/apr/apr.SlackBuild	2023-02-01 22:28:25.912750044 +0100
+++ slackware64-current.3/source/l/apr/apr.SlackBuild	2023-07-27 14:25:42.455046559 +0200
@@ -78,7 +82,11 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Fix incorrect mutex definitions for or1k:
+zcat $CWD/proc_mutex.diff.gz | patch -p1 --verbose || exit 1
+
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
diff -ur slackware64-current.2/source/l/argon2/argon2.SlackBuild slackware64-current.3/source/l/argon2/argon2.SlackBuild
--- slackware64-current.2/source/l/argon2/argon2.SlackBuild	2024-08-22 14:34:35.632037061 +0200
+++ slackware64-current.3/source/l/argon2/argon2.SlackBuild	2024-08-23 03:21:19.518174809 +0200
@@ -91,8 +91,8 @@
 sed -i "s/LIBRARY_REL ?= lib.*/LIBRARY_REL = lib${LIBDIRSUFFIX}/g" Makefile
 sed -i "s/CFLAGS += -march=\$(OPTTARGET)/CFLAGS += ${SLKCFLAGS}/g" Makefile
 
-make || exit 1
-make install DESTDIR=$PKG || exit 1
+OPTTARGET=$ARCH make || exit 1
+OPTTARGET=$ARCH make install DESTDIR=$PKG || exit 1
 
 # Ditch static library:
 rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libargon2.a
diff -ur slackware64-current.2/source/l/boost/boost.SlackBuild slackware64-current.3/source/l/boost/boost.SlackBuild
--- slackware64-current.2/source/l/boost/boost.SlackBuild	2024-11-04 02:11:21.013796446 +0100
+++ slackware64-current.3/source/l/boost/boost.SlackBuild	2024-12-06 12:22:02.603699317 +0100
@@ -78,6 +78,26 @@
 tar xf $CWD/boost_$VERSION.tar.?z || exit 1
 cd boost_$VERSION || exit 1
 
+# From 1.77 BOOST_MATH_NO_ATOMIC_INT was removed from bernoulli code.
+# Reintegrate it:
+zcat $CWD/reintegrate_BOOST_MATH_NO_ATOMIC_INT.diff.gz | patch -p1 --verbose || exit 1
+# Change -mcpu=v7 to -mcpu=leon3 for sparc to support atomic operation (otherwise
+# "Boost.Atomic unsupported target platform: native atomic operations not implemented for bytes):
+zcat $CWD/sparc_cpu_leon3.diff.gz | patch -p1 --verbose || exit 1
+# PowerPC has custom long-double implementation, disable it on "from_chars" function:
+zcat $CWD/disable_from_chars_long-double_powerpc.diff.gz | patch -p1 --verbose || exit 1
+# With newer compiler duplicate case are errors, avoid in architectures that supports both
+# SIGPWR and SIGINFO (synonyms):
+zcat $CWD/sigpwr_siginfo_duplicate_case.diff.gz | patch -p1 --verbose || exit 1
+
+# Avoid error " On this platform memory leaks are possible if capturing stacktrace from exceptions 
+# is enabled and exceptions are thrown concurrently and libc++ runtime is used. 
+# Define `BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK` to suppress this error if the 
+# library would not be used with libc++ runtime (for example, it would be only used with GCC runtime).
+# Otherwise, disable the boost_stacktrace_from_exception library build (for example by 
+# `./b2 boost.stacktrace.from_exception=off` option).
+SLKCFLAGS="$SLKCFLAGS -DBOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK"
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -143,6 +163,20 @@
 cp -a LICENSE* index.html $PKG/usr/doc/boost-$PKG_VERSION
 find $PKG/usr/doc -type f -exec chmod 0644 {} \+
 
+# hppa, or1k, and sh4: from boost 1.86 address-model no more detected.
+# Fix cmake files post installation:
+if [ "$ARCH" = "hppa" -o "$ARCH" = "or1k"  -o "$ARCH" = "sh4" ]
+then
+  if [ `cat  $PKG/usr/lib/cmake/boost*/lib* | grep -c 'CMAKE_SIZEOF_VOID_P EQUAL 4'` -gt 0 ]
+  then
+    sed -i 's/CMAKE_SIZEOF_VOID_P EQUAL 4/CMAKE_SIZEOF_VOID_P EQUAL 8/' $PKG/usr/lib/cmake/boost*/lib*
+  else
+    echo "WARNING: address-model detection fixed for $ARCH"
+    touch $PKG/usr/doc/boost-$PKG_VERSION/address-model-fixed
+    sleep 120
+  fi
+fi
+
 mkdir -p $PKG/install
 cat $CWD/slack-desc > $PKG/install/slack-desc
 
diff -ur slackware64-current.2/source/l/chmlib/chmlib.SlackBuild slackware64-current.3/source/l/chmlib/chmlib.SlackBuild
--- slackware64-current.2/source/l/chmlib/chmlib.SlackBuild	2021-02-13 06:31:56.568945374 +0100
+++ slackware64-current.3/source/l/chmlib/chmlib.SlackBuild	2021-09-18 13:42:54.346969315 +0200
@@ -70,6 +70,13 @@
 rm -rf chmlib-$VERSION
 tar xvf $CWD/chmlib-$VERSION.tar.?z* || exit 1
 cd chmlib-$VERSION || exit 1 || exit 1
+
+# These patches are still needed for arm:
+for i in src_chm_lib.c.diff.gz src_extract_chmLib.c.diff.gz
+do
+  zcat $CWD/$i | patch -p1
+done
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/cryfs/cryfs.SlackBuild slackware64-current.3/source/l/cryfs/cryfs.SlackBuild
--- slackware64-current.2/source/l/cryfs/cryfs.SlackBuild	2021-02-13 06:31:56.635945370 +0100
+++ slackware64-current.3/source/l/cryfs/cryfs.SlackBuild	2021-09-18 13:42:54.396971838 +0200
@@ -79,6 +79,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix building for bigendian or1k
+sed -i -e "s/defined(__ARMEB__)/defined(__ARMEB__) || defined(__or1k__)/" vendor/cryptopp/vendor_cryptopp/config.h
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -89,6 +89,12 @@
 # Oddly, cryfs expects a static boost, so we'll need to hit it with the LART:
 export LDFLAGS="$SLKLDFLAGS -lboost_thread -lboost_program_options -lboost_filesystem -lboost_chrono -lcryptopp -lfuse"
 
+case "$ARCH" in
+  arm|mips|mipsel|ppc|or1k|sh4)
+    export LDFLAGS="$LDFLAGS -latomic"
+    ;;
+esac
+
 # gcc11 fixes:
 zcat $CWD/27587ea1acec5f939a31217f1c43953378f18821.patch.gz | patch -p1 --verbose || exit 1
 
diff -ur slackware64-current.2/source/l/cryptopp/cryptopp.SlackBuild slackware64-current.3/source/l/cryptopp/cryptopp.SlackBuild
--- slackware64-current.2/source/l/cryptopp/cryptopp.SlackBuild	2021-02-13 06:31:56.635945370 +0100
+++ slackware64-current.3/source/l/cryptopp/cryptopp.SlackBuild	2021-09-18 13:42:54.396971838 +0200
@@ -95,6 +95,11 @@
 # Cater to 64-bit Slackware:
 sed -i -e "s,(PREFIX)/lib,(PREFIX)/lib${LIBDIRSUFFIX},g" GNUmakefile
 
+# Disable NEON on armv5:
+sed -i -e "s/if defined(__arm__) || defined(__ARM_NEON)/if defined(__ARM_NEON)/" config.h
+# Fix building for bigendian or1k
+sed -i -e "s/defined(__ARMEB__)/defined(__ARMEB__) || defined(__or1k__)/" config.h
+
 # Compile and install:
 make all dynamic libcryptopp.pc $NUMJOBS \
   CXXFLAGS="${SLKCFLAGS} -DNDEBUG" LDFLAGS="${LDFLAGS}"
diff -ur slackware64-current.2/source/l/elfutils/elfutils.SlackBuild slackware64-current.3/source/l/elfutils/elfutils.SlackBuild
--- slackware64-current.2/source/l/elfutils/elfutils.SlackBuild	2024-10-21 10:48:00.569056539 +0200
+++ slackware64-current.3/source/l/elfutils/elfutils.SlackBuild	2025-05-19 10:56:25.766713128 +0200
@@ -71,6 +71,10 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
 cd $PKGNAM-$VERSION
 
+# asm/perf_regs.h is not present on all architectures, fix it:
+# (https://sourceware.org/bugzilla/show_bug.cgi?id=32930)
+zcat $CWD/perf_regs.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/ffmpeg/ffmpeg.SlackBuild slackware64-current.3/source/l/ffmpeg/ffmpeg.SlackBuild
--- slackware64-current.2/source/l/ffmpeg/ffmpeg.SlackBuild	2024-02-09 00:19:22.862311554 +0100
+++ slackware64-current.3/source/l/ffmpeg/ffmpeg.SlackBuild	2025-02-08 17:37:55.484965195 +0100
@@ -198,6 +198,9 @@
 tar xf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix arm assembly not-decimal label[s] (no more accepted on binutils-2.43):
+#zcat $CWD/binutils243_arm.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find -L . \
  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -213,6 +219,7 @@
 
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -234,6 +241,7 @@
   $fontconfig \
   $freetype \
   $fribidi \
+  $EXTRACONF \
   $gnutls \
   $ladspa \
   $libass \
diff -ur slackware64-current.2/source/l/fftw/fftw.SlackBuild slackware64-current.3/source/l/fftw/fftw.SlackBuild
--- slackware64-current.2/source/l/fftw/fftw.SlackBuild	2023-10-05 21:37:51.119130844 +0200
+++ slackware64-current.3/source/l/fftw/fftw.SlackBuild	2025-05-06 15:11:27.474912485 +0200
@@ -54,18 +54,42 @@
 PKG=$TMP/package-$PKGNAM-$VERSION
 OUTPUT=${OUTPUT:-$TMP}
 
+QUAD=""
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
   SIMD="--enable-sse2 --disable-avx"
+  SIMDF="$SIMD"
+  QUAD="yes"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   LIBDIRSUFFIX="64"
   SIMD="--enable-sse2 --disable-avx"
-else
-  SLKCFLAGS="-O2"
+  SIMDF="$SIMD"
+  QUAD="yes"
+elif [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  LIBDIRSUFFIX=""
+  SIMD="--disable-sse2 --disable-avx"
+  SIMDF="$SIMD"
+  QUAD="yes"
+elif [ "$ARCH" = "armv7hl" ]; then
+  SLKCFLAGS="-O2 -fPIC"
   LIBDIRSUFFIX=""
   SIMD=""
+  SIMDF="--enable-neon"
+elif [ "$ARCH" = "aarch64" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX="64"
+  SIMD=""
+  SIMDF="$SIMD"
+else
+  SLKCFLAGS=${SLKCFLAGS:-"-O2"}
+  LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
+  SIMD=${SIMD:-""}
+  SIMDF=${SIMDF:-""}
+  QUAD=${QUAD:-""}
 fi
 
 rm -rf $PKG
@@ -114,7 +146,7 @@
     --enable-threads \
     --enable-openmp \
     --enable-float \
-    $SIMD \
+    $SIMDF \
     --build=$ARCH-slackware-linux || exit 1
 
 make $NUMJOBS || make || exit 1
@@ -141,6 +177,8 @@
 make install-strip DESTDIR=$PKG || exit 1
 make clean
 
+if [ "$QUAD" != "" ]
+then
 # compile libfftw3q
 ./configure \
     --prefix=/usr \
@@ -159,6 +201,7 @@
 
 make $NUMJOBS || make || exit 1
 make install-strip DESTDIR=$PKG || exit 1
+fi
 
 # Don't ship .la files:
 rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
diff -ur slackware64-current.2/source/l/fuse/fuse.SlackBuild slackware64-current.3/source/l/fuse/fuse.SlackBuild
--- slackware64-current.2/source/l/fuse/fuse.SlackBuild	2021-02-13 06:31:57.244945337 +0100
+++ slackware64-current.3/source/l/fuse/fuse.SlackBuild	2021-09-18 13:42:54.546979410 +0200
@@ -72,6 +72,10 @@
 rm -rf $PKGNAM-$VERSION
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
 cd $PKGNAM-$VERSION || exit 1
+
+# Fix AArch64 already defined __u64/__s64/__u32/__s32/__u16:
+zcat $CWD/fuse_kernel-types.patch.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/gc/gc.SlackBuild slackware64-current.3/source/l/gc/gc.SlackBuild
--- slackware64-current.2/source/l/gc/gc.SlackBuild	2021-02-13 06:31:57.244945337 +0100
+++ slackware64-current.3/source/l/gc/gc.SlackBuild	2021-09-18 13:42:54.546979410 +0200
@@ -74,6 +74,11 @@
 tar xvf $CWD/libatomic_ops-$LAO_VERSION.tar.?z || exit 1
 mv libatomic_ops-$LAO_VERSION libatomic_ops
 
+if [ "$ARCH" = "sparc" ]; then
+  # Disable sparcv9 code:
+  zcat $CWD/atomic_ops_sparcv8.diff.gz | patch -p1 --verbose || exit 1
+fi
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/gjs/gjs.SlackBuild slackware64-current.3/source/l/gjs/gjs.SlackBuild
--- slackware64-current.2/source/l/gjs/gjs.SlackBuild	2024-09-17 19:19:45.747016995 +0200
+++ slackware64-current.3/source/l/gjs/gjs.SlackBuild	2025-01-07 13:31:25.242739701 +0100
@@ -78,6 +78,7 @@
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
+export LDFLAGS="$SLKLDFLAGS"
 mkdir meson-build
 cd meson-build
 # Use "unshare -n" to avoid downloading sysprof:
diff -ur slackware64-current.2/source/l/glibc/glibc.SlackBuild slackware64-current.3/source/l/glibc/glibc.SlackBuild
--- slackware64-current.2/source/l/glibc/glibc.SlackBuild	2024-08-29 20:40:27.213835099 +0200
+++ slackware64-current.3/source/l/glibc/glibc.SlackBuild	2025-02-18 15:19:50.847947065 +0100
@@ -96,29 +96,46 @@
 # -fno-tree-vectorize -fno-tree-loop-vectorize -fno-tree-slp-vectorize
 # But since we're already requiring at least a pentium4, I'm not sure
 # what the benefit would be, so we won't do this yet.
-X86FLAGS32="-O3 -march=pentium4 -mtune=generic -mstackrealign -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
+X86FLAGS32="-O3 -mstackrealign -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
 X86FLAGS64="-O3 -march=x86-64 -mtune=generic -fPIC"
+i686ARCH="-march=pentium4 -mtune=generic"
 
 # I'll break this out as an option for fun  :-)
 case $ARCH  in
   i686)
-    OPTIMIZ="${X86FLAGS32}"
+    OPTIMIZ="${i686ARCH} ${X86FLAGS32}"
     LIBDIRSUFFIX=""
-    TARGET=${TARGET:-i686}
+    LIBDIRSUFFIXROOT="$LIBDIRSUFFIX"
+    ;;
+  i586)
+    OPTIMIZ="-O3 -march=i586 -mtune=i686 ${X86FLAGS32}"
+    LIBDIRSUFFIX=""
+    LIBDIRSUFFIXROOT="$LIBDIRSUFFIX"
     ;;
   x86_64)
     OPTIMIZ="${X86FLAGS64}"
+    X86FLAGS32="${i686ARCH} ${X86FLAGS32}"
     LIBDIRSUFFIX="64"
-    TARGET=${TARGET:-x86_64}
+    LIBDIRSUFFIXROOT="$LIBDIRSUFFIX"
     TARGET32=${TARGET32:-i686}
     ;;
   *)
     OPTIMIZ="-O3"
     LIBDIRSUFFIX=""
-    TARGET=${TARGET:-"$ARCH"}
     ;;
 esac
 
+case $ARCH in
+    arm*) TARGET=${TARGET:-$ARCH-slackware-linux-gnueabi} ;;
+    *)    TARGET=${TARGET:-$ARCH-slackware-linux} ;;
+esac
+ 
+# Enable multi-arch only on specific platforms
+case $ARCH in
+  i?86|x86_64|arm*|aarch*|ppc*|riscv*|s390*) EXTRACONF="--enable-multi-arch";;
+esac
+
+
 # Hand off the $ARCH variable to $SLACKWARE_ARCH to avoid confusing glibc:
 SLACKWARE_ARCH=$ARCH
 unset ARCH
@@ -136,21 +153,75 @@
 # This function fixes a doinst.sh file for x86_64.
 # With thanks to Fred Emmott.
 fix_doinst() {
-  if [ "$LIBDIRSUFFIX" = "" ]; then
-    return;
-  fi;
   if [ "$MULTILIB" = "--enable-multilib" ]; then
     # Save a copy of this to append the 32-bit links later.
     cp -a install/doinst.sh install/doinst32.sh
   fi
-  # Fix "( cd usr/lib ;" occurrences
-  sed -i "s#lib ;#lib${LIBDIRSUFFIX} ;#" install/doinst.sh
+  if [ "x$LIBDIRSUFFIXROOT" != "x" ]; then
+  # Fix "( cd usr/lib ;" occurrences (should fix nothing)
+  sed -i "s#usr/lib ;#usr/lib${LIBDIRSUFFIX} ;#" install/doinst.sh
+  # Fix "( cd lib ;" occurrences
+  sed -i "s# lib ;# lib${LIBDIRSUFFIXROOT} ;#" install/doinst.sh
   # Fix "lib/" occurrences
-  sed -i "s#lib/#lib${LIBDIRSUFFIX}/#g" install/doinst.sh
+  sed -i "s#lib/#lib${LIBDIRSUFFIXROOT}/#g" install/doinst.sh
   # Fix "( cd lib" occurrences
-  sed -i "s#( cd lib\$#( cd lib${LIBDIRSUFFIX}#" install/doinst.sh
+  sed -i "s#( cd lib\$#( cd lib${LIBDIRSUFFIXROOT}#" install/doinst.sh
+  fi
   if [ "$SLACKWARE_ARCH" = "x86_64" ]; then
     sed -i 's#ld-linux#ld-linux-x86-64#g' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "arm" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.3#' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "armv7hl" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.3#' install/doinst.sh
+    sed -i 's#ld-linux#ld-linux-armhf#g' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "aarch64" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld-linux-aarch64#g' install/doinst.sh
+    if [[ "x$LIBDIRSUFFIX" != "x" ]]
+    then
+      # All binaries are linked by default to /lib/ld-linux-aarch64.so.1, so make sure
+      # the file/link exists
+      echo -e "\n# Make sure /lib/ld-linux-aarch64.so.1 links to the correct file\n\n(cd lib; ln -sf ../lib$LIBDIRSUFFIXROOT/ld-linux-aarch64.so.1 . )\n" >> install/doinst.sh
+    fi
+  elif [ "${SLACKWARE_ARCH}" = "ppc64le" ]; then
+    sed -i 's#ld-linux#ld64#g' install/doinst.sh
+    # Fix missing old ld-x.xx.so.2 removal, since from 2.41 the ld64-x.xx.so.2 was not renamed:
+    sed -i 's|\(incoming/\*-\*\)|\1 ld-|' install/doinst.sh
+  elif [ "${SLACKWARE_ARCH}" = "ppc64" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld64#g' install/doinst.sh
+    # Fix missing old ld-x.xx.so.1 removal, since from 2.41 the ld64-x.xx.so.1 was not renamed:
+    sed -i 's|\(incoming/\*-\*\)|\1 ld-|' install/doinst.sh
+  elif [ "${SLACKWARE_ARCH}" = "ppc" -o "${SLACKWARE_ARCH::4}" = "mips" -o "${SLACKWARE_ARCH}" = "hppa" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld#g' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "riscv64" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld-linux-riscv64-lp64d#g' install/doinst.sh
+    # All binaries are linked by default to /lib/ld-linux-riscv64-lp64d.so.1, so make sure
+    # the file/link exists
+    echo -e "\n# Make sure /lib/ld-linux-riscv64-lp64d.so.1 links to the correct file\n(cd lib; ln -sf ../lib$LIBDIRSUFFIXROOT/ld-linux-riscv64-lp64d.so.1 . )\n(cd lib64; ln -sf lp64d/ld-linux-riscv64-lp64d.so.1 . )\n" >> install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "s390x" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld64#g' install/doinst.sh
+    # Fix missing old ld-x.xx.so.1 removal, since from 2.41 the ld64-x.xx.so.1 was not renamed:
+    sed -i 's|\(incoming/\*-\*\)|\1 ld-|' install/doinst.sh
+    # All binaries are linked by default to /lib/ld64.so.1, so make sure
+    # the file/link exists
+    echo -e "\n# Make sure /lib/ld64.so.1 links to the correct file\n\n(cd lib; ln -sf ../lib$LIBDIRSUFFIXROOT/ld64.so.1 . )\n" >> install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "or1k" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld-linux-or1k#g' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "alpha" ]; then
+    # Alpha adds .1 on some libraries, change it and make additional link
+    for lib in libresolv.so.2 libnsl.so.1 libm.so.6 libutil.so.1 libcrypt.so.1 libBrokenLocale.so.1 libdl.so.2
+    do
+      sed -i "s#$lib #$lib.1 #" install/doinst.sh
+      echo -e "(cd lib$LIBDIRSUFFIX; ln -s $lib.1 $lib 2>/dev/null)\n" >> install/doinst.sh
+    done
+  elif [ "$SLACKWARE_ARCH" = "loongarch64" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux.so.1#' install/doinst.sh
+    sed -i 's#ld-linux#ld-linux-loongarch-lp64d#g' install/doinst.sh
   fi
   if [ "$MULTILIB" = "--enable-multilib" ]; then
     echo "# Add 32-bit library links for multilib:"  >> install/doinst.sh
@@ -170,6 +240,10 @@
   zcat $CWD/glibc.ru_RU.CP1251.diff.gz | patch -p1 --verbose || exit 1
   # Don't use AM/PM format for date(1). That's just plain crazy.
   zcat $CWD/glibc-2.32.en_US.no.am.pm.date.format.diff.gz | patch -p1 --verbose || exit 1
+  # For some architectures, revert checking executable stack:
+  if [ "$SLACKWARE_ARCH" = "ppc" -o "$SLACKWARE_ARCH" = "hppa" -o "$SLACKWARE_ARCH" = "or1k" ]; then
+    zcat $CWD/reenable_execstack.diff.gz | patch -p1 --verbose || exit 1
+  fi
   # Other regression fixes from git:
   for git_patch in $CWD/patches/*.patch.gz ; do
     zcat $git_patch | patch -p1 --verbose || exit 1
@@ -195,7 +266,7 @@
 fi
 
 # Create an incoming directory structure for glibc to be built into:
-mkdir -p $PKG/lib${LIBDIRSUFFIX}
+mkdir -p $PKG/lib${LIBDIRSUFFIXROOT}
 mkdir -p $PKG/sbin
 mkdir -p $PKG/usr/bin
 mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
@@ -246,7 +317,7 @@
     --enable-kernel=4.4 \
     --with-headers=/usr/include \
     --enable-add-ons \
-    --enable-multi-arch \
+    $EXTRACONF \
     --enable-profile \
     $DISABLE_NSCD \
     $WERROR \
@@ -255,7 +326,7 @@
     --with-tls \
     --with-__thread \
     --without-cvs \
-    $TARGET-slackware-linux || exit 1
+    $TARGET || exit 1
   make $NUMJOBS || exit 1
   make $NUMJOBS install install_root=$PKG || exit 1
   # Don't use this, as it makes the i18n package WAY bigger:
@@ -301,6 +372,14 @@
 ARCH=$SLACKWARE_ARCH LIBDIRSUFFIX=$LIBDIRSUFFIX SLKCFLAGS=$OPTIMIZ ./libxcrypt.build || exit 1
 popd
 
+# Set time64 as default on 32-bit architectures (only exception is or1k which 
+# has __TIMESIZE == 64 (/usr/include/bits/timesize.h).
+case $SLACKWARE_ARCH in
+  arm|armv7hl|hppa|mips|mipsel|ppc|sh4|i?86)
+    (cd $PKG/usr;zcat $CWD/time64default.diff.gz | patch -p1 --no-backup-if-mismatch --verbose) || exit 1
+  ;;
+esac
+
 # We've always had an sln symlink in /bin, so let's make sure it
 # remains there so as not to break any scripts that might need it:
 mkdir -p $PKG/bin
@@ -310,7 +389,7 @@
 # /usr/lib/debug/ and stripping the debugging symbols from all the other
 # libraries.
 mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/debug
-cp -a $PKG/lib${LIBDIRSUFFIX}/l*.so* $PKG/usr/lib${LIBDIRSUFFIX}/debug
+cp -a $PKG/lib${LIBDIRSUFFIXROOT}/l*.so* $PKG/usr/lib${LIBDIRSUFFIX}/debug
 cp -a $PKG/usr/lib${LIBDIRSUFFIX}/*.a $PKG/usr/lib${LIBDIRSUFFIX}/debug
 # Don't need debug+profile:
 ( cd $PKG/usr/lib${LIBDIRSUFFIX}/debug ; rm -f *_p.* )
@@ -328,6 +407,30 @@
 #mv $PKG/usr/lib${LIBDIRSUFFIX}/debug/*_p.a $PKG/usr/lib${LIBDIRSUFFIX}
 # It might be best to put the unstripped and profiling libraries in glibc-debug and glibc-profile.
 
+if [ "$SLACKWARE_ARCH" = "aarch64" -a "$LIBDIRSUFFIX" = "64" ]
+then
+  # On aarch64 the default linker is on /lib/ld-linux-aarch64.so.1,
+  # and from glibc-2.34 it is no more a link.
+  # Move it to /lib64 so it will be correctly renamed later by this build scripts.
+  mv $PKG/lib/ld-linux-aarch64.so.1 $PKG/lib$LIBDIRSUFFIXROOT
+fi
+
+if [ "$SLACKWARE_ARCH" = "riscv64" ]
+then
+  # On riscv64 the default linker is on /lib/ld-linux-riscv64-lp64d.so.1,
+  # and from glibc-2.34 it is no more a link.
+  # Move it to /lib64/lp64d so it will be correctly renamed later by this build scripts.
+  mv $PKG/lib/ld-linux-riscv64-lp64d.so.1 $PKG/lib$LIBDIRSUFFIXROOT
+fi
+
+if [ "$SLACKWARE_ARCH" = "s390x" ]
+then
+  # On s390x the default linker is on /lib/ld64.so.1,
+  # and from glibc-2.34 it is no more a link.
+  # Move it to /lib64 so it will be correctly renamed later by this build scripts.
+  mv $PKG/lib/ld64.so.1 $PKG/lib$LIBDIRSUFFIXROOT
+fi
+
 # I don't think "strip -g" causes the pthread problems.  It's --strip-unneeded that does.
 strip -g $PKG/usr/lib${LIBDIRSUFFIX}/lib*.a
 if [ "$MULTILIB" = "--enable-multilib" ]; then
@@ -457,7 +560,7 @@
 chmod 755 etc/profile.d/*
 mkdir -p lib${LIBDIRSUFFIX}
 cp -a $PKG/lib${LIBDIRSUFFIX}/* lib${LIBDIRSUFFIX}
-( cd lib${LIBDIRSUFFIX}
+( cd lib${LIBDIRSUFFIXROOT}
   mkdir incoming
   mv *so* incoming
   mv incoming/libmemusage.so .
@@ -553,7 +656,7 @@
 sed -i "s/@@VERSION@@/$VERSION/g" install/doinst.sh
 # Call the function to fix doinst.sh where $LIBDIRSUFFIX is needed:
 fix_doinst
-( cd lib${LIBDIRSUFFIX}
+( cd lib${LIBDIRSUFFIXROOT}
   mkdir incoming
   mv *so* incoming
   mv incoming/libmemusage.so .
diff -ur slackware64-current.2/source/l/gnu-efi/gnu-efi.SlackBuild slackware64-current.3/source/l/gnu-efi/gnu-efi.SlackBuild
--- slackware64-current.2/source/l/gnu-efi/gnu-efi.SlackBuild	2021-08-17 21:01:07.631022697 +0200
+++ slackware64-current.3/source/l/gnu-efi/gnu-efi.SlackBuild	2021-09-18 13:42:54.606982438 +0200
@@ -71,6 +71,10 @@
 chown -R root:root .
 chmod -R u+w,go+r-w,a-s .
 
+# gnu-efi search "initplat.c" in lib/$ARCH, but ARCH is wrongly set
+SLACKWARE_ARCH=$ARCH
+unset ARCH
+
 sed -i "s,/usr/local,/usr,g" Make.defaults
 
 make CPPFLAGS="$SLKCFLAGS" || exit 1
@@ -89,6 +93,9 @@
 )
 strip -g $PKG/usr/lib${LIBDIRSUFFIX}/libefi.a
 
+# Restore ARCH after library build
+ARCH=$SLACKWARE_ARCH
+
 mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
 cp -a ChangeLog README* \
  $PKG/usr/doc/$PKGNAM-$VERSION
diff -ur slackware64-current.2/source/l/gobject-introspection/gobject-introspection.SlackBuild slackware64-current.3/source/l/gobject-introspection/gobject-introspection.SlackBuild
--- slackware64-current.2/source/l/gobject-introspection/gobject-introspection.SlackBuild	2024-11-21 22:52:42.469051225 +0100
+++ slackware64-current.3/source/l/gobject-introspection/gobject-introspection.SlackBuild	2025-01-07 13:31:25.552756283 +0100
@@ -93,7 +93,7 @@
   --buildtype=release \
   -Dgtk_doc=false \
   .. || exit 1
-  "${NINJA:=ninja}" $NUMJOBS || exit 1
+  "${NINJA:=ninja}" $NUMJOBS || $NINJA || exit 1
   DESTDIR=$PKG $NINJA install || exit 1
 cd ..
 
diff -ur slackware64-current.2/source/l/gstreamer/gstreamer.SlackBuild slackware64-current.3/source/l/gstreamer/gstreamer.SlackBuild
--- slackware64-current.2/source/l/gstreamer/gstreamer.SlackBuild	2024-08-22 12:33:30.539047264 -0000
+++ slackware64-current.3/source/l/gstreamer/gstreamer.SlackBuild	2025-04-02 14:13:23.952112650 -0000
@@ -82,6 +82,9 @@
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
+if [ "$SLKLDFLAGS" != "" ]; then
+  export LDFLAGS="$SLKLDFLAGS"
+fi
 mkdir meson-build
 cd meson-build
 meson setup \
diff -ur slackware64-current.2/source/l/gst-plugins-bad-free/gst-plugins-bad-free.SlackBuild slackware64-current.3/source/l/gst-plugins-bad-free/gst-plugins-bad-free.SlackBuild
--- slackware64-current.2/source/l/gst-plugins-bad-free/gst-plugins-bad-free.SlackBuild	2024-04-12 10:23:40.017081528 +0200
+++ slackware64-current.3/source/l/gst-plugins-bad-free/gst-plugins-bad-free.SlackBuild	2025-04-04 13:16:37.646889761 +0200
@@ -81,6 +81,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION
 
+# Fix missing packing sizes for 32bit platforms:
+zcat $CWD/mfx_packing_32bit.diff.gz | patch --verbose -p1 || exit 1
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -91,6 +91,9 @@
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
+if [ "$SLKLDFLAGS" != "" ]; then
+  export LDFLAGS="$SLKLDFLAGS"
+fi
 mkdir meson-build
 cd meson-build
 meson setup \
diff -ur slackware64-current.2/source/l/gst-plugins-base/gst-plugins-base.SlackBuild slackware64-current.3/source/l/gst-plugins-base/gst-plugins-base.SlackBuild
--- slackware64-current.2/source/l/gst-plugins-base/gst-plugins-base.SlackBuild	2025-03-20 10:20:38.799632796 -0000
+++ slackware64-current.3/source/l/gst-plugins-base/gst-plugins-base.SlackBuild	2025-04-02 16:33:59.838607153 -0000
@@ -87,6 +87,9 @@
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
+if [ "$SLKLDFLAGS" != "" ]; then
+  export LDFLAGS="$SLKLDFLAGS"
+fi
 mkdir meson-build
 cd meson-build
 meson setup \
diff -ur slackware64-current.2/source/l/gtk+2/gtk+2.SlackBuild slackware64-current.3/source/l/gtk+2/gtk+2.SlackBuild
--- slackware64-current.2/source/l/gtk+2/gtk+2.SlackBuild	2024-05-11 00:39:54.902290650 +0200
+++ slackware64-current.3/source/l/gtk+2/gtk+2.SlackBuild	2025-01-07 13:31:25.782768586 +0100
@@ -122,9 +122,9 @@
 # Check the host value that is passed to the compile to the one in this script:
 host="$ARCH-slackware-linux-gnu"
 compile_host=$(grep 'host_triplet =' gtk/Makefile | sed -e "s/.* = //")
-if [ "x$compile_host" != "x$host" ]; then
-  echo "Host mismatch: compile='$compile_host', SlackBuild='$host'" && exit 1
-fi
+#if [ "x$compile_host" != "x$host" ]; then
+#  echo "Host mismatch: compile='$compile_host', SlackBuild='$host'" && exit 1
+#fi
 
 make install \
   RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
@@ -147,7 +147,7 @@
 # for places where we have two copies of the GTK+ package installed.
 # (we might have x86_64 and i486 packages on the same system, for example.)
 case "$host" in
-  s390x*|x86_64*)
+  s390x*|*64*)
    mv $PKG/usr/bin/gtk-query-immodules-2.0{,-64}
    ( cd $PKG/usr/bin
      ln -sf gtk-query-immodules-2.0-64 gtk-query-immodules-2.0
diff -ur slackware64-current.2/source/l/gtk4/gtk4.SlackBuild slackware64-current.3/source/l/gtk4/gtk4.SlackBuild
--- slackware64-current.2/source/l/gtk4/gtk4.SlackBuild	2024-08-23 00:31:48.133391789 +0200
+++ slackware64-current.3/source/l/gtk4/gtk4.SlackBuild	2024-11-29 02:18:12.853762964 +0100
@@ -71,6 +71,10 @@
 tar xf $CWD/gtk-$VERSION.tar.?z || exit 1
 cd gtk-$VERSION || exit 1
 
+# Fix missing FE_UPWARD (or1k-soft, sh4), FE_DOWNWARD (or1k-soft, sh4)
+# and FE_TOWARDZERO (or1k-soft):
+zcat $CWD/fe_rounding.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/icu4c/icu4c.SlackBuild slackware64-current.3/source/l/icu4c/icu4c.SlackBuild
--- slackware64-current.2/source/l/icu4c/icu4c.SlackBuild	2021-04-17 20:02:06.771940219 +0200
+++ slackware64-current.3/source/l/icu4c/icu4c.SlackBuild	2021-09-18 13:42:54.776991019 +0200
@@ -80,9 +80,18 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
   -o -perm 400 \) -exec chmod 644 {} \+
 
+if [ "$ARCH" = "armv7hl" ]; then
+  # On Arm it generated wrong libicudata
+  zcat $CWD/arm.patch.gz | patch -p1 || exit 1
+fi
+
+# On PPC64 "out" dir is not automatically generated
+mkdir -p source/data/out
+
 cd source/
   CFLAGS="$SLKCFLAGS -Wno-gnu-line-marker" \
   CXXFLAGS="$SLKCFLAGS -Wno-gnu-line-marker" \
+  LDFLAGS="$SLKLDFLAGS" \
   ./configure \
     --prefix=/usr \
     --libdir=/usr/lib${LIBDIRSUFFIX} \
diff -ur slackware64-current.2/source/l/jemalloc/jemalloc.SlackBuild slackware64-current.3/source/l/jemalloc/jemalloc.SlackBuild
--- slackware64-current.2/source/l/jemalloc/jemalloc.SlackBuild	2021-02-13 06:31:58.489945268 +0100
+++ slackware64-current.3/source/l/jemalloc/jemalloc.SlackBuild	2023-06-17 17:07:39.954674081 +0200
@@ -71,6 +74,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix missing alignment for SPARC 32 bit:
+zcat $CWD/lg_quantum_sparc.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find -L . \
  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
diff -ur slackware64-current.2/source/l/lensfun/lensfun.SlackBuild slackware64-current.3/source/l/lensfun/lensfun.SlackBuild
--- slackware64-current.2/source/l/lensfun/lensfun.SlackBuild	2024-11-22 00:49:17.107207695 +0100
+++ slackware64-current.3/source/l/lensfun/lensfun.SlackBuild	2024-12-07 12:42:05.144963299 +0100
@@ -53,6 +53,7 @@
   LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
+  CMAKE_EXTRA="-DBUILD_FOR_SSE=ON -DBUILD_FOR_SSE2=ON"
   LIBDIRSUFFIX="64"
 else
   SLKCFLAGS="-O2"
@@ -89,8 +90,7 @@
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
     -DBUILD_LENSTOOL=ON \
-    -DBUILD_FOR_SSE=ON \
-    -DBUILD_FOR_SSE2=ON \
+    $CMAKE_EXTRA \
     -DBUILD_TESTS=OFF \
     -DINSTALL_HELPER_SCRIPTS=ON \
     .. || exit 1
diff -ur slackware64-current/source/l/libcap/libcap.SlackBuild slackware64-current.2/source/l/libcap/libcap.SlackBuild
--- slackware64-current/source/l/libcap/libcap.SlackBuild	2021-03-14 18:51:45.109039507 +0100
+++ slackware64-current.2/source/l/libcap/libcap.SlackBuild	2025-04-02 20:20:58.917813553 +0200
@@ -86,6 +86,9 @@
 # Put the pkgconfig files in the proper location:
 zcat $CWD/libcap.pkgconfig.path.diff.gz | patch -p1 --verbose || exit 1
 
+# Add architectures not supported (alpha, ork1, sh4, hppa):
+zcat $CWD/add_architectures.diff.gz | patch -p1 --verbose || exit 1
+
 # Set the CFLAGS
 sed -i "s/^\(DEBUG =\).*/\1$SLKCFLAGS/" Make.Rules
 
@@ -96,7 +96,7 @@
 sed -i 's@^BUILD_GPERF@#\0@' Make.Rules
 
 make DYNAMIC=yes GOLANG=$GOSUPPORT || exit 1
-make install RAISE_SETFCAP=no GOLANG=$GOSUPPORT DESTDIR=$PKG man_prefix=/usr || exit 1
+make install RAISE_SETFCAP=no GOLANG=$GOSUPPORT DESTDIR=$PKG man_prefix=/usr lib=lib${LIBDIRSUFFIX} || exit 1
 chmod 755 $PKG/lib${LIBDIRSUFFIX}/libcap.so*
 
 # Don't ship the static libcap.a. Leave libpsx.a alone, though - there's no
diff -ur slackware64-current/source/l/libcdio/libcdio.SlackBuild slackware64-current.2/source/l/libcdio/libcdio.SlackBuild
--- slackware64-current/source/l/libcdio/libcdio.SlackBuild	2024-05-10 13:29:43.634117601 +0200
+++ slackware64-current.2/source/l/libcdio/libcdio.SlackBuild	2024-12-01 21:39:23.980292172 +0100
@@ -68,6 +68,10 @@
 tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z || exit 1
 cd ${PKGNAM}-$VERSION
 
+# On 32 bit platform, since the introduction of time64 by default,
+# need to define _LARGEFILE64_SOURCE:
+zcat $CWD/largefile64_source.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current/source/l/libffi/libffi.SlackBuild slackware64-current.2/source/l/libffi/libffi.SlackBuild
--- slackware64-current/source/l/libffi/libffi.SlackBuild	2022-10-29 12:56:09.465547088 +0200
+++ slackware64-current.2/source/l/libffi/libffi.SlackBuild	2024-02-26 13:20:38.145654765 +0100
@@ -104,6 +104,11 @@
   --disable-exec-static-tramp \
   --build=$ARCH-slackware-linux || exit 1
 
+# On Alpha and MIPS64 LONG_DOUBLE is not correctly detectd, force it:
+if [ "$ARCH" = "alpha" -o "$ARCH" = "mips64el" ]; then
+  sed -i -e 's|/. #undef HAVE_LONG_DOUBLE ./|#define HAVE_LONG_DOUBLE 1|' ${ARCH}-*/fficonfig.h
+fi
+
 make || exit 1
 make install DESTDIR=$PKG || exit 1
 
diff -ur slackware64-current.2/source/l/libjpeg-turbo/libjpeg-turbo.SlackBuild slackware64-current.3/source/l/libjpeg-turbo/libjpeg-turbo.SlackBuild
--- slackware64-current.2/source/l/libjpeg-turbo/libjpeg-turbo.SlackBuild	2021-04-24 05:12:21.810644855 +0200
+++ slackware64-current.3/source/l/libjpeg-turbo/libjpeg-turbo.SlackBuild	2021-09-18 13:42:54.916998086 +0200
@@ -102,6 +104,7 @@
     -DCMAKE_INSTALL_DOCDIR=/usr/doc/libjpeg-turbo-${VERSION} \
     -DCMAKE_INSTALL_MANDIR=/usr/man \
     -DENABLE_STATIC=OFF \
+    $WITH_SIMD \
     .. || exit 1
   make $NUMJOBS || make || exit 1
   make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/l/libkarma/libkarma.SlackBuild slackware64-current.3/source/l/libkarma/libkarma.SlackBuild
--- slackware64-current.2/source/l/libkarma/libkarma.SlackBuild	2021-02-13 06:31:59.754945198 +0100
+++ slackware64-current.3/source/l/libkarma/libkarma.SlackBuild	2021-09-18 13:42:54.916998086 +0200
@@ -79,7 +79,7 @@
 make $NUMJOBS PREFIX=/usr || make PREFIX=/usr || exit 1
 make install PREFIX=$PKG/usr || exit 1
 
-if [ "$ARCH" = "x86_64" ]; then
+if [ "$LIBDIRSUFFIX" != "" ]; then
   mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX}
 fi
 rm $PKG/usr/lib${LIBDIRSUFFIX}/*.a
diff -ur slackware64-current.2/source/l/libmad/libmad.SlackBuild slackware64-current.3/source/l/libmad/libmad.SlackBuild
--- slackware64-current.2/source/l/libmad/libmad.SlackBuild	2021-02-13 06:31:59.776945197 +0100
+++ slackware64-current.3/source/l/libmad/libmad.SlackBuild	2021-09-18 13:42:54.957000105 +0200
@@ -81,6 +81,11 @@
 # Remove obsolete --force-mem optimization:
 sed -i "s/-fforce-mem//g" configure
 
+# On MIPS platform, from gcc 4.4, =h constraint (save HI register) was removed 
+# to avoid unpredictable code sequences, but the compiler will generate the
+# best optimized code with at least -O2 and generic 64-bit C code.
+sed -i 's/(FPM_64BIT/(FPM_64BIT) || defined(FPM_MIPS/' fixed.h
+
 # Configure:
 CFLAGS="$SLKCFLAGS" \
 ./configure \
diff -ur slackware64-current.2/source/l/librsvg/librsvg.SlackBuild slackware64-current.3/source/l/librsvg/librsvg.SlackBuild
--- slackware64-current.2/source/l/librsvg/librsvg.SlackBuild	2024-08-17 19:39:39.878387407 +0200
+++ slackware64-current.3/source/l/librsvg/librsvg.SlackBuild	2025-02-12 12:50:32.320534174 +0100
@@ -101,6 +101,12 @@
 EOF
 fi
 
+# On 32 mips, the error "Undefined temporary symbol $BB14_1" will raise by newer rust. 
+# Adding "-C opt-level=1" is a workaround
+if [ "$SLKRUSTFLAGS" != "" ]; then
+  export RUSTFLAGS="$SLKRUSTFLAGS"
+fi
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
diff -ur slackware64-current.2/source/l/libsigsegv/libsigsegv.SlackBuild slackware64-current.3/source/l/libsigsegv/libsigsegv.SlackBuild
--- slackware64-current.2/source/l/libsigsegv/libsigsegv.SlackBuild	2022-01-09 03:34:13.178952636 +0100
+++ slackware64-current.3/source/l/libsigsegv/libsigsegv.SlackBuild	2025-01-07 13:31:27.162842401 +0100
@@ -70,6 +70,9 @@
 tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z || exit 1
 cd ${PKGNAM}-$VERSION || exit 1
 
+# Fix incorrect NetBSD detection on alpha platform:
+zcat $CWD/alpha_linux.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current.2/source/l/libtheora/libtheora.SlackBuild slackware64-current.3/source/l/libtheora/libtheora.SlackBuild
--- slackware64-current.2/source/l/libtheora/libtheora.SlackBuild	2021-09-18 13:40:06.318488999 +0200
+++ slackware64-current.3/source/l/libtheora/libtheora.SlackBuild	2025-05-22 10:43:25.662870324 -0000
@@ -88,10 +88,12 @@
 
 # Configure:
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="-lm" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --disable-static \
+  $EXTRACONF \
   --build=$ARCH-slackware-linux || exit 1
 
 # Build and install:
diff -ur slackware64-current.2/source/l/libtraceevent/libtraceevent.SlackBuild slackware64-current.3/source/l/libtraceevent/libtraceevent.SlackBuild
--- slackware64-current.2/source/l/libtraceevent/libtraceevent.SlackBuild	2024-12-24 16:02:08.645821434 +0100
+++ slackware64-current.3/source/l/libtraceevent/libtraceevent.SlackBuild	2025-06-13 11:34:19.934997162 +0200
@@ -72,6 +72,12 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix alpha libdir (not lib64)
+if [ "$ARCH" = "alpha" ]
+then
+  sed -i 's/= lib64/= lib/' Makefile
+fi
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/libtracefs/libtracefs.SlackBuild slackware64-current.3/source/l/libtracefs/libtracefs.SlackBuild
--- slackware64-current.2/source/l/libtracefs/libtracefs.SlackBuild	2025-05-06 12:42:25.557788741 +0200
+++ slackware64-current.3/source/l/libtracefs/libtracefs.SlackBuild	2025-06-13 14:31:35.224105676 +0200
@@ -72,6 +72,12 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix alpha libdir (not lib64)
+if [ "$ARCH" = "alpha" ]
+then
+  sed -i 's/= lib64/= lib/' Makefile
+fi
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/liburing/liburing.SlackBuild slackware64-current.3/source/l/liburing/liburing.SlackBuild
--- slackware64-current.2/source/l/liburing/liburing.SlackBuild	2021-02-13 06:32:00.724945144 +0100
+++ slackware64-current.3/source/l/liburing/liburing.SlackBuild	2021-09-18 13:42:55.237014238 +0200
@@ -78,6 +78,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Fix missing MAP_HUGE_2MB on s390x for test program:
+zcat $CWD/missing_map_huge_2mb.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/libvpx/libvpx.SlackBuild slackware64-current.3/source/l/libvpx/libvpx.SlackBuild
--- slackware64-current.2/source/l/libvpx/libvpx.SlackBuild	2024-11-02 03:05:46.465008210 +0100
+++ slackware64-current.3/source/l/libvpx/libvpx.SlackBuild	2025-01-07 13:31:27.742873425 +0100
@@ -55,10 +55,21 @@
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   LIBDIRSUFFIX="64"
   ARCHOPTS="--target=x86_64-linux-gcc --enable-pic"
-else
-  SLKCFLAGS="-O2"
+elif [ "$ARCH" = "armv7hl" ]; then
+  ARCHOPTS="--target=armv7-linux-gcc --cpu=cortex-a8"
   LIBDIRSUFFIX=""
-  ARCHOPTS="--target=${ARCH}-linux-gcc"
+  export CC=gcc
+  export LD=gcc
+  export AS=as
+  export AR=ar
+elif [ "$ARCH" = "aarch64" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX="64"
+  ARCHOPTS="--target=arm64-linux-gcc"
+else
+  SLKCFLAGS=${SLKCFLAGS:-"-O2"}
+  LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
+  ARCHOPTS=${ARCHOPTS:-"--target=generic-gnu"}
 fi
 
 TMP=${TMP:-/tmp}
diff -ur slackware64-current/source/l/libwnck/libwnck.SlackBuild slackware64-current.2/source/l/libwnck/libwnck.SlackBuild
--- slackware64-current/source/l/libwnck/libwnck.SlackBuild	2022-10-06 13:46:48.089532642 +0200
+++ slackware64-current.2/source/l/libwnck/libwnck.SlackBuild	2025-06-09 21:05:06.141030691 +0200
@@ -69,6 +69,10 @@
 rm -rf libwnck-$VERSION
 tar xvf $CWD/libwnck-$VERSION.tar.?z* || exit 1
 cd libwnck-$VERSION || exit 1
+
+# Fix against patched libsn (startup-notification) to support time64 on 32 bit platform:
+zcat $CWD/tasklist_time64.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current/source/l/libwnck3/libwnck3.SlackBuild slackware64-current.2/source/l/libwnck3/libwnck3.SlackBuild
--- slackware64-current/source/l/libwnck3/libwnck3.SlackBuild	2025-09-03 22:48:11.787137725 +0200
+++ slackware64-current.2/source/l/libwnck3/libwnck3.SlackBuild	2025-09-07 11:26:45.936963928 +0200
@@ -75,6 +75,9 @@
 tar xvf $CWD/libwnck-${VERSION}.tar.?z || exit 1
 cd libwnck-$VERSION
 
+# Fix against patched libsn (startup-notification) to support time64 on 32 bit platform:
+zcat $CWD/tasklist_time64.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current/source/l/libwpg/libwpg.SlackBuild slackware64-current.2/source/l/libwpg/libwpg.SlackBuild
--- slackware64-current/source/l/libwpg/libwpg.SlackBuild	2023-05-01 20:52:35.450840064 +0200
+++ slackware64-current.2/source/l/libwpg/libwpg.SlackBuild	2025-01-07 13:31:27.772875030 +0100
@@ -84,8 +84,13 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [ -z "$TARGET" ]; then
+  TARGET=$ARCH-slackware-linux
+fi
+
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -93,8 +98,8 @@
   --localstatedir=/var \
   --docdir=/usr/doc/$PKGNAM-$VERSION \
   --disable-static \
-  --build=$ARCH-slackware-linux \
-  --host=$ARCH-slackware-linux || exit 1
+  --build=$TARGET \
+  --host=$TARGET || exit 1
 
 make $NUMJOBS || make || exit 1
 make install-strip DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/l/mozilla-nss/mozilla-nss.SlackBuild slackware64-current.3/source/l/mozilla-nss/mozilla-nss.SlackBuild
--- slackware64-current.2/source/l/mozilla-nss/mozilla-nss.SlackBuild	2024-11-22 20:57:42.508010256 +0100
+++ slackware64-current.3/source/l/mozilla-nss/mozilla-nss.SlackBuild	2025-01-07 13:31:27.882880914 +0100
@@ -55,7 +55,6 @@
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   LIBDIRSUFFIX="64"
-  export USE_64=1
 else
   SLKCFLAGS="-O2"
   LIBDIRSUFFIX=""
@@ -66,6 +65,11 @@
 
 NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
 
+if [ "$LIBDIRSUFFIX" = "64" -o `gcc -dM -E - < /dev/null | grep -c LP64.*1` -gt 0 ]
+then
+  export USE_64=1
+fi
+
 rm -rf $PKG
 mkdir -p $TMP $PKG
 
@@ -88,8 +92,23 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+EXTRA_NSS=""
+if [ "$ARCH" = "ppc64" ]
+then
+  # PowerPC64 (big-endian) porting is compiled to support POWER4: disabling POWER8 assembler
+  # and vsx crypto instructions 
+  #zcat $CWD/ppc64-disable-power8-asm.diff.gz | patch -p1 --verbose || exit 1
+  EXTRA_NSS="-Ddisable_crypto_vsx=1"
+elif [ "$ARCH" = "i586" ]
+then
+  EXTRA_NSS="-m32"
+fi
+
+# Add Alpha architecture to 64 bit pool:
+zcat $CWD/newarch_use_nss_64.diff.gz | patch -p1 --verbose || exit 1
+
 cd nss
-./build.sh -v $NUMJOBS --opt --system-sqlite --enable-libpkix --disable-tests
+./build.sh -v $NUMJOBS --opt --system-sqlite --enable-libpkix --disable-tests $EXTRA_NSS
 cd -
 
 # Install all the needed stuff to the package dir:
diff -ur slackware64-current.2/source/l/mozjs140/mozjs140.SlackBuild slackware64-current.3/source/l/mozjs140/mozjs140.SlackBuild
--- slackware64-current.2/source/l/mozjs140/mozjs140.SlackBuild	2024-09-17 19:13:23.764008450 +0200
+++ slackware64-current.3/source/l/mozjs140/mozjs140.SlackBuild	2024-10-30 11:02:16.038933536 +0100
@@ -57,6 +57,7 @@
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
+  EXTRACONF="--target=$ARCH-slackware-linux --host=$ARCH-slackware-linux"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   LIBDIRSUFFIX="64"
@@ -104,6 +105,27 @@
 # Remove bundled zlib directory and use system version:
 rm -rf modules/zlib
 
+# Restore i686 compile patch (without you need at least pentium4 ARCH):
+# Fix header mismatch on x86 with GCC:
+if [ "$ARCH" = "i686" ]; then
+  zcat $CWD/double_t.x86.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+# Build big-endian data file for ppc, ppc64, mips, and s390:
+( cd config/external/icu/data ; icupkg -tb icu*l.dat `basename icu*l.dat l.dat`b.dat )
+# Fix incorrect specific arm atomic include for jitless-ARMv5:
+if [ "$ARCH" = "arm" ]; then
+  zcat $CWD/patches/atomic_armv5.diff.gz | patch -p1 --verbose || exit 1
+fi
+# Fix unimplmented armv5 asm instruction:
+zcat $CWD/patches/armv5_disable_asm.diff.gz | patch -p1 --verbose || exit 1
+# Cannot build rustc with s390x (segmentation fault), fix script to use prebuild: 
+if [ "$ARCH" = "s390x" ]; then
+  zcat $CWD/patches/rustup_s390x.diff.gz | patch -p1 --verbose || exit 1
+fi
+# Fix unexported js::detail::CanonicalizedNaNBits on mips64el
+zcat  $CWD/patches/Export-js-detail-CanonicalizedNaNBits-on-architectures-th.patch.gz | patch -p1 --verbose || exit 1
+
 cd js/src
 
 # We need to do this because patches above touch configure.in:
@@ -111,7 +131,7 @@
 
 CFLAGS+="$SLKCFLAGS -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp " \
 CXXFLAGS+="$SLKCFLAGS -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp " \
-LDFLAGS="-Wl,--copy-dt-needed-entries" \
+LDFLAGS="-Wl,--copy-dt-needed-entries $SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -128,8 +149,19 @@
   --disable-debug \
   --enable-pie \
   --disable-jemalloc \
+  $EXTRACONF \
   --build=$ARCH-slackware-linux \
 
+# Fix linker on ppc64:
+# /usr/bin/clang -std=gnu99 -o nsinstall_real -DXP_UNIX -O3 -fuse-ld=lld host_nsinstall.o host_pathsub.o
+# ld.lld: error: /usr/bin/../lib64/gcc/ppc64-slackware-linux/14.1.0/../../../../lib64/Scrt1.o: ABI version 1 is not supported
+if [ "$ARCH" = "ppc64" ]; then
+  sed -i 's/fuse-ld=lld/fuse-ld=ld/' config/autoconf.mk
+fi
+
+# Add executable stack to nsinstall_real:
+sed -i 's/\(COMPUTED_HOST_C_LDFLAGS +=\)/\1 -z execstack/' config/backend.mk
+
 make $NUMJOBS || make || exit 1
 make install DESTDIR=$PKG || exit 1
 
diff -ur slackware64-current.2/source/l/nodejs/nodejs.SlackBuild slackware64-current.3/source/l/nodejs/nodejs.SlackBuild
--- slackware64-current.2/source/l/nodejs/nodejs.SlackBuild	2024-11-20 20:29:55.111795279 +0100
+++ slackware64-current.3/source/l/nodejs/nodejs.SlackBuild	2025-01-07 13:31:28.102892682 +0100
@@ -80,6 +80,13 @@
 sed -i "s|'lib'|'lib${LIBDIRSUFFIX}'|g" lib/module.js
 sed -i "s|'lib'|'lib${LIBDIRSUFFIX}'|g" deps/npm/lib/npm.js
 
+## Fix various non-x86 architectures:
+for p in $CWD/patches/*.diff.gz
+do
+  zcat $p | patch --verbose -p1 || exit 1
+done
+
+
 # Not sure if this one is really needed.
 #sed -i "s|math.h|cmath|" src/node_crypto.cc
 
diff -ur slackware64-current.2/source/l/openblas/openblas.SlackBuild slackware64-current.3/source/l/openblas/openblas.SlackBuild
--- slackware64-current.2/source/l/openblas/openblas.SlackBuild	2025-03-13 10:36:52.931729846 +0100
+++ slackware64-current.3/source/l/openblas/openblas.SlackBuild	2025-05-06 15:21:20.715396097 +0200
@@ -47,7 +47,10 @@
 fi
 
 # Don't include -j for this package.
-NUMJOBS=${NUMJOBS:-"$(expr $(nproc) + 1)"}
+NUMJOBS=${NUMJOBS:-"-j $(expr $(nproc) + 1)"}
+JOBS=`echo "$NUMJOBS" | sed 's/.*-j *//'`
+
+EXTRACONF="DYNAMIC_ARCH=1"
 
 # If you passed in a NUMJOBS with the -j, we're just going to use 4 jobs.
 # I've observed the compile hanging when run massively parallel with icecream.
@@ -79,6 +86,32 @@
 tar xf $CWD/$SRCNAM-$VERSION.tar.?z || exit 1
 cd $SRCNAM-$VERSION || exit 1
 
+if [ "$ARCH" != "x86_64" -a "$ARCH" != "i586" ]
+then
+  # utests failed on architectures different than x86. Disable them:
+  zcat $CWD/disable_utest.diff.gz | patch -p1 --verbose || exit 1
+fi
+if [ "$ARCH" = "alpha" -o "$ARCH" = "ppc64" -o "$ARCH" = "mips64el" ]
+then
+  # ctest failed on alpha. Disable them:
+  zcat $CWD/disable_ctest.diff.gz | patch -p1 --verbose || exit 1
+fi
+if [ "$ARCH" = "mips64el" ]
+then
+  # Compilation needs Loongson3 instructions:
+  export QEMU_CPU=Loongson-3A4000
+fi
+# ARMVx not set, automatically detect by __ARM_ARCH:
+zcat $CWD/arm_arch_definition.diff.gz | patch -p1 --verbose || exit 1
+
+# Set generic kernel for arm, powerpc, and alpha:
+(cd kernel/x86
+ for a in arm power alpha
+ do
+   \cp -p KERNEL.generic ../$a
+ done
+)
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -95,10 +118,10 @@
 # Build:
 make \
   PREFIX=/usr \
-  MAKE_NB_JOBS=${NUMJOBS} \
+  MAKE_NB_JOBS=${JOBS} \
   OPENBLAS_LIBRARY_DIR=/usr/lib$LIBDIRSUFFIX \
   TARGET=$TARGET \
-  DYNAMIC_ARCH=1 \
+  $EXTRACONF \
   NO_STATIC=1 \
   USE_THREAD=1 \
   NUM_THREADS=64 \
@@ -112,10 +135,10 @@
 # Install:
 make \
   PREFIX=/usr \
-  MAKE_NB_JOBS=${NUMJOBS} \
+  MAKE_NB_JOBS=${JOBS} \
   OPENBLAS_LIBRARY_DIR=/usr/lib$LIBDIRSUFFIX \
   TARGET=$TARGET \
-  DYNAMIC_ARCH=1 \
+  $EXTRACONF \
   NO_STATIC=1 \
   USE_THREAD=1 \
   NUM_THREADS=64 \
diff -ur slackware64-current.2/source/l/opencv/opencv.SlackBuild slackware64-current.3/source/l/opencv/opencv.SlackBuild
--- slackware64-current.2/source/l/opencv/opencv.SlackBuild	2021-10-02 10:49:52.075396075 +0200
+++ slackware64-current.3/source/l/opencv/opencv.SlackBuild	2025-08-29 11:51:13.243428974 +0200
@@ -51,6 +51,8 @@
 
 NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
 
+CMAKE_EXTRA=""
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
@@ -81,6 +81,10 @@
 
 tar xvf $CWD/${PKGNAM}_contrib-${VERSION}.tar.?z || exit 1
 
+# HPPA wants structure that cares memory locking aligned to 16 bytes.
+# Skip static assertion 'static_assert(alignof(T) <= 8, "");' on HPPA:
+zcat $CWD/disable_protobuf_static_assert.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -100,6 +100,7 @@
     -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+    $CMAKE_EXTRA \
     -DCMAKE_BUILD_TYPE="Release" \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DINSTALL_MAN_DIR=man \
diff -ur slackware64-current.2/source/l/opus/opus.SlackBuild slackware64-current.3/source/l/opus/opus.SlackBuild
--- slackware64-current.2/source/l/opus/opus.SlackBuild	2021-10-02 2024-04-06 20:29:00.969838645 +0200
+++ slackware64-current.3/source/l/opus/opus.SlackBuild	2023-07-07 2024-04-11 10:36:17.472676211 +0200
@@ -70,6 +70,11 @@
 TMP=${TMP:-/tmp}
 PKG=$TMP/package-$PKGNAM
 
+case "$ARCH" in
+  i?86|x86_64|armv7hl|aarch64)
+    EXTRACONF="-Dintrinsics=enabled -Drtcd=enabled" ;;
+esac
+
 rm -rf $PKG
 mkdir -p $TMP $PKG
 
@@ -106,8 +111,7 @@
   --localstatedir=/var \
   --buildtype=release \
   -Dcustom-modes=true \
-  -Drtcd=enabled \
-  -Dintrinsics=enabled \
+  $EXTRACONF \
   -Ddocdir=/usr/doc/opus-$VERSION \
   .. || exit 1
   "${NINJA:=ninja}" $NUMJOBS || exit 1
diff -ur slackware64-current.2/source/l/pcre/pcre.SlackBuild slackware64-current.3/source/l/pcre/pcre.SlackBuild
--- slackware64-current.2/source/l/pcre/pcre.SlackBuild	2021-06-16 20:06:20.130041857 +0200
+++ slackware64-current.3/source/l/pcre/pcre.SlackBuild	2021-09-18 13:42:55.527028876 +0200
@@ -46,6 +46,8 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+ENABLE_JIT="--enable-jit"
+
 if [ "$ARCH" = "i586" ]; then
   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
   LIBDIRSUFFIX=""
@@ -87,7 +89,7 @@
   --enable-utf8 \
   --enable-pcre16 \
   --enable-pcre32 \
-  --enable-jit \
+  $ENABLE_JIT \
   --enable-unicode-properties \
   --enable-pcregrep-libz \
   --enable-pcregrep-libbz2 \
diff -ur slackware64-current.2/source/l/pcre2/pcre2.SlackBuild slackware64-current.3/source/l/pcre2/pcre2.SlackBuild
--- slackware64-current.2/source/l/pcre2/pcre2.SlackBuild	2021-05-27 20:13:43.502030635 +0200
+++ slackware64-current.3/source/l/pcre2/pcre2.SlackBuild	2025-02-08 17:33:10.639656726 +0100
@@ -50,6 +50,8 @@
 TMP=${TMP:-/tmp}
 PKG=$TMP/package-$PKGNAM
 
+ENABLE_JIT="--enable-jit"
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
@@ -88,7 +90,7 @@
   --enable-static=no \
   --enable-pcre2-16 \
   --enable-pcre2-32 \
-  --enable-jit \
+  $ENABLE_JIT \
   --enable-pcre2grep-libz \
   --enable-pcre2grep-libbz2 \
   --enable-pcre2test-libreadline \
diff -ur slackware64-current.2/source/l/phonon/phonon.SlackBuild slackware64-current.3/source/l/phonon/phonon.SlackBuild
--- slackware64-current.2/source/l/phonon/phonon.SlackBuild	2024-04-06 20:28:38.148622105 +0200
+++ slackware64-current.3/source/l/phonon/phonon.SlackBuild	2025-02-17 11:30:43.003467821 +0100
@@ -111,8 +114,11 @@
 
 # Build for Qt5:
 build_phonon 5
+# No more needed (successfully compiled qt6 without webengine), but leave it as option.
+if [ -f /usr/bin/qmake6 ]; then
 # Build for Qt6:
 build_phonon 6
+fi
 
 # Make sure the Qt6 designer plugin is in the proper directory:
 if [ -r $PKG/usr/lib${LIBDIRSUFFIX}/qt5/plugins/designer/phonon4qt6widgets.so ]; then
diff -ur slackware64-current.2/source/l/poppler/poppler.SlackBuild slackware64-current.3/source/l/poppler/poppler.SlackBuild
--- slackware64-current.2/source/l/poppler/poppler.SlackBuild	2024-04-06 20:28:40.018721799 +0200
+++ slackware64-current.3/source/l/poppler/poppler.SlackBuild	2024-04-07 21:16:01.527973848 +0200
@@ -47,6 +47,11 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+# No more needed (successfully compiled qt6 without webengine), but leave it as option.
+if [ ! -f /usr/bin/qmake6 ]; then
+  QT6OPT="-DENABLE_QT6=OFF"
+fi
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
diff -ur slackware64-current.2/source/l/protobuf/protobuf.SlackBuild slackware64-current.3/source/l/protobuf/protobuf.SlackBuild
--- slackware64-current.2/source/l/protobuf/protobuf.SlackBuild	2025-05-06 12:42:21.057567907 +0200
+++ slackware64-current.3/source/l/protobuf/protobuf.SlackBuild	2025-07-14 23:13:04.453010909 +0200
@@ -72,6 +76,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Disable PROTOBUF_MUSTTAIL on s390x:
+zcat $CWD/disable_musttail.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -85,6 +85,7 @@
 mkdir cmake-build
 cd cmake-build
   cmake \
+    $CMAKE_EXTRA \
     -DCMAKE_C_FLAGS="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
     -DCMAKE_INSTALL_PREFIX=/usr \
diff -ur slackware64-current.2/source/l/pulseaudio/pulseaudio.SlackBuild slackware64-current.3/source/l/pulseaudio/pulseaudio.SlackBuild
--- slackware64-current.2/source/l/pulseaudio/pulseaudio.SlackBuild	2024-11-30 20:35:26.886937225 +0100
+++ slackware64-current.3/source/l/pulseaudio/pulseaudio.SlackBuild	2025-01-07 13:31:29.632974521 +0100
@@ -95,6 +95,9 @@
 zcat $CWD/ed3d4f0837f670e5e5afb1afa5bcfc8ff05d3407.patch.gz | patch -p1 --verbose || exit 1
 zcat $CWD/f5cacd94abcc47003bd88ad7ca1450de649ffb15.patch.gz | patch -p1 --verbose || exit 1
 
+# Fixing time64 on 32 bit systems for padsp (should not be defined):
+zcat $CWD/padsp_disable_time64.diff.gz | patch -p1 --verbose || exit 1
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
diff -ur slackware64-current.2/source/l/qt5/qt5.SlackBuild slackware64-current.3/source/l/qt5/qt5.SlackBuild
--- slackware64-current.2/source/l/qt5/qt5.SlackBuild	2024-11-23 21:45:41.120058790 +0100
+++ slackware64-current.3/source/l/qt5/qt5.SlackBuild	2025-01-07 13:31:29.742980405 +0100
@@ -117,6 +117,21 @@
 cd - 1>/dev/null
 cd qtwebengine
   zcat $CWD/patches/qt5-qtwebengine-gcc11.patch.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-mips-ppc-riscv-s390-support.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-mips32-limit-mksnapshot-memory.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-bigendian.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-time64_disable_zlib.diff.gz | patch -p1 --verbose || exit 1
+  tar xvf $CWD/patches/qtwebengine-mips-ppc-riscv-s390-newfiles.tar.gz
+  if [ "${ARCH::3}" = "ppc" -o "$ARCH" = "mips64el" -o "$ARCH" = "riscv64" -o "$ARCH" = "s390x" ]
+  then
+    # Disable getcontext on breakpad (missing assembler):
+    zcat $CWD/patches/qtwebengine-nogetcontext.diff.gz | patch -p1 --verbose || exit 1
+  fi
+  if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" ]
+  then
+    # Add atomic linking for mips 32-bits architecture
+    sed -i 's/LIBS_PRIVATE += /LIBS_PRIVATE += -latomic /' src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro
+  fi
 cd - 1>/dev/null
 
 # Fix build with gcc12:
@@ -177,6 +192,22 @@
   unset FFMPEG_OPTION
 fi
 
+if [ "$ARCH" = "arm" ]; then
+  # Fix incorrect target cpu (armv7 instead of armv5) for qtwebengine
+  # and remove the use of thumb2 instructions (not present on armv5)
+  zcat $CWD/patches/qtwebengine-armv5.patch.gz | patch -p1 --verbose || exit 1
+fi
+
+# Add s390x/loongarch support to qtscript (JSVALUE64: error: cast from 'QTJSC::JSCell*' to 'int32_t' {aka 'int'} loses precision [-fpermissive])
+zcat $CWD/patches/qt5.qtscript.s390x_loongarch_support.diff.gz | patch -p1 --verbose || exit 1
+# Add loongarch in the list of "correct" double conversion architectures:
+zcat $CWD/patches/qt5.doubleconversion_correct.diff.gz | patch -p1 --verbose || exit 1
+
+if [ `gcc -dM -E - < /dev/null | grep -c '__BYTE_ORDER__.*__ORDER_BIG_ENDIAN__'` -gt 0 ]; then
+  # Fix incorrect icudt(littleendian).dat file
+  sed -i 's/icudtl.dat/icudtb.dat/' qtwebengine/src/core/core_module.pro
+fi
+
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
 export OPENSOURCE_CXXFLAGS="$SLKCFLAGS"
@@ -236,12 +267,17 @@
 # Strip binaries:
 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
 
+# Removing RPATHS from uic broke the binary that generate invalid "->addSubWindow()" call,
+# but only for mips architecture. On riscv64, removing RPATHS lead to 
+if [ "$ARCH" != "mips" ]
+then
 # Remove rpaths:
 for file in $(find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : 2> /dev/null) ; do
   if [ ! "$(patchelf --print-rpath $file 2> /dev/null)" = "" ]; then
     patchelf --remove-rpath $file
   fi
 done
+fi
 
 # Don't ship .la files:
 rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
diff -ur slackware64-current.2/source/l/qt6/qt6.SlackBuild slackware64-current.3/source/l/qt6/qt6.SlackBuild
--- slackware64-current.2/source/l/qt6/qt6.SlackBuild	2024-12-02 22:58:07.591216457 +0100
+++ slackware64-current.3/source/l/qt6/qt6.SlackBuild	2025-08-05 12:23:05.649563393 +0200
@@ -65,10 +65,17 @@
   SLKCFLAGS="$OPTS32"
   SLKLDFLAGS=""
   LIBDIRSUFFIX=""
+  EXTRA="-DFEATURE_no_direct_extern_access=ON"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
   SLKLDFLAGS="-L/usr/lib64"
   LIBDIRSUFFIX="64"
+  EXTRA="-DFEATURE_no_direct_extern_access=ON"
+elif [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  SLKLDFLAGS=""
+  LIBDIRSUFFIX=""
+  EXTRA="-DFEATURE_no_direct_extern_access=ON"
 else
   SLKCFLAGS="-O2"
   SLKLDFLAGS=""
@@ -85,6 +92,11 @@
     *)    TARGET=$ARCH-slackware-linux ;;
 esac
 
+case "$ARCH" in
+    arm|riscv64|ppc*|mips*|sh4|hppa|or1k|alpha|sparc*|loongarch64|s390x) QTWEBENGINE="NO" ;;
+    *) QTWEBENGINE="YES" ;;
+esac
+
 # For cross-compiling from x86_64:
 if [ "$(uname -m)" = "x86_64" -a "$(file -L /usr/bin/gcc | grep 386 | grep 32-bit)" != "" ]; then
   ARCH=i686
@@ -100,7 +110,7 @@
 fi
 
 # Use ld.bfd linker (default) on x86 32-bit, and mold elsewhere:
-if [ "$ARCH" = "i686" ]; then
+if [ "$ARCH" = "i686" -o "$ARCH" = "i586" -o "$ARCH" = "ppc64" -o "${ARCH::4}" = "mips" -o "$ARCH" = "alpha" -o "$ARCH" = "aarch64" ]; then
   LINKEROPT=" "
 else
   LINKEROPT="-DFEATURE_use_mold_linker=ON"
@@ -152,6 +164,13 @@
 pushd qtwebengine
   # Thanks Debian! See https://salsa.debian.org/qt-kde-team/qt6/qt6-webengine/-/tree/master/debian/patches
   cat $CWD/patches/qt6-webengine_32bit_compressing_files.patch | patch -p1 --verbose || exit 1
+
+  # Add BonSlack architecture support
+  zcat $CWD/patches/qtwebengine-disable_time64_for_gz.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-disable-v8-unit-tests.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-newarchs.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-disable-zlib_arm_neon.diff.gz | patch -p1 --verbose || exit 1
+  zcat $CWD/patches/qtwebengine-arm_neonfp16arith.diff.gz | patch -p1 --verbose || exit 1
 popd
 cat $CWD/patches/nodejs-allow-32bit.patch | patch -p1 --verbose || exit 1
 
@@ -175,8 +194,8 @@
 
 # The qtquick3dphysics only compiles on a limited set of architectures:
 case "${ARCH}" in
-  i?86 | arm | s390) DO_PHYSX3D="OFF" ;;
-  *)                 DO_PHYSX3D="ON" ;;
+  x86_64 | aarch64 | armv7hl ) DO_PHYSX3D="ON" ;;
+  * )                          DO_PHYSX3D="OFF" ;;
 esac
 
 # Use our custom compiler and linker flags:
@@ -189,6 +208,40 @@
 # default, we'll turn it OFF. But we should test in the future to see if it
 # starts to work.
 
+if [ "$ARCH" = "arm" ]; then
+  # Fix incorrect target cpu (armv7 instead of armv5) for qtwebengine
+  # and remove the use of thumb2 instructions (not present on armv5)
+  zcat $CWD/patches/qtwebengine-armv5.patch.gz | patch -p1 --verbose || exit 1
+fi
+
+# Add loongarch/riscv/mips64 support to qtdeclarative
+zcat $CWD/patches/qtdeclarative.wtf.mips64_loongarch_riscv_support.diff.gz | patch -p1 --verbose || exit 1
+# Disabled Altivec and VSX instruction on PPC (32 bit):
+zcat $CWD/patches/qtmultimedia_disable_altivec_on_ppc.diff.gz | patch -p1 --verbose || exit 1
+# Add sh4/openrisc support to qtbase (elf):
+zcat $CWD/patches/openrisc_sh4_support.diff.gz | patch -p1 --verbose || exit 1
+
+if [ `gcc -dM -E - < /dev/null | grep -c '__BYTE_ORDER__.*__ORDER_BIG_ENDIAN__'` -gt 0 ]; then
+  # Fix incorrect icudt(littleendian).dat file
+  for f in qtwebengine/src/core/api/Qt6WebEngineCoreDeploySupport.cmake \
+           qtwebengine/src/core/api/CMakeLists.txt \
+	   qtwebengine/src/core/tools/main.cpp 
+  do
+    sed -i 's/icudtl.dat/icudtb.dat/' $f
+  done
+fi
+
+if [ "$QTWEBENGINE" = "NO" ]; then
+  rm -rf qtwebengine  
+  QTWEBOPTS=""
+else
+  QTWEBOPTS="-DFEATURE_webengine_proprietary_codecs=${USE_CODECS} \
+  -DFEATURE_webengine_system_ffmpeg=${SYSTEM_FFMPEG} \
+  -DFEATURE_webengine_system_pulseaudio=${USE_PULSEAUDIO} \
+  -DFEATURE_webengine_webrtc_pipewire=ON"
+fi
+
+export LANG=en_US.UTF-8
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
 export OPENSOURCE_CXXFLAGS="$SLKCFLAGS"
@@ -216,16 +269,13 @@
   -DINSTALL_DOCDIR=/usr/doc/qt6-${PKGVER} \
   -DINSTALL_EXAMPLESDIR=/usr/doc/qt6-${PKGVER}/examples \
   -DFEATURE_libproxy=ON \
-  -DFEATURE_no_direct_extern_access=ON \
+  $EXTRA \
   -DFEATURE_openssl_linked=ON \
   -DFEATURE_pulseaudio="${USE_PULSEAUDIO}" \
   -DFEATURE_system_sqlite=ON \
   -DFEATURE_system_xcb_xinput=ON \
   $LINKEROPT \
-  -DFEATURE_webengine_proprietary_codecs="${USE_CODECS}" \
-  -DFEATURE_webengine_system_ffmpeg="${SYSTEM_FFMPEG}" \
-  -DFEATURE_webengine_system_pulseaudio="${USE_PULSEAUDIO}" \
-  -DFEATURE_webengine_webrtc_pipewire=ON \
+  $QTWEBOPTS \
   -DFEATURE_quick3dxr_openxr:BOOL=OFF \
   -DFEATURE_system_openxr:BOOL=OFF \
   $PROTOBUF \
diff -ur slackware64-current.2/source/l/sdl/sdl.SlackBuild slackware64-current.3/source/l/sdl/sdl.SlackBuild
--- slackware64-current.2/source/l/sdl/sdl.SlackBuild	2021-09-07 20:59:04.419006899 +0200
+++ slackware64-current.3/source/l/sdl/sdl.SlackBuild	2021-09-18 13:42:55.767040991 +0200
@@ -97,6 +97,7 @@
   --disable-esd \
   --enable-shared=yes \
   --enable-static=no \
+  $SVGA \
   --disable-x11-shared || exit 1
 
 make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/l/speexdsp/speexdsp.SlackBuild slackware64-current.3/source/l/speexdsp/speexdsp.SlackBuild
--- slackware64-current.2/source/l/speexdsp/speexdsp.SlackBuild	2021-02-13 06:32:03.250945004 +0100
+++ slackware64-current.3/source/l/speexdsp/speexdsp.SlackBuild	2021-09-18 13:42:55.767040991 +0200
@@ -88,7 +88,7 @@
   --mandir=/usr/man \
   --docdir=/usr/doc/$PKGNAM-$VERSION \
   --enable-static=no \
-  --build=$ARCH-slackware-linux || exit 1
+  $EXTRACONF --build=$ARCH-slackware-linux || exit 1
 
 make $NUMJOBS || make || exit 1
 make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/l/startup-notification/startup-notification.SlackBuild slackware64-current.3/source/l/startup-notification/startup-notification.SlackBuild
--- slackware64-current.2/source/l/startup-notification/startup-notification.SlackBuild	2022-10-06 13:46:55.979938328 +0200
+++ slackware64-current.3/source/l/startup-notification/startup-notification.SlackBuild	2025-06-09 20:42:00.201245137 +0200
@@ -69,6 +74,10 @@
 rm -rf startup-notification-$VERSION
 tar xvf $CWD/startup-notification-$VERSION.tar.xz || exit 1
 cd startup-notification-$VERSION || exit 1
+
+# Patch to fix support for time64 on 32 bit platforms:
+zcat $CWD/sn-monitor_time64.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/l/v4l-utils/v4l-utils.SlackBuild slackware64-current.3/source/l/v4l-utils/v4l-utils.SlackBuild
--- slackware64-current.2/source/l/v4l-utils/v4l-utils.SlackBuild	2010-08-09 23:14:43.000000000 +0200
+++ slackware64-current.3/source/l/v4l-utils/v4l-utils.SlackBuild	2017-12-08 14:49:40.096583760 +0100
@@ -71,6 +71,17 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Disable _TIME_BITS=64 (not useful and in conflict on v4l2convert.c):
+#zcat $CWD/disable_time64.diff.gz | patch -p1 --verbose || exit 1
+# v4l2-tracer did not link with _TIME_BITS=64, disabling it for the whole package:
+# Update (2024-07-23): moving _TIME_BITS=64 to features.h seem to solve the problem.
+#                      Leave this note until all works fine.
+#SLKCFLAGS="$SLKCFLAGS -D_DONOTFORCE_TIME_BITS"
+#if [ "$LIBDIRSUFFIX" = "" -a `gcc -dM -E - < /dev/null | grep -c LP64.*1` -eq 0  ]; then
+#  # You have to disable tracer if you want _TIME_BITS=64
+#  TRACER="--disable-v4l2-tracer"
+#fi
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current.2/source/l/vte/vte.SlackBuild slackware64-current.3/source/l/vte/vte.SlackBuild
--- slackware64-current.2/source/l/vte/vte.SlackBuild	2024-10-30 10:01:08.266560589 +0100
+++ slackware64-current.3/source/l/vte/vte.SlackBuild	2024-12-09 09:22:47.556920123 +0100
@@ -78,6 +78,9 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Fix missing FE_INVALID on or1k:
+zcat $CWD/fe_invalid_not_def.diff.gz | patch -p1 --verbose || exit 1
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
diff -ur slackware64-current.2/source/l/zlib/zlib.SlackBuild slackware64-current.3/source/l/zlib/zlib.SlackBuild
--- slackware64-current.2/source/l/zlib/zlib.SlackBuild	2021-02-13 06:32:03.250945004 +0100
+++ slackware64-current.3/source/l/zlib/zlib.SlackBuild	2021-09-18 13:42:55.767040991 +0200
@@ -81,7 +81,7 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
-CFLAGS="$SLKCFLAGS" \
+CFLAGS="$SLKCFLAGS -D_DONOTFORCE_TIME_BITS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
diff -ur slackware64-current.2/source/n/curl/curl.SlackBuild slackware64-current.3/source/n/curl/curl.SlackBuild
--- slackware64-current.2/source/n/curl/curl.SlackBuild	2021-05-29 19:23:09.213002935 +0200
+++ slackware64-current.3/source/n/curl/curl.SlackBuild	2021-09-18 13:42:55.837044524 +0200
@@ -80,7 +86,11 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Adding missing #include <sched.h>
+zcat $CWD/sched_yield-missing_include.diff.gz | patch -p1 --verbose || exit 1
+
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
diff -ur slackware64-current.2/source/n/dhcp/dhcp.SlackBuild slackware64-current.3/source/n/dhcp/dhcp.SlackBuild
--- slackware64-current.2/source/n/dhcp/dhcp.SlackBuild	2021-05-29 19:23:09.213002935 +0200
+++ slackware64-current.3/source/n/dhcp/dhcp.SlackBuild	2021-09-18 13:42:55.837044524 +0200
@@ -85,6 +85,9 @@
 # Add PATH setting to /sbin/dhclient-script
 zcat $CWD/dhclient-script.PATH.diff.gz | patch -p1 || exit 1
 
+# Add build-aux scripts for riscv64:
+(cd bind; zcat $CWD/bind-build-aux-Makefile.patch.gz | patch --verbose)
+
 # Fix paths in manual pages
 sed -i \
     -e "s,ETCDIR,/etc,g" \
@@ -95,6 +99,7 @@
     doc/*/*.{5,8}
 
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --sysconfdir=/etc \
diff -ur slackware64-current.2/source/n/dhcpcd/dhcpcd.SlackBuild slackware64-current.3/source/n/dhcpcd/dhcpcd.SlackBuild
--- slackware64-current.2/source/n/dhcpcd/dhcpcd.SlackBuild	2021-05-29 19:23:09.213002935 +0200
+++ slackware64-current.3/source/n/dhcpcd/dhcpcd.SlackBuild	2021-09-18 13:42:55.837044524 +0200
@@ -75,6 +75,10 @@
 rm -rf dhcpcd-$VERSION
 tar xvf $CWD/dhcpcd-$VERSION.tar.?z || exit 1
 cd dhcpcd-$VERSION
+
+# Add loongarch64 AUDIT support:
+patch -p1 --verbose < $CWD/patches/loongarch_audit_support.patch || exit 1
+
 chown -R root:root .
 find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/n/gnutls/gnutls.SlackBuild slackware64-current.3/source/n/gnutls/gnutls.SlackBuild
--- slackware64-current.2/source/n/gnutls/gnutls.SlackBuild.orig	2024-08-15 21:53:29.399070630 +0200
+++ slackware64-current.3/source/n/gnutls/gnutls.SlackBuild	2025-01-07 13:31:30.923043522 +0100
@@ -57,6 +57,12 @@
   LIBDIRSUFFIX=""
 fi
 
+case "$ARCH" in
+    arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+    mips64el) TARGET=$ARCH-slackware-linux-gnuabi64 ;;
+    *)    TARGET=$ARCH-slackware-linux ;;
+esac
+
 # Don't use icecream:
 PATH=$(echo $PATH | sed "s|/usr/libexec/icecc/bin||g" | tr -s : | sed "s/^://g" | sed "s/:$//g")
 
@@ -80,7 +86,12 @@
   -exec chmod 644 {} \+
 
 # Need to reconf to find guile-3.0.x:
-autoreconf -vif
+which guile >/dev/null 2>&1
+if [ $? -eq 0 ] ; then
+  autoreconf -vif
+else
+  DISABLEGUILE="--disable-guile"
+fi
 
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
@@ -99,8 +110,9 @@
   --with-idn \
   --with-zstd \
   --enable-openssl-compatibility \
-  --build=$ARCH-slackware-linux \
-  --host=$ARCH-slackware-linux || exit 1
+  $DISABLE_GUILE \
+  --build=$TARGET \
+  --host=$TARGET || exit 1
 
 make $NUMJOBS || make || exit 1
 make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/n/gpgme/gpgme.SlackBuild slackware64-current.3/source/n/gpgme/gpgme.SlackBuild
--- slackware64-current.2/source/n/gpgme/gpgme.SlackBuild	2025-01-01 22:18:41.118561526 +0100
+++ slackware64-current.3/source/n/gpgme/gpgme.SlackBuild	2025-01-07 13:31:31.013048336 +0100
@@ -88,8 +88,9 @@
   --enable-languages="cl cpp python qt5 qt6" \
   --disable-gpg-test \
   --docdir=/usr/doc/gpgme-$VERSION \
-  --build=$ARCH-slackware-linux \
-  --host=$ARCH-slackware-linux || exit 1
+  || exit 1
+# Remove --build and --host otherwise gcc not detected on arm and 
+# arm-slackware-linux-clang++ has by default armv4 (not supported by qt)
 
 make $NUMJOBS || make || exit 1
 make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/n/iptraf-ng/iptraf-ng.SlackBuild slackware64-current.3/source/n/iptraf-ng/iptraf-ng.SlackBuild
--- slackware64-current.2/source/n/iptraf-ng/iptraf-ng.SlackBuild	2021-02-13 06:32:04.693944925 +0100
+++ slackware64-current.3/source/n/iptraf-ng/iptraf-ng.SlackBuild	2021-09-18 13:42:55.877046543 +0200
@@ -71,6 +71,17 @@
 
 zcat $CWD/iptraf-ng.paths.diff.gz | patch -p1 --verbose || exit 1
 
+# Patch for unaligned buffer: since could drop performance (a copy is 
+# done for every packet), apply only on known architecture that does
+# not work with unaligned copy (armv5te, mips*, sparc*):
+if [ "$ARCH" = "arm" -o "${ARCH::4}" = "mips" -o "${ARCH::5}" = "sparc" -o "$ARCH" = "hppa" ]
+then
+  zcat $CWD/unaligned_copy.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+# Fix printf size (does not match longlong/long/int):
+zcat $CWD/fix_printf_int_sizes.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/n/netatalk/netatalk.SlackBuild slackware64-current.3/source/n/netatalk/netatalk.SlackBuild
--- slackware64-current.2/source/n/netatalk/netatalk.SlackBuild	2024-10-08 13:45:06.206276993 +0200
+++ slackware64-current.3/source/n/netatalk/netatalk.SlackBuild	2024-10-09 16:13:50.588820279 +0200
@@ -71,6 +71,10 @@
 rm -rf netatalk-$VERSION
 tar xvf $CWD/netatalk-$VERSION.tar.?z* || exit 1
 cd netatalk-$VERSION || exit 1
+
+# Fix incorrect 'arch' distro detection for loongarch64:
+zcat $CWD/fix_distro_slackware.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/n/nn/nn.SlackBuild slackware64-current.3/source/n/nn/nn.SlackBuild
--- slackware64-current.2/source/n/nn/nn.SlackBuild	2021-02-13 06:32:06.037944850 +0100
+++ slackware64-current.3/source/n/nn/nn.SlackBuild	2021-09-18 13:42:55.917048562 +0200
@@ -80,7 +80,7 @@
     | sed -e "s#m-sparc.h#${MFILE}#" \
     | sed -e "s#/usr/lib/nn#/usr/lib${LIBDIRSUFFIX}/nn#" \
     | patch -p0 --verbose || exit 1
-if [ $ARCH = "x86_64" ]; then
+if [ "$MFILE" = "m-x86_64.h" ]; then
 	zcat $CWD/m-x86_64.h.gz > conf/m-x86_64.h
 fi
 zcat $CWD/nn.badnntphost.diff.gz | patch -p1 --verbose || exit 1
diff -ur slackware64-current.2/source/n/nmap/nmap.SlackBuild slackware64-current.3/source/n/nmap/nmap.SlackBuild
--- slackware64-current.2/source/n/nmap/nmap.no.internet.requirement.for.build.diff.orig	2024-05-20 20:00:51.245853572 +0200
+++ slackware64-current.3/source/n/nmap/nmap.no.internet.requirement.for.build.diff	2025-08-05 22:19:55.527357036 +0200
@@ -14,3 +14,20 @@
  	$(INSTALL) -c -m 644 docs/zenmap.1 $(DESTDIR)$(mandir)/man1/
  	$(INSTALL) -c -m 644 $(ZENMAPDIR)/install_scripts/unix/*.desktop $(DESTDIR)$(deskdir)
  # Create a symlink from nmapfe to zenmap if nmapfe doesn't exist or is
+@@ -375,14 +375,14 @@
+ 	ln -sf zenmap $(DESTDIR)$(bindir)/xnmap
+ 
+ build-ndiff:
+-	$(PYTHON) -m build $(NDIFFDIR)/
++	$(PYTHON) -m build --no-isolation $(NDIFFDIR)/
+ 
+ build-nping: $(NPINGDIR)/Makefile build-nbase build-nsock build-netutil $(NPINGDIR)/nping.h @DNET_BUILD@ @PCAP_BUILD@
+ 	@cd $(NPINGDIR) && $(MAKE)
+ 
+ install-ndiff:
+ 	$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
+-	$(PYTHON) -m pip install $(NDIFFDIR)/ $(if $(DESTDIR),--root "$(DESTDIR)")
++	$(PYTHON) -m pip install --no-build-isolation $(NDIFFDIR)/ $(if $(DESTDIR),--root "$(DESTDIR)")
+ 	$(INSTALL) -c -m 644 $(NDIFFDIR)/docs/ndiff.1 $(DESTDIR)$(mandir)/man1/
+ 
+ NSE_FILES = scripts/script.db scripts/*.nse
diff -ur slackware64-current.2/source/n/ntp/ntp.SlackBuild slackware64-current.3/source/n/ntp/ntp.SlackBuild
--- slackware64-current.2/source/n/ntp/ntp.SlackBuild	2024-10-24 20:32:48.085703081 +0200
+++ slackware64-current.3/source/n/ntp/ntp.SlackBuild	2025-01-07 13:31:31.543076686 +0100
@@ -69,6 +69,9 @@
 tar xvf $CWD/ntp-${VERSION}*.tar.?z* || exit 1
 cd ntp-${VERSION}* || exit 1
 
+# Fix invalid PTHREAD_STACK_MIN macro on or1k:
+sed -i 's/^#ifndef __sun/#if !defined(__sun) \&\& !defined(__or1k__)/' libntp/work_thread.c
+
 chown -R root:root .
 find . \
   \( -perm 2777 -o -perm 2755 -o -perm 2775 \) \
diff -ur slackware64-current.2/source/n/openssh/openssh.SlackBuild slackware64-current.3/source/n/openssh/openssh.SlackBuild
--- slackware64-current.2/source/n/openssh/openssh.SlackBuild	2023-10-06 19:00:26.131609140 +0200
+++ slackware64-current.3/source/n/openssh/openssh.SlackBuild	2024-01-08 17:56:19.419184410 +0100
@@ -99,6 +102,13 @@
 
 autoreconf -vif
 
+# MIPS big-endian, as well PPC64LE, do not like -fzero-call-used-regs=used 
+# (internal compiler error during RTL pass: zero_call_used_regs or 
+# sshkey.c:3713:1: sorry, unimplemented: argument 'used' is not supported for '-fzero-call-used-regs' on this target)
+if [ "$ARCH" = "mips" -o "$ARCH" = "ppc64le" ]; then
+  sed -i 's/-fzero-call-used-regs=used//' configure
+fi
+
 # Compile package:
 CFLAGS="$SLKCFLAGS" \
 ./configure \
diff -ur slackware64-current.2/source/n/openssl/openssl.SlackBuild slackware64-current.3/source/n/openssl/openssl.SlackBuild
--- slackware64-current.2/source/n/openssl/openssl.SlackBuild	2021-02-16 20:16:39.664000909 +0100
+++ slackware64-current.3/source/n/openssl/openssl.SlackBuild	2021-09-18 13:42:55.957050581 +0200
@@ -110,6 +110,9 @@
   touch -r CHANGES $DOCSDIR/CHANGES
 fi
 
+# Add patch for various arch default auto-configuration:
+zcat $CWD/fix_autoconfiguration.diff.gz | patch -p1 --verbose || exit 1
+
 # These are the known patent issues with OpenSSL:
 # name   #         expires
 # MDC-2: 4,908,861  2007-03-13, not included.
@@ -119,9 +122,10 @@
 # not a good idea to include them as there are better
 # algorithms to use.
 
-./config \
+LDFLAGS=$SLKLDFLAGS KERNEL_BITS=$LIBDIRSUFFIX ./config \
  --prefix=/usr \
  --openssldir=/etc/ssl \
+ --libdir=lib${LIBDIRSUFFIX} \
  zlib \
  enable-camellia \
  enable-seed \
diff -ur slackware64-current.2/source/n/php/php.SlackBuild slackware64-current.3/source/n/php/php.SlackBuild
--- slackware64-current.2/source/n/php/php.SlackBuild	2010-08-12 18:05:09.000000000 +0200
+++ slackware64-current.3/source/n/php/php.SlackBuild	2017-11-08 00:43:15.725031287 +0100
@@ -145,6 +145,9 @@
   zcat $CWD/php.configure.s390.diff.gz | patch -p1 || exit
 fi
 
+# Fix forced inline for sh4:
+zcat $CWD/sh4_inline.diff.gz | patch -p1 --verbose || exit 1
+
 # Fixup perms/owners:
 chown -R root:root .
 find . \
diff -ur slackware64-current.2/source/n/pinentry/pinentry.SlackBuild slackware64-current.3/source/n/pinentry/pinentry.SlackBuild
--- slackware64-current.2/source/n/pinentry/pinentry.SlackBuild	2024-04-06 20:30:23.204221653 +0200
+++ slackware64-current.3/source/n/pinentry/pinentry.SlackBuild	2024-05-02 01:06:58.393994037 +0200
@@ -47,6 +47,11 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+# No more needed (successfully compiled qt6 without webengine), but leave it as option.
+if [ -f /usr/bin/qmake6 ]; then
+  QT6OPT="--enable-pinentry-qt"
+fi
+
 if [ "$ARCH" = "i586" ]; then
   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
   LIBDIRSUFFIX=""
@@ -98,7 +102,7 @@
   --enable-fallback-curses \
   --enable-pinentry-emacs \
   --enable-pinentry-gtk2 \
-  --enable-pinentry-qt \
+  $QT6OPT \
   --enable-pinentry-tty \
   --build=$ARCH-slackware-linux$ARCHQUADLET \
   --host=$ARCH-slackware-linux$ARCHQUADLET || exit 1
diff -ur slackware64-current.2/source/n/s-nail/s-nail.SlackBuild slackware64-current.3/source/n/s-nail/s-nail.SlackBuild
--- slackware64-current.2/source/n/s-nail/s-nail.SlackBuild	2021-02-24 19:51:46.341919611 +0100
+++ slackware64-current.3/source/n/s-nail/s-nail.SlackBuild	2021-09-18 13:42:56.027054114 +0200
@@ -96,7 +96,12 @@
   config || exit 1
 
 make $NUMJOBS build || exit 1
+
+# Test failed on arch different then x86
+if [ `echo $ARCH|grep -c 86` -gt 0 ]]
+then
 make $NUMJOBS test || exit 1
+fi
 make install DESTDIR=$PKG || exit 1
 
 # Tighten up the perms a bit:
diff -ur slackware64.1/source/n/samba/samba.SlackBuild slackware64.2/source/n/samba/samba.SlackBuild
--- slackware64.1/source/n/samba/samba.SlackBuild	2023-04-24 16:18:30.756016051 +0200
+++ slackware64.2/source/n/samba/samba.SlackBuild	2023-09-19 13:05:40.802851431 +0200
@@ -130,7 +130,7 @@
 # build in.
 #
 # LDFLAGS are needed to avoid problems with missing symbols.
-LDFLAGS="-Wl,--no-as-needed" \
+LDFLAGS="-Wl,--no-as-needed $SLKLDFLAGS" \
 CFLAGS="$SLKCFLAGS" \
 ./configure \
   --enable-fhs \
diff -ur slackware64-current.2/source/n/vsftpd/vsftpd.SlackBuild slackware64-current.3/source/n/vsftpd/vsftpd.SlackBuild
--- slackware64-current.2/source/n/vsftpd/vsftpd.SlackBuild	2010-08-12 18:05:09.000000000 +0200
+++ slackware64-current.3/source/n/vsftpd/vsftpd.SlackBuild	2017-11-08 00:43:15.725031287 +0100
@@ -69,6 +69,12 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [ "$ARCH" = "alpha" -o "$ARCH" = "hppa" ]
+then
+  # GCC for alpha and hppa does not implement -fstack-protector
+  sed -i 's/-fstack-protector//' Makefile
+fi
+
 zcat $CWD/vsftpd.builddefs.diff.gz | patch -p1 --verbose || exit 1
 zcat $CWD/vsftpd.conf.diff.gz | patch -p1 --verbose || exit 1
 zcat $CWD/vsftpd.crypt.diff.gz | patch -p1 --verbose || exit 1
diff -ur slackware64-current.2/source/t/texlive/texlive.SlackBuild slackware64-current.3/source/t/texlive/texlive.SlackBuild
--- slackware64-current.2/source/t/texlive/texlive.SlackBuild	2024-11-28 00:19:02.289140668 +0100
+++ slackware64-current.3/source/t/texlive/texlive.SlackBuild	2025-01-07 13:31:35.143269248 +0100
@@ -83,6 +83,17 @@
 # Don't break texdoc et al every time zlib is upgraded:
 cat $CWD/patches/quit-breaking-on-minor-zlib-bump.patch | patch -p1 --verbose || exit 1
 
+# Fix incorrect MIPS64 architecture detection on LuaJIT:
+zcat $CWD/patches/mips64_configure_fix.diff.gz | patch -p1 --verbose || exit 1
+
+XINDY="--enable-xindy --with-clisp-runtime=system"
+
+which clisp 2>/dev/null
+if [ $? -ne 0 ]
+then
+  XINDY=""
+fi
+
 mkdir build
 cd build
   CFLAGS="$SLKCFLAGS -Wno-error=incompatible-pointer-types" \
@@ -104,11 +115,11 @@
     --disable-xz \
     --disable-texdoctk \
     --with-x \
-    --enable-xindy \
+    $XINDY \
+    $EXTRATEX \
     --disable-xindy-docs \
     --disable-xindy-rules \
     --disable-linked-scripts \
-    --with-clisp-runtime=system \
     --enable-gc=system \
     --with-system-libpng \
     --with-system-t1lib \
diff -ur slackware64-current.2/source/x/compiz/compiz.SlackBuild slackware64-current.3/source/x/compiz/compiz.SlackBuild
--- slackware64-current.2/source/x/compiz/compiz.SlackBuild	2025-06-02 00:02:22.849676141 +0200
+++ slackware64-current.3/source/x/compiz/compiz.SlackBuild	2025-06-10 08:24:13.089980520 +0200
@@ -75,6 +75,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Be compatible with patched startup-notification for time64 on 32 bit systems:
+zcat $CWD/libsn_time64.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/x/fcitx5-chinese-addons/fcitx5-chinese-addons.SlackBuild slackware64-current.3/source/x/fcitx5-chinese-addons/fcitx5-chinese-addons.SlackBuild
--- slackware64-current.2/source/x/fcitx5-chinese-addons/fcitx5-chinese-addons.SlackBuild	2025-06-18 10:14:39.563906089 +0200
+++ slackware64-current.3/source/x/fcitx5-chinese-addons/fcitx5-chinese-addons.SlackBuild	2025-07-08 22:41:42.137311465 +0200
@@ -79,6 +79,13 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [ -d "/usr/lib$LIBDIRSUFFIX/cmake/Qt6WebEngineWidgets" ]
+then
+  ENABLE_BROWSER=On
+else
+  ENABLE_BROWSER=Off
+fi
+
 mkdir build
 cd build
   cmake \
@@ -86,7 +93,7 @@
     -DCMAKE_C_FLAGS="${SLKCFLAGS}" \
     -DCMAKE_INSTALL_PREFIX="/usr" \
     -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
-    -DUSE_QT6=Off \
+    -DENABLE_BROWSER=$ENABLE_BROWSER \
     ..
 
   make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/x/fcitx5-qt/fcitx5-qt.SlackBuild slackware64-current.3/source/x/fcitx5-qt/fcitx5-qt.SlackBuild
--- slackware64-current.2/source/x/fcitx5-qt/fcitx5-qt.SlackBuild	2024-04-25 16:22:31.957498256 +0200
+++ slackware64-current.3/source/x/fcitx5-qt/fcitx5-qt.SlackBuild	2024-05-01 05:19:41.103516114 +0200
@@ -41,6 +41,11 @@
   esac
 fi
 
+# No more needed (successfully compiled qt6 without webengine), but leave it as option.
+if [ ! -f /usr/bin/qmake6 ]; then
+  QT6OPT="-DENABLE_QT6=Off"
+fi
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
@@ -91,6 +95,7 @@
     -DCMAKE_INSTALL_PREFIX="/usr" \
     -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
     -DENABLE_QT4="Off" \
+    $QT6OPT \
     ..
 
   make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/x/glew/glew.SlackBuild slackware64-current.3/source/x/glew/glew.SlackBuild
--- slackware64-current.2/source/x/glew/glew.SlackBuild	2021-02-13 06:32:07.791944753 +0100
+++ slackware64-current.3/source/x/glew/glew.SlackBuild	2021-09-18 13:42:56.207063200 +0200
@@ -89,8 +89,11 @@
 # Use lib${LIBDIRSUFFIX} (if needed) in Makefile:
 sed -i "s,/lib,/lib${LIBDIRSUFFIX},g" Makefile
 
-make $NUMJOBS OPT="$SLKCFLAGS" || make OPT="$SLKCFLAGS" || exit 1
-make install.all GLEW_DEST=$PKG/usr || exit 1
+# Add AArch64 architecture (and new architectures):
+\cp /usr/share/libtool/build-aux/config.* config/
+
+make $NUMJOBS OPT="$SLKCFLAGS" LIBDIR=/usr/lib$LIBDIRSUFFIX || make OPT="$SLKCFLAGS" LIBDIR=/usr/lib$LIBDIRSUFFIX || exit 1
+make install.all DESTDIR=$PKG LIBDIR=/usr/lib$LIBDIRSUFFIX || exit 1
 
 chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/libGLEW*.so.*
 rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libGLEW*.a
diff -ur slackware64-current.2/source/x/ibus/ibus.SlackBuild slackware64-current.3/source/x/ibus/ibus.SlackBuild
--- slackware64-current.2/source/x/ibus/ibus.SlackBuild	2021-07-04 18:32:55.599325278 +0200
+++ slackware64-current.3/source/x/ibus/ibus.SlackBuild	2021-09-18 13:42:56.237064714 +0200
@@ -79,6 +79,10 @@
 tar xvf $CWD/ibus-$VERSION.tar.?z || exit 1
 cd ibus-$VERSION || exit 1
 
+# On platform that does not support unaligned 32bit load (mips, armv5), force
+# the start of 32bit array on 4 bytes boundary:
+zcat $CWD/align32bit_word.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/x/libdrm/libdrm.SlackBuild slackware64-current.3/source/x/libdrm/libdrm.SlackBuild
--- slackware64-current.2/source/x/libdrm/libdrm.SlackBuild	2024-08-27 19:14:03.356027232 +0200
+++ slackware64-current.3/source/x/libdrm/libdrm.SlackBuild	2025-01-07 13:31:35.423284225 +0100
@@ -74,6 +74,18 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+if [ "${ARCH::3}" = "arm" -o "$ARCH" = "aarch64" ]; then
+  EXTRABUILD="-Dintel=enabled
+              -Domap=enabled
+	      -Dexynos=enabled
+	      -Dtegra=enabled
+	     "
+elif [ "${ARCH::3}" = "ppc" -o "${ARCH::4}" = "mips" ]; then
+  EXTRABUILD="-Dintel=enabled"
+else
+  EXTRABUILD=${EXTRABUILD:-""}
+fi
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
@@ -90,6 +102,7 @@
   --mandir=/usr/man \
   --sysconfdir=/etc \
   --localstatedir=/var \
+  $EXTRABUILD \
   --buildtype=release \
   -Dudev=true \
   -Dintel=enabled \
diff -ur slackware64-current.2/source/x/libime/libime.SlackBuild slackware64-current.3/source/x/libime/libime.SlackBuild
--- slackware64-current.2/source/x/libime/libime.SlackBuild	2024-12-12 20:41:03.063680231 +0100
+++ slackware64-current.3/source/x/libime/libime.SlackBuild	2025-01-07 13:31:35.573292249 +0100
@@ -69,6 +69,9 @@
 tar xvf $CWD/libime-${VERSION}_dict.tar.zst || exit 1
 cd libime-$VERSION || exit 1
 
+# Fix unaligned copy for hppa, mips*, and sparc* (bus error), arm already present:
+zcat $CWD/unaligned_copy.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current/source/x/libpinyin/libpinyin.SlackBuild slackware64-current.2/source/x/libpinyin/libpinyin.SlackBuild
--- slackware64-current/source/x/libpinyin/libpinyin.SlackBuild	2022-12-13 12:34:45.189372723 +0100
+++ slackware64-current.2/source/x/libpinyin/libpinyin.SlackBuild	2023-02-28 12:34:08.211129371 +0100
@@ -79,6 +79,8 @@
 tar xvf $CWD/libpinyin-$VERSION.tar.?z || exit 1
 cd libpinyin-$VERSION || exit 1
 
+zcat $CWD/unaligned_access_traling_zeros.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/x/mesa/mesa.SlackBuild slackware64-current.3/source/x/mesa/mesa.SlackBuild
--- slackware64-current.2/source/x/mesa/mesa.SlackBuild	2024-10-16 20:45:39.777012298 +0200
+++ slackware64-current.3/source/x/mesa/mesa.SlackBuild	2025-07-01 16:16:00.000000000 +0100
@@ -33,9 +33,6 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
-# Be sure this list is up-to-date:
-GALLIUM_DRIVERS="nouveau,r300,r600,svga,radeonsi,softpipe,llvmpipe,virgl,i915,iris,crocus,zink,d3d12"
-
 if [ -z "$ARCH" ]; then
   case "$( uname -m )" in
     i?86) export ARCH=i686 ;;
@@ -44,6 +41,19 @@
   esac
 fi
 
+# Be sure this list is up-to-date:
+GALLIUM_DRIVERS="nouveau,r300,r600,radeonsi,softpipe,llvmpipe,virgl,zink,d3d12"
+VULKAN_DRIVERS="amd,swrast"
+VULKAN_LAYERS="device-select,overlay"
+
+case "$ARCH" in
+  i?86 | x86_64) 
+    GALLIUM_DRIVERS="svga,iris,i915,crocus,$GALLIUM_DRIVERS"
+    VULKAN_DRIVERS="intel,intel_hasvk,virtio,$VULKAN_DRIVERS"
+    VULKAN_LAYERS="intel-nullhw,$VULKAN_LAYERS"
+    ;;
+esac
+
 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
 # the name of the created package would be, and then exit. This information
 # could be useful to other scripts.
@@ -112,6 +122,21 @@
   tar xvf $CWD/mesa-subprojects.tar.lz || exit 1
 fi
 
+which bindgen >/dev/null
+if [ $? -eq 0 ]; then
+  RUSTICL="-Dgallium-rusticl=true -Drust_std=2021"
+  if [ `gcc -dM -E - < /dev/null | grep -cE '__BYTE_ORDER__.*__ORDER_BIG_ENDIAN__'` -eq 0 ]; then
+    VULKAN_DRIVERS="nouveau,$VULKAN_DRIVERS"
+  fi
+else
+  RUSTICL=""
+fi
+
+which valgrind >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+  VALGRIND="-Dvalgrind=enabled"
+fi
+
 # Configure, build, and install:
 export CFLAGS="$SLKCFLAGS"
 export CXXFLAGS="$SLKCFLAGS"
@@ -132,12 +155,11 @@
   --localstatedir=/var \
   --buildtype=release \
   -Dplatforms=x11,wayland \
-  -Dgallium-rusticl=true \
   -Dgallium-extra-hud=true \
-  -Drust_std=2021 \
+  $RUSTICL \
   -Dgallium-drivers=$GALLIUM_DRIVERS \
-  -Dvulkan-drivers=amd,intel,intel_hasvk,swrast,virtio,nouveau \
-  -Dvulkan-layers=device-select,intel-nullhw,overlay \
+  -Dvulkan-drivers=$VULKAN_DRIVERS \
+  -Dvulkan-layers=$VULKAN_LAYERS \
   -Dvideo-codecs="$CODECS" \
   -Dglvnd=enabled \
   -Dllvm=enabled \
@@ -151,7 +174,7 @@
   -Dglx=dri \
   -Dlibunwind=disabled \
   -Dmicrosoft-clc=disabled \
-  -Dvalgrind=enabled \
+  $VALGRIND \
   $INTELRT \
   .. || exit 1
 
diff -ur slackware64-current.2/source/x/mesa/mesa-amber.build slackware64-current.3/source/x/mesa/mesa-amber.build
--- slackware64-current.2/source/x/mesa/mesa-amber.build	2022-08-08 23:46:48.013005690 +0200
+++ slackware64-current.3/source/x/mesa/mesa-amber.build	2022-08-13 08:10:13.569335845 +0200
@@ -6,7 +6,13 @@
 
 
 # Be sure this list is up-to-date:
-DRI_DRIVERS="i915,i965,r100,r200,nouveau"
+DRI_DRIVERS="r100,r200,nouveau"
+
+case "$ARCH" in
+  i?86 | x86_64) 
+    DRI_DRIVERS="i915,i965,$DRI_DRIVERS"
+    ;;
+esac
 
 cd $TMP
 rm -rf ${PKGNAM}-${AMBERVERS}
diff -ur slackware64-current.2/source/x/vulkan-sdk/vulkan-sdk.SlackBuild slackware64-current.3/source/x/vulkan-sdk/vulkan-sdk.SlackBuild
--- slackware64-current.2/source/x/vulkan-sdk/vulkan-sdk.SlackBuild	2023-11-24 06:23:56.876038563 +0100
+++ slackware64-current.3/source/x/vulkan-sdk/vulkan-sdk.SlackBuild	2024-02-07 18:04:36.206795221 +0100
@@ -580,6 +624,11 @@
 # Remove FindSDL3.cmake since we provided system one:
 \rm cmake/FindSDL3.cmake
 
+# Added OpenXR seems buggy on 64 bit:
+zcat $CWD/gfxreconstruct-openxr-64bit-fix.diff.gz | patch -p1 --verbose || exit 1
+
+zcat $CWD/platform_unknown.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -593,18 +634,19 @@
 
 mkdir -p build
 cd build
   cmake \
     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=stringop-overflow" \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \
+    $CMAKE_EXTRA \
     ..
 
   make $NUMJOBS || make || exit 1
   make install DESTDIR=$PKG || exit 1
 
 cd $TMP
 tar xvf $CWD/DirectXShaderCompiler-$DXC_VERSION.tar.?z || exit 1
 cd $TMP/DirectXShaderCompiler-$DXC_VERSION
 
@@ -612,18 +654,27 @@
 cat $CWD/DirectXShaderCompiler.noverify.patch | patch -p1 --verbose || exit 1
 
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
   -exec chmod 755 {} \+ -o \
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
+# Patching incorrect vector (instead of __vector) definition in Altivec code
+zcat $CWD/altivec_vector.diff.gz | patch -p1 --verbose || exit 1
+
+# Adding riscv support:
+zcat $CWD/riscv-support.diff.gz | patch -p1 --verbose || exit 1
+
+# Add AArch64 architecture (and new architectures):
+\cp /usr/share/libtool/build-aux/config.* autoconf/
+
 mkdir -p build/docs
 cd build
   cmake \
     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=stringop-truncation" \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \
     -DCMAKE_INSTALL_INCLUDEDIR=include/dxc \
@@ -641,20 +651,23 @@
   cp -P lib$LIBDIRSUFFIX/libdxcompiler.so* $PKG/usr/lib$LIBDIRSUFFIX/
   cp -r ../include/dxc $PKG/usr/include/
 
   # Remove CMakeLists.txt files in /usr/include
   find $PKG/usr/include/dxc -name "CMakeLists.txt" | xargs rm -f
 
 cd $TMP
 tar xvf $CWD/SPIRV-Reflect-vulkan-sdk-$SPIRV_REFLECT_VERSION.tar.?z || exit 1
 cd $TMP/SPIRV-Reflect-vulkan-sdk-$SPIRV_REFLECT_VERSION
 
+# Add AArch64 architecture (and new architectures):
+\cp /usr/share/libtool/build-aux/config.* autoconf/
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
   -exec chmod 755 {} \+ -o \
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \+
 
 mkdir -p build
 cd build
   cmake \
diff -ur slackware64-current.2/source/x/x11/arch.use.flags slackware64-current.3/source/x/x11/arch.use.flags
--- slackware64-current.2/source/x/x11/arch.use.flags	2024-08-22 09:41:42.797592349 +0200
+++ slackware64-current.3/source/x/x11/arch.use.flags	2024-08-22 11:50:27.348448588 +0200
@@ -1,5 +1,7 @@
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-O2 -march=pentium4 -mtune=generic -mstackrealign -fcommon -Wno-error=incompatible-pointer-types"
+elif [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686 -mstackrealign -fcommon -Wno-error=incompatible-pointer-types"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC -Wno-error=incompatible-pointer-types"
 else
diff -ur slackware64-15.0.orig/source/x/x11/configure/igt-gpu-tools slackware64-15.0.work/source/x/x11/configure/igt-gpu-tools
--- slackware64-15.0.orig/source/x/x11/configure/igt-gpu-tools	2021-04-23 19:48:51.690704921 +0200
+++ slackware64-15.0.work/source/x/x11/configure/igt-gpu-tools	2023-08-31 12:46:01.465385680 +0200
@@ -1,3 +1,6 @@
+if [[ "$ARCH" = "sparc" ]]; then
+  MESON_C_LINK_ARGS="-Dc_link_args=-latomic"
+fi
 CFLAGS="$SLKCFLAGS -Wno-error=array-bounds" \
 CXXFLAGS=$SLKCFLAGS \
 mkdir meson-build
@@ -12,4 +15,5 @@
   -Ddocs=disabled \
   -Dtests=disabled \
   -Drunner=disabled \
-  .. || exit 1
+  $MESON_C_LINK_ARGS \
+  ..
diff -ur slackware64-15.0.orig/source/x/x11/configure/libxcvt slackware64-15.0.work/source/x/x11/configure/libxcvt
--- slackware64-15.0.orig/source/x/x11/configure/libxcvt	2022-05-21 06:33:17.256400502 +0200
+++ slackware64-15.0.work/source/x/x11/configure/libxcvt	2023-08-31 14:54:43.321713262 +0200
@@ -14,4 +14,4 @@
   --sysconfdir /etc \
   --localstatedir /var \
   --buildtype=release \
-  .. || exit 1
+  ..
diff -ur slackware64-current.2/source/x/x11/configure/pixman slackware64-current.3/source/x/x11/configure/pixman
--- slackware64-current.2/source/x/x11/configure/pixman	2024-01-05 12:15:58.676832328 +0100
+++ slackware64-current.3/source/x/x11/configure/pixman	2024-01-05 15:33:12.413893301 +0100
@@ -5,6 +5,9 @@
   do_sse2=enabled
 else
   do_sse2=disabled
+  if [ "$ARCH" = "arm" ]; then
+    do_sse2="$do_sse2 -Darm-simd=disabled -Dneon=disabled"
+  fi
 fi
 
 export CFLAGS="$SLKCFLAGS"
diff -ur slackware64-15.0.orig/source/x/x11/configure/xisxwayland slackware64-15.0.work/source/x/x11/configure/xisxwayland
--- slackware64-15.0.orig/source/x/x11/configure/xisxwayland	2020-05-18 19:50:24.669979606 +0200
+++ slackware64-15.0.work/source/x/x11/configure/xisxwayland	2023-08-31 12:05:23.263687546 +0200
@@ -14,4 +14,4 @@
   --sysconfdir /etc \
   --localstatedir /var \
   --buildtype=release \
-  .. || exit 1
+  .. 
diff -ur slackware64-15.0.orig/source/x/x11/configure/xkeyboard-config slackware64-15.0.work/source/x/x11/configure/xkeyboard-config
--- slackware64-15.0.orig/source/x/x11/configure/xkeyboard-config	2022-02-10 19:52:47.145013268 +0100
+++ slackware64-15.0.work/source/x/x11/configure/xkeyboard-config	2023-08-31 14:54:34.881286463 +0200
@@ -16,4 +16,4 @@
   --buildtype=release \
   -Dcompat-rules=true \
   -Dxorg-rules-symlinks=true \
-  .. || exit 1
+  ..
diff -ur slackware64-15.0.orig/source/x/x11/configure/xorgproto slackware64-15.0.work/source/x/x11/configure/xorgproto
--- slackware64-15.0.orig/source/x/x11/configure/xorgproto	2018-03-17 18:33:59.047545400 +0100
+++ slackware64-15.0.work/source/x/x11/configure/xorgproto	2023-08-31 12:05:49.051650835 +0200
@@ -15,4 +15,4 @@
   --localstatedir /var \
   --buildtype=release \
   -Dlegacy=true \
-  .. || exit 1
+  .. 
diff -ur slackware64-current.2/source/x/x11/configure/xorg-server slackware64-current.3/source/x/x11/configure/xorg-server
--- slackware64-current.2/source/x/x11/configure/xorg-server	2024-03-25 20:08:21.557014687 +0100
+++ slackware64-current.3/source/x/x11/configure/xorg-server	2025-01-07 13:31:36.373335040 +0100
@@ -47,6 +47,14 @@
 # Default font paths to be used by the X server:
 DEF_FONTPATH="/usr/share/fonts/misc,/usr/share/fonts/local,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/CID,/usr/share/fonts/75dpi/:unscaled,/usr/share/fonts/100dpi/:unscaled,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/cyrillic"
 
+INT10=x86emu
+case "$ARCH" in
+  mips*) 
+    INT10=stub
+    SLKCFLAGS="$SLKCFLAGS -fcommon"
+    ;;
+esac
+
 # Reconf (don't remove this plz):
 autoreconf -vif
 
@@ -60,7 +68,7 @@
   --mandir=/usr/man \
   --disable-static \
   --with-pic \
-  --with-int10=x86emu \
+  --with-int10=$INT10 \
   --with-default-font-path="${DEF_FONTPATH}" \
   --with-module-dir=/usr/lib${LIBDIRSUFFIX}/xorg/modules \
   --with-os-name="Slackware 15.1" \
diff -ur slackware64-current.2/source/x/x11/modularize slackware64-current.3/source/x/x11/modularize
--- slackware64-current.2/source/x/x11/modularize	2021-02-13 22:06:16.101014833 +0100
+++ slackware64-current.3/source/x/x11/modularize	2021-09-18 13:43:06.117563421 +0200
@@ -180,12 +181,15 @@
 xf86-input-wacom
 xf86-video-amdgpu
 xf86-video-apm
+xf86-video-armsoc
 xf86-video-ark
 xf86-video-ast
 xf86-video-ati
 xf86-video-chips
 xf86-video-cirrus
 xf86-video-dummy
+xf86-video-fbdev
+xf86-video-fbturbo
 xf86-video-geode
 xf86-video-glint
 xf86-video-i128
@@ -198,6 +202,7 @@
 xf86-video-nv
 xf86-video-omap
 xf86-video-openchrome
+xf86-video-opentegra
 xf86-video-qxl
 xf86-video-r128
 xf86-video-rendition
diff -ur slackware64-current.2/source/x/x11/patch/xorg-cf-files.patch slackware64-current.3/source/x/x11/patch/xorg-cf-files.patch
--- slackware64-current.2/source/x/x11/patch/xorg-cf-files.patch	2021-04-20 20:11:42.282116621 +0200
+++ slackware64-current.3/source/x/x11/patch/xorg-cf-files.patch	2021-09-18 13:43:06.197567459 +0200
@@ -1 +1,2 @@
 zcat $CWD/patch/xorg-cf-files/Imake.tmpl-binutils-ar-2.36.patch.gz | patch -p1 || { touch ${SLACK_X_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
+zcat $CWD/patch/xorg-cf-files/Imake.riscv-support.patch.gz | patch -p1 || { touch ${SLACK_X_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff -ur slackware64-current.2/source/x/x11/post-install/xorg-cf-files.post-install slackware64-current.3/source/x/x11/post-install/xorg-cf-files.post-install
--- slackware64-current.2/source/x/x11/post-install/xorg-cf-files.post-install	2023-06-06 09:38:48.000000000 +0200
+++ slackware64-current.3/source/x/x11/post-install/xorg-cf-files.post-install	2023-06-13 13:58:13.195424432 +0200
@@ -1,4 +1,4 @@
-if [[ "$(uname -m)" =~ (x86_64|aarch64|riscv64) ]]; then
+if [[ "$(uname -m)" =~ (x86_64|aarch64|riscv64) || "$LIBDIRSUFFIX" = "64" ]]; then
   ( cd $PKG/usr/lib/X11/config
     zcat $CWD/post-install/xorg-cf-files/x11.tmpl.lib64.kludge.diff.gz | patch -p1 || exit 1
   )
diff -ur slackware64-current.2/source/x/x11/x11.SlackBuild slackware64-current.3/source/x/x11/x11.SlackBuild
--- slackware64-current.2/source/x/x11/x11.SlackBuild	2020-02-19 21:37:54.752789884 +0100
+++ slackware64-current.3/source/x/x11/x11.SlackBuild	2021-09-18 13:43:06.187566954 +0200
@@ -163,7 +163,12 @@
         if grep -wq "^$PKGNAME" ${CWD}/noarch ; then
           PKGARCH=noarch
         fi 
-        if grep -wq "^$PKGNAME" ${CWD}/package-blacklist ; then
+	blacklist=package-blacklist
+	if [ -r ${CWD}/$blacklist.$ARCH ]
+	then
+	  blacklist=$blacklist.$ARCH
+	fi
+        if grep -wq "^$PKGNAME" ${CWD}/$blacklist ; then
           continue
         fi
         cd $SLACK_X_BUILD_DIR
@@ -225,6 +230,19 @@
           . $CWD/patch/${PKGNAME}.patch
         fi
 
+	# Fix architecture guess for AArch64 and new architectures
+	auxdir="."
+	if [ -d "build-aux" ]
+	then
+	  auxdir="build-aux/"
+	fi
+	\cp /usr/share/libtool/build-aux/config.* $auxdir
+
+	# Fix configure to support shared libraries for PPC64LE and new architectures
+	if [ -x /usr/share/libtool/build-aux/fix_configure ]; then
+	  /usr/share/libtool/build-aux/fix_configure
+	fi
+
         # I heard somewhere that -O2 breaks some chipset or another.  If you encounter
         # problems, please contact volkerdi@slackware.com.  Thanks! :-)
 
diff -ur slackware64-current.2/source/xap/MPlayer/MPlayer.SlackBuild slackware64-current.3/source/xap/MPlayer/MPlayer.SlackBuild
--- slackware64-current.2/source/xap/MPlayer/MPlayer.SlackBuild	2024-08-13 22:24:01.170970951 +0200
+++ slackware64-current.3/source/xap/MPlayer/MPlayer.SlackBuild	2025-01-07 13:31:36.843360180 +0100
@@ -250,6 +250,9 @@
 # fix building against samba 4:
 zcat $SRCDIR/include-samba-4.0.patch.gz | patch -p1 --verbose || exit 1
 
+# Adding riscv64, or1k and loongarch64 support to configure:
+zcat $SRCDIR/newproc-support.diff.gz | patch -p1 --verbose || exit 1
+
 echo Building ...
 # MPlayer wants to automatically determine compiler flags,
 # so we don't provide CFLAGS.
diff -ur slackware64-current.2/source/xap/audacious/audacious.SlackBuild slackware64-current.3/source/xap/audacious/audacious.SlackBuild
--- slackware64-current.2/source/xap/audacious/audacious.SlackBuild	2024-06-15 18:49:33.822118074 +0200
+++ slackware64-current.3/source/xap/audacious/audacious.SlackBuild	2024-06-17 18:39:15.241832461 +0200
@@ -28,6 +28,10 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+if [ ! -f /usr/bin/qmake6 ]; then
+  QT5OPT="--enable-qt5"
+fi
+
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
   case "$( uname -m )" in
@@ -104,6 +108,7 @@
   --enable-gtk \
   --program-prefix= \
   --program-suffix= \
+  $QT5OPT \
   --with-buildstamp=$ARCH-slackware-linux \
   --build=$ARCH-slackware-linux || exit 1
 
diff -ur slackware64-current.2/source/xap/audacious-plugins/audacious-plugins.SlackBuild slackware64-current.3/source/xap/audacious-plugins/audacious-plugins.SlackBuild
--- slackware64-current.2/source/xap/audacious-plugins/audacious-plugins.SlackBuild	2024-06-15 18:49:33.132082855 +0200
+++ slackware64-current.3/source/xap/audacious-plugins/audacious-plugins.SlackBuild	2024-06-17 19:28:46.923336842 +0200
@@ -31,6 +31,10 @@
 
 NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
 
+if [ ! -f /usr/bin/qmake6 ]; then
+  QT5OPT="--enable-qt5"
+fi
+
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
   case "$( uname -m )" in
@@ -108,6 +112,7 @@
   --enable-gtk \
   --program-prefix= \
   --program-suffix= \
+  $QT5OPT \
   ${FAAD} \
   --build=$ARCH-slackware-linux || exit 1
 
diff -ur slackware64-current.2/source/xap/blackbox/blackbox.SlackBuild slackware64-current.3/source/xap/blackbox/blackbox.SlackBuild
--- slackware64-current.2/source/xap/blackbox/blackbox.SlackBuild	2021-04-18 20:11:00.718666090 +0200
+++ slackware64-current.3/source/xap/blackbox/blackbox.SlackBuild	2021-09-18 13:43:06.247569983 +0200
@@ -85,6 +85,9 @@
 tar xvf $CWD/${SRCNAM}-$VERSION.tar.?z || exit 1
 cd ${SRCNAM}-$VERSION || exit 1
 
+# Fix time64 "max" on 32 bits platforms:
+zcat $CWD/std_max_time64.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure ownerships and permissions are sane:
 chown -R root:root .
 find . \
diff -ur slackware64-current.2/source/xap/electricsheep/electricsheep.SlackBuild slackware64-current.3/source/xap/electricsheep/electricsheep.SlackBuild
--- slackware64-current.2/source/xap/electricsheep/electricsheep.SlackBuild	2025-06-02 00:02:33.240200109 +0200
+++ slackware64-current.3/source/xap/electricsheep/electricsheep.SlackBuild	2025-08-01 20:15:59.411317709 +0200
@@ -253,6 +253,8 @@
 # Don't ship .la files:
 rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
 
+# Ignore error "could not preserve permissions" that could be raised with qemu
+set +e
 # Add documentation:
 mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/{flam3,ffmpeg}
 ( cd client
diff -ur slackware64-current.2/source/xap/freerdp/freerdp.SlackBuild slackware64-current.3/source/xap/freerdp/freerdp.SlackBuild
--- slackware64-current.2/source/xap/freerdp/freerdp.SlackBuild	2024-10-10 19:40:36.098485768 +0200
+++ slackware64-current.3/source/xap/freerdp/freerdp.SlackBuild	2025-01-07 13:31:37.533397088 +0100
@@ -84,6 +84,7 @@
 cat $CWD/d0c5b1ae.patch | patch -p1 --verbose || exit 1
 
 # Configure, build, and install:
+export LDFLAGS="$SLKLDFLAGS"
 mkdir cmake-build
 cd cmake-build
   cmake \
@@ -107,6 +108,7 @@
     -DWITH_SERVER=ON \
     -DWITH_CAIRO=ON \
     -DBUILD_TESTING=OFF \
+    $CMAKE_EXTRA \
     .. || exit 1
   make $NUMJOBS || make || exit 1
   make install DESTDIR=$PKG || exit 1
diff -ur slackware64-current.2/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild slackware64-current.3/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
--- slackware64-current.2/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild	2024-12-12 22:09:01.787994314 +0100
+++ slackware64-current.3/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild	2025-01-07 13:31:37.873415274 +0100
@@ -134,6 +134,8 @@
 # PGO is disabled by default:
 PGO=${PGO:-no}
 
+EXTRACONF="--disable-elf-hack"
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-g0"
   LIBDIRSUFFIX=""
@@ -206,6 +208,12 @@
 # Fix build with recent Python:
 cat $CWD/b0dbc944fb7b.patch | patch -p1 --verbose || exit 1
 
+# Fix incorrect wav signed-samples byte order swap on big-endian:
+zcat $CWD/webrtc-wav_file-big_endian.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix incorrect time_t size comparison on 32 bit when _TIME_BITS is set to 64:
+zcat $CWD/libevent_tim64_on_32bit.diff.gz | patch -p1 --verbose || exit 1
+
 # Fetch localization, if requested
 # https://bugzilla.mozilla.org/show_bug.cgi?id=1256955
 if [ ! -z $MOZLOCALIZE ]; then
@@ -251,7 +259,7 @@
   --disable-crashreporter \
   --disable-debug-symbols \
   --disable-debug \
-  --disable-elf-hack \
+  $EXTRACONF \
   --disable-updater"
 # Complains about missing APNG support in Slackware's libpng:
 # --with-system-png \
@@ -307,7 +315,7 @@
 echo "export CC=\"${CC}\"" >> .mozconfig
 echo "export CXX=\"${CXX}\"" >> .mozconfig
 
-if [ "$COMPILE_X86_UNDER_X86_64" = "true" ]; then
+if [ "$COMPILE_X86_UNDER_X86_64" = "true" -o "$ARCH" = "i686" ]; then
   # Compile for i686 under an x86_64 kernel:
   echo "ac_add_options --host=i686-pc-linux-gnu" >> .mozconfig
   echo "ac_add_options --target=i686-pc-linux-gnu" >> .mozconfig
diff -ur slackware64-current.2/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild slackware64-current.3/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
--- slackware64-current.2/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild.orig	2024-12-11 22:31:44.531027907 +0100
+++ slackware64-current.2/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild	2025-01-07 13:31:38.073425972 +0100
@@ -82,6 +82,8 @@
   ARCH=i686
 fi
 
+EXTRACONF="--disable-elf-hack"
+
 if [ "$ARCH" = "i686" ]; then
   SLKCFLAGS="-g0 -march=pentium4 -mtune=generic"
   LIBDIRSUFFIX=""
@@ -174,6 +176,21 @@
 # Accept sha1 signatures for a while longer:
 sed -i 's|pref("mail.smime.accept_insecure_sha1_message_signatures", false);|pref("mail.smime.accept_insecure_sha1_message_signatures", true);|g' comm/mail/extensions/am-e2e/prefs/e2e-prefs.js
 
+# Fix incorrect wav signed-samples byte order swap on big-endian:
+zcat $CWD/webrtc-wav_file-big_endian.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix incorrect time_t size comparison on 32 bit when _TIME_BITS is set to 64:
+zcat $CWD/libevent_tim64_on_32bit.diff.gz | patch -p1 --verbose || exit 1
+
+# Fix missing armv7hl architecture alias on botan submodule:
+zcat $CWD/botan_arch_add.diff.gz | patch -p1 --verbose || exit 1
+
+# Restore i686 compile patch (without you need at least pentium4 ARCH):
+# Fix header mismatch on x86 with GCC:
+if [ "$ARCH" = "i686" ]; then
+  zcat $CWD/double_t.x86.diff.gz | patch -p1 --verbose || exit 1
+fi
+
 # Fetch localization, if requested:
 if [ ! -z $MOZLOCALIZE ]; then
   LOC_TAG="THUNDERBIRD_$( echo $VERSION | tr \. _ )_RELEASE"
@@ -222,11 +239,10 @@
   --disable-crashreporter \
   --disable-debug-symbols \
   --disable-debug \
-  --disable-elf-hack \
+  $EXTRACONF \
   --disable-tests \
   --disable-updater \
-  --host=$ARCH-slackware-linux \
-  --target=$ARCH-slackware-linux"
+  "
   # Complains about missing APNG support in Slackware's libpng:
   #--with-system-png \
   # Broken with 12.0:
@@ -274,7 +290,7 @@
 # This directory is also needed or the build will fail:
 mkdir -p mozilla/obj
 
-if [ "$COMPILE_X86_UNDER_X86_64" = "true" ]; then
+if [ "$COMPILE_X86_UNDER_X86_64" = "true" -o "$ARCH" = "i686" ]; then
   # Compile for i686 under an x86_64 kernel:
   echo "ac_add_options --host=i686-pc-linux-gnu" >> .mozconfig
   echo "ac_add_options --target=i686-pc-linux-gnu" >> .mozconfig
diff -ur slackware64-current.2/source/xap/mpv/mpv.SlackBuild slackware64-current.3/source/xap/mpv/mpv.SlackBuild
--- slackware64-current.2/source/xap/mpv/mpv.SlackBuild	2024-06-06 15:04:20.246115408 +0200
+++ slackware64-current.3/source/xap/mpv/mpv.SlackBuild	2024-06-21 12:00:07.202275048 +0200
@@ -123,7 +123,6 @@
   -Dpipewire=enabled \
   -Dsdl2-audio=enabled \
   -Dopenal=enabled \
-  -Dlua=luajit \
   -Djavascript=enabled \
   .. || exit 1
   "${NINJA:=ninja}" $NUMJOBS || exit 1
diff -ur slackware64-current.2/source/xap/seamonkey/seamonkey.SlackBuild slackware64-current.3/source/xap/seamonkey/seamonkey.SlackBuild
--- slackware64-current.2/source/xap/seamonkey/seamonkey.SlackBuild.orig	2021-09-18 13:56:20.067610192 +0200
+++ slackware64-current.2/source/xap/seamonkey/seamonkey.SlackBuild	2021-09-23 03:18:29.156482802 +0200
--- seamonkey.SlackBuild.orig	2024-11-28 21:32:44.328022936 +0100
+++ seamonkey.SlackBuild	2025-01-07 13:31:38.323439345 +0100
@@ -71,6 +71,12 @@
   ELFHACK="--enable-elf-hack"
 fi
 
+case "$ARCH" in
+    arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+    mips64el) TARGET=$ARCH-slackware-linux-gnuabi64 ;;
+    *)    TARGET=$ARCH-slackware-linux ;;
+esac
+
 # Choose a compiler (gcc/g++ or clang/clang++):
 export CC=${CC:-clang}
 export CXX=${CXX:-clang++}
@@ -132,6 +138,9 @@
 # Retain GTK+ v2 scrolling behavior:
 zcat $CWD/sm.ui.scrollToClick.diff.gz | patch -p2 --verbose || exit 1
 
+# Fix incorrect wav signed-samples byte order swap on big-endian:
+zcat $CWD/webrtc-wav_file-big_endian.diff.gz | patch -p1 --verbose || exit 1
+
 # Make sure the perms/ownerships are sane:
 chown -R root:root .
 find . \
@@ -169,8 +178,8 @@
   --with-system-nss \
   --with-system-zlib \
   --with-unsigned-addon-scopes=app,system \
-  --host=$ARCH-slackware-linux \
-  --target=$ARCH-slackware-linux"
+  --host=$TARGET \
+  --target=$TARGET"
 
 export BUILD_OFFICIAL=1
 export MOZILLA_OFFICIAL=1
diff -ur slackware64-current.2/source/xap/seyon/seyon.SlackBuild slackware64-current.3/source/xap/seyon/seyon.SlackBuild
--- slackware64-current.2/source/xap/seyon/seyon.SlackBuild	2025-06-13 14:41:06.230195347 +0200
+++ slackware64-current.3/source/xap/seyon/seyon.SlackBuild	2025-07-12 13:27:11.560504943 +0200
@@ -88,7 +88,7 @@
 chmod 755 makever.sh
 xmkmf
 # Update CFLAGS:
-sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing $SLKCFLAGS/" Makefile
+sed -i -e "s/\(CX\?X\?DEBUGFLAGS = \).*/\1 $SLKCFLAGS/" Makefile
 make || exit 1
 
 make install DESTDIR=$PKG LIBDIR=/usr/share/X11 || exit 1
diff -ur slackware64-current.2/source/xap/ssr/ssr.SlackBuild slackware64-current.3/source/xap/ssr/ssr.SlackBuild
--- slackware64-current.2/source/xap/ssr/ssr.SlackBuild	2024-10-10 19:40:36.098485768 +0200
+++ slackware64-current.3/source/xap/ssr/ssr.SlackBuild	2025-01-07 13:31:38.883469299 +0100
@@ -87,6 +87,11 @@
 # churn of ffmpeg7
 cat $CWD/3001-disable-non-compiling-channel-support.patch | patch -p1 --verbose || exit 1
 
+# Fix missing architectures for glinject (disabled because elfhacks.? remove from 0010 patch):
+#zcat $CWD/elf64-32_define.diff.gz | patch -p1 --verbose || exit 1
+# Fix missing arichitectures for plthook_elf.c:
+zcat $CWD/jump_slot_new_archs.diff.gz | patch -p1 --verbose || exit 1
+
 # Configure, build, and install:
 mkdir cmake-build
 cd cmake-build
diff -ur slackware64-current.2/source/xap/xine-lib/xine-lib.SlackBuild slackware64-current.3/source/xap/xine-lib/xine-lib.SlackBuild
--- slackware64-current.2/source/xap/xine-lib/xine-lib.SlackBuild	2021-10-27 12:31:23.272413690 +0200
+++ slackware64-current.3/source/xap/xine-lib/xine-lib.SlackBuild	2023-08-01 22:19:36.736014470 +0200
@@ -108,6 +111,7 @@
   --disable-vcd \
   --without-speex \
   --without-xcb \
+  $EXTRACONF \
   --with-external-dvdnav || exit 1
 
 make $NUMJOBS || make || exit 1
diff -ur slackware64-current.2/source/xap/xscreensaver/xscreensaver.SlackBuild slackware64-current.3/source/xap/xscreensaver/xscreensaver.SlackBuild
--- slackware64-current.2/source/xap/xscreensaver/xscreensaver.SlackBuild	2024-08-12 22:34:34.057809872 +0200
+++ slackware64-current.3/source/xap/xscreensaver/xscreensaver.SlackBuild	2025-01-07 13:31:39.383496043 +0100
@@ -77,6 +77,9 @@
 # helpful to distributions.
 zcat $CWD/xscreensaver.no.expiration.date.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
 
+# Remove NEON usage (it does not compile):
+zcat $CWD/xscreensaver.disable_neon.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-current.2/source/xfce/elementary-xfce/elementary-xfce.SlackBuild slackware64-current.3/source/xfce/elementary-xfce/elementary-xfce.SlackBuild
--- slackware64-current.2/source/xfce/elementary-xfce/elementary-xfce.SlackBuild	2024-10-19 23:22:26.589208886 +0200
+++ slackware64-current.3/source/xfce/elementary-xfce/elementary-xfce.SlackBuild	2024-10-21 20:08:58.777016564 +0200
@@ -72,7 +72,7 @@
 tar xvf $CWD/optipng-*.tar.lz || exit 1
 cd optipng-*
 CFLAGS="$SLKCFLAGS" \
-./configure || exit 1
+./configure -with-system-libs || exit 1
 make $NUMJOBS -C src/optipng || exit 1
 mkdir $TMP/package-optipng
 cp src/optipng/optipng $TMP/package-optipng || exit 1
diff -ur slackware64-current.2/source/xfce/xfwm4/xfwm4.SlackBuild slackware64-current.3/source/xfce/xfwm4/xfwm4.SlackBuild
--- slackware64-current.2/source/xfce/xfwm4/xfwm4.SlackBuild	2024-12-18 17:01:33.671040289 +0100
+++ slackware64-current.3/source/xfce/xfwm4/xfwm4.SlackBuild	2025-06-09 21:29:10.333967986 +0200
@@ -72,6 +72,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
+# Restore original tv_sec and tv_usec types for patched startup-notification library (time64 on 32 bit systems):
+zcat $CWD/startup-notification_time64.diff.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
#
# Placeholder for rust-for-mozilla in extra (copy from source.d.rust)
diff -ur slackware64-current.2/extra/source/rust-for-mozilla/rust.SlackBuild slackware64-current.3/testing/source/rust/rust.SlackBuild
--- slackware64-current.2/extra/source/rust-for-mozilla/rust.SlackBuild	2021-09-09 19:19:52.527012986 +0200
+++ slackware64-current.3/extra/source/rust-for-mozilla/rust.SlackBuild	2021-09-18 13:42:54.186961238 +0200
#
# Placeholder for rust in testing (copy from source.d.rust)
diff -ur slackware64-current.2/testing/source/rust/rust.SlackBuild slackware64-current.3/testing/source/rust/rust.SlackBuild
--- slackware64-current.2/testing/source/rust/rust.SlackBuild	2021-09-09 19:19:52.527012986 +0200
+++ slackware64-current.3/testing/source/rust/rust.SlackBuild	2021-09-18 13:42:54.186961238 +0200
@@ -74,14 +74,18 @@
 fi
 
 # Fail on undeclared variables and broken pipes:
-set -u -o pipefail
+set -o pipefail
 
 # If the bootstrap binaries are present, use those. Otherwise bootstrap from
 # installed compiler.
-if /bin/ls *-unknown-linux-gnu.tar.?z 1> /dev/null 2> /dev/null ; then
+if /bin/ls *-unknown-linux-gnu*.tar.?z 1> /dev/null 2> /dev/null ; then
   LOCAL_BOOTSTRAP=no
 else
-  LOCAL_BOOTSTRAP=yes
+  if [ "$LOCAL_BOOTSTRAP" = "" ] && [ -x /usr/bin/cargo ] && [ -x /usr/bin/rustc ] ; then
+    LOCAL_BOOTSTRAP=yes
+  else
+    LOCAL_BOOTSTRAP=no
+  fi
 fi
 
 # https://forge.rust-lang.org/platform-support.html
@@ -97,6 +101,21 @@
 elif [ "$ARCH" = "armv7hl" ]; then
   BARCH="armv7"
   TARCH="$BARCH"
+elif [ "$ARCH" = "arm" ]; then
+  BARCH="armv5te"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc" ]; then
+  BARCH="powerpc"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc64" ]; then
+  BARCH="powerpc64"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "ppc64le" ]; then
+  BARCH="powerpc64le"
+  TARCH="$BARCH"
+elif [ "$ARCH" = "riscv64" ]; then
+  BARCH="riscv64gc"
+  TARCH="$BARCH"
 else
   BARCH="$ARCH"
   TARCH="$ARCH"
@@ -105,6 +124,10 @@
 # Bootstrapping ABI:
 if [ "$ARCH" = "armv7hl" ]; then
   BABI="gnueabihf"
+elif [ "$ARCH" = "arm" ]; then
+  BABI="gnueabi"
+elif [ "$ARCH" = "mips64el" ]; then
+  BABI="gnuabi64"
 else
   BABI="gnu"
 fi
@@ -129,7 +149,8 @@
 
 # Not needed, as the build will automatically use as many jobs as there are
 # threads.
-#NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+JOBS=`echo $NUMJOBS  | sed 's/-j//'`
 
 if [ "$ARCH" = "i586" ]; then
   LIBDIRSUFFIX=""
@@ -144,15 +167,30 @@
 # Support libdir other than "lib":
 cat $CWD/141729.patch | patch -p1 --verbose || exit 1
 
+# Patch armv5te atomic operations (already defined in libgcc) and rls AtomicU64
+if [ "${ARCH}" = "arm" ]; then
+  (
+  cd library/compiler-builtins/compiler-builtins
+  #ckorig=`sha256sum src/arm_linux.rs | cut -f1 -d' '`
+  zcat $CWD/atomic_builtins_gcc9.diff.gz | patch -p3 --verbose || exit 1
+  #cknew=`sha256sum src/arm_linux.rs | cut -f1 -d' '`
+  ## Fix cargo checksum for above patch
+  #sed -i "s/$ckorig/$cknew/" .cargo-checksum.json
+  ) || exit 1
+fi
+
+# Disable useless copy syslib:
+zcat $CWD/disable_copy_syslib.diff.gz | patch -p1 --verbose || exit 1
+
 if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
   # rust requires bootstrapping with the previous rust version.
   # versions are defined in src/stage0.txt.
   mkdir -p build/cache/$RSTAGE0_DIR
-  cp $CWD/$PKGNAM-std-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z \
-     $CWD/$SRCNAM-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z \
+  cp $CWD/$PKGNAM-std-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z \
+     $CWD/$SRCNAM-$RSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z \
      build/cache/$RSTAGE0_DIR
   mkdir -p build/cache/$CSTAGE0_DIR
-  cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-gnu.tar.?z build/cache/$CSTAGE0_DIR
+  cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-gnu*.tar.?z build/cache/$CSTAGE0_DIR
 fi
 
 # Build configuration:
@@ -208,6 +229,7 @@
 # Do not query new versions of dependencies online.
 locked-deps = true
 $BUILDDOCS_OPTION
+jobs = $JOBS
 
 [install]
 prefix = "/usr"
@@ -201,8 +236,45 @@
 [target.x86_64-unknown-linux-gnu]
 llvm-config = "/usr/bin/llvm-config"
 
+[target.arm-unknown-linux-gnueabi]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.armv5te-unknown-linux-gnueabi]
+llvm-config = "/usr/bin/llvm-config"
+
 [target.armv7-unknown-linux-gnueabihf]
 llvm-config = "/usr/bin/llvm-config"
+
+[target.aarch64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.powerpc64le-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mips-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mipsel-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.mips64el-unknown-linux-gnuabi64]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.riscv64gc-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.s390x-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
+[target.loongarch64-unknown-linux-gnu]
+llvm-config = "/usr/bin/llvm-config"
+
 EOF
 fi
 
@@ -236,6 +308,12 @@
   fi
 fi
 
+# On mips[el] from rust 1.74, the error "Undefined temporary symbol $BB217_1" will raise by newer rust. 
+# Adding "-C opt-level=1" is a workaround
+if [ "$ARCH" = "mips" -o "$ARCH" = "mipsel" ]; then
+  export RUSTFLAGS="$RUSTFLAGS -C opt-level=1"
+fi
+
 # Fix path to the rust libraries in rust-analyzer:
 if [ -r src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs ]; then
   if [ ! "$LIBDIRSUFFIX" = "" ]; then
@@ -270,6 +344,11 @@
     sed -i "s,\"lib/rustlib,\"lib${LIBDIRSUFFIX}/rustlib,g" src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
   fi
 fi
+
+if [ "$LOCAL_BOOTSTRAP" = "yes" ] ; then
+  # Launch script to relink rustlib:
+  $CWD/linkrustlib.sh `pwd` $LIBDIRSUFFIX &
+fi
 
 # Build and install:
 export RUST_BACKTRACE=full
@@ -283,7 +361,7 @@
 
 # Evidently there are a lot of duplicated libraries in this tree, so let's
 # try to save some space:
-( cd $PKG/usr/lib${LIBDIRSUFFIX}/rustlib/*-linux-gnu/lib && for file in *.so ; do if cmp -s $file ../../../$file ; then ln -sf ../../../$file .; fi; done )
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/rustlib/*-linux-gnu*/lib && for file in *.so ; do if cmp -s $file ../../../$file ; then ln -sf ../../../$file .; fi; done )
 
 # Strip ELF objects:
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
#
#
#
#
#
#
#
# CMAKE LIBDIR fixes
#
