diff -ur slackware64-14.2/patches/source/rust/rust.SlackBuild
--- slackware64-14.2/patches/source/rust/rust.SlackBuild.orig	2019-07-09 05:01:14.067122663 +0200
+++ slackware64-14.2/patches/source/rust/rust.SlackBuild	2019-08-20 04:18:28.249268041 +0200
@@ -98,6 +98,18 @@
 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"
 else
   BARCH="$ARCH"
   TARCH="$ARCH"
@@ -106,6 +118,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
@@ -144,15 +160,25 @@
   zcat $CWD/link_libffi.diff.gz | patch -p1 --verbose || exit 1
 fi
 
+# Patch armv5te atomic operations (already defined in libgcc) and rls AtomicU64
+if [ "${ARCH}" = "arm" -o "${ARCH}" = "ppc" -o "${ARCH}" = "mips" -o "${ARCH}" = "mipsel" ]; then
+  #ckorig=`sha256sum vendor/compiler_builtins/src/arm_linux.rs | cut -f1 -d' '`
+  #zcat $CWD/atomic_builtins_gcc9.diff.gz | patch -p1 --verbose || exit 1
+  #cknew=`sha256sum vendor/compiler_builtins/src/arm_linux.rs | cut -f1 -d' '`
+  ## Fix cargo checksum for above patch
+  #sed -i "s/$ckorig/$cknew/" vendor/compiler_builtins/.cargo-checksum.json
+  zcat $CWD/rls_armv5te_atomic64-32.diff.gz | patch -p1 --verbose || exit 1
+fi
+
 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. We'll go ahead and build with rpath because it may be
@@ -198,8 +224,36 @@
 [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"
+
 EOF
 fi
 
@@ -254,7 +308,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-14.2/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
--- slackware64-14.2/source/xap/mozilla-firefox/build-deps/python3/python3.build	2019-07-10 09:45:13.225181515 +0200
+++ slackware64-14.2/source/xap/mozilla-firefox/build-deps/python3/python3.build	2019-09-07 12:39:48.662544099 +0200
@@ -104,10 +104,10 @@
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
 ./configure \
-  --prefix=/tmp/mozilla-firefox-build-deps/usr \
-  --libdir=/tmp/mozilla-firefox-build-deps/usr/lib${LIBDIRSUFFIX} \
-  --mandir=/tmp/mozilla-firefox-build-deps/usr/man \
-  --docdir=/tmp/mozilla-firefox-build-deps/usr/doc/$PKGNAM-$VERSION \
+  --prefix=$TMP/mozilla-firefox-build-deps/usr \
+  --libdir=$TMP/mozilla-firefox-build-deps/usr/lib${LIBDIRSUFFIX} \
+  --mandir=$TMP/mozilla-firefox-build-deps/usr/man \
+  --docdir=$TMP/mozilla-firefox-build-deps/usr/doc/$PKGNAM-$VERSION \
   --with-threads \
   --enable-ipv6 \
   --enable-shared \
diff -ur slackware64-current.2/patches/source/openjpeg/openjpeg.SlackBuild slackware64-current.3/patches/source/openjpeg/openjpeg.SlackBuild
--- slackware64-current.2/patches/source/openjpeg/openjpeg.SlackBuild	2024-02-27 14:07:41.078282968 +0100
+++ slackware64-current.3/patches/source/openjpeg/openjpeg.SlackBuild	2024-03-24 13:35:09.211592854 +0100
@@ -86,6 +86,9 @@
 
 zcat $CWD/openjpeg2_remove-thirdparty.patch.gz | patch -p1 --verbose || exit 1
 
+# Fix missing uint16_t for swap16 on big endian
+sed -i 's/<stdlib.h>/<stdlib.h>\n#include <stdint.h>/' src/bin/jpwl/convert.c
+
 mkdir -p build
 cd build
   cmake \
@@ -95,6 +95,7 @@
     -DCMAKE_C_FLAGS="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
     -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_INSTALL_LIBDIR="lib$LIBDIRSUFFIX" \
     -DOPENJPEG_INSTALL_LIB_DIR="lib$LIBDIRSUFFIX" \
     -DOPENJPEG_INSTALL_MAN_DIR="man/" \
     -DOPENJPEG_INSTALL_DOC_DIR="doc/openjpeg-$VERSION/" \
diff -ur slackware64-14.2/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
--- slackware64-14.2/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild	2016-03-15 23:26:46.000000000 +0100
+++ slackware64-14.2.patcharm/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild	2017-12-30 01:52:19.936631169 +0100
diff -ur slackware64-14.2/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
--- slackware64-14.2/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild	2016-03-15 23:26:46.000000000 +0100
+++ slackware64-14.2.patcharm/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild	2017-12-30 01:52:19.936631169 +0100
diff -ur slackware64-14.2/source/xap/seamonkey/seamonkey.SlackBuild
--- slackware64-14.2/source/xap/seamonkey/seamonkey.SlackBuild	2016-03-15 23:26:46.000000000 +0100
+++ slackware64-14.2.patcharm/source/xap/seamonkey/seamonkey.SlackBuild	2017-12-30 01:52:19.936631169 +0100
diff -ur slackware64-14.2/source/xap/tigervnc/tigervnc.SlackBuild
--- slackware64-14.2/source/xap/tigervnc/tigervnc.SlackBuild	2016-03-15 23:26:46.000000000 +0100
+++ slackware64-14.2.patcharm/source/xap/tigervnc/tigervnc.SlackBuild	2017-12-30 01:52:19.936631169 +0100
diff -ur slackware64-14.2/source/xap/wavpack/wavpack.SlackBuild
--- slackware64-14.2/source/xap/wavpack/wavpack.SlackBuild	2016-03-15 23:26:46.000000000 +0100
+++ slackware64-14.2.patcharm/source/xap/wavpack/wavpack.SlackBuild	2017-12-30 01:52:19.936631169 +0100
diff -ur slackware64-14.2/source/l/gegl/gegl.SlackBuild slackware64-14.2.patcharm/source/l/gegl/gegl.SlackBuild
--- slackware64-14.2/source/l/gegl/gegl.SlackBuild	2015-03-18 22:51:59.000000000 +0100
+++ slackware64-14.2.patcharm/source/l/gegl/gegl.SlackBuild	2017-10-24 23:32:45.495801588 +0200
diff -ur slackware64-14.2/patches/source/dhcp/dhcp.SlackBuild.orig slackware64-14.2/patches/source/dhcp/dhcp.SlackBuild
--- slackware64-14.2/patches/source/dhcp/dhcp.SlackBuild.orig	2018-02-28 22:49:30.539269418 +0100
+++ slackware64-14.2/patches/source/dhcp/dhcp.SlackBuild	2023-05-26 10:13:04.115819442 +0200
@@ -54,9 +54,29 @@
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -fPIC"
   LIBDIRSUFFIX="64"
-else
+elif [ "$ARCH" = "mips" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+  SLKLDFLAGS="-latomic"
+elif [ "$ARCH" = "mipsel" ]; then
   SLKCFLAGS="-O2"
   LIBDIRSUFFIX=""
+  SLKLDFLAGS="-latomic"
+elif [ "$ARCH" = "ppc" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+  SLKLDFLAGS="-latomic"
+elif [ "$ARCH" = "sparc" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+  SLKLDFLAGS="-latomic"
+elif [ "$ARCH" = "aarch64" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX="64"
+else
+  SLKCFLAGS=${SLKCFLAGS:-"-O2"}
+  LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
+  SLKLDFLAGS=${SLKLDFLAGS:-""}
 fi
 
 rm -rf $PKG
@@ -77,6 +97,9 @@
 # Add PATH setting to /sbin/dhclient-script
 zcat $CWD/dhclient-script.PATH.diff.gz | patch -p1 || exit 1
 
+# Add new architectures to bind:
+(cd bind; zcat $CWD/bind-build-aux-Makefile.patch.gz | patch --verbose)
+
 # Fix paths in manual pages
 sed -i \
     -e "s,ETCDIR,/etc,g" \
@@ -87,6 +110,7 @@
     doc/*/*.{5,8}
 
 CFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
 ./configure \
   --prefix=/usr \
   --sysconfdir=/etc \
diff -ur slackware64-14.2/patches/source/sane/sane.SlackBuild.orig slackware64-14.2/patches/source/sane/sane.SlackBuild
--- slackware64-14.2/patches/source/sane/sane.SlackBuild.orig	2021-09-22 15:15:06.655884738 +0200
+++ slackware64-14.2/patches/source/sane/sane.SlackBuild	2021-09-23 17:39:32.777626979 +0200
@@ -78,6 +78,9 @@
 cd sane-backends-$BACKVER || exit 1
 chown -R root:root .
 
+# Fix missing variable structure for big-endian:
+zcat $CWD/backend-genesys-bigendian.diff.gz | patch -p1 || exit 1
+
 # Put the SANE_CAP_ALWAYS_SETTABLE definition back until
 # everything else catches up with the API change...
 zcat $CWD/sane-frontends-1.0.14-sane_cap_always_settable.diff.gz | patch -p1 || exit 1
diff -ur slackware64-14.2/patches/source/curl/curl.SlackBuild
--- slackware64-14.2/patches/source/curl/curl.SlackBuild.orig	2022-07-04 13:15:48.784815154 +0000
+++ slackware64-14.2/patches/source/curl/curl.SlackBuild	2022-07-04 19:50:27.728260488 +0000
@@ -75,6 +75,9 @@
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \;
 
+# Patch for missing <sched.h> for non-x86 architectures:
+zcat $CWD/easy_lock-sched.diff.gz | patch -p1 --verbose || exit 1
+
 CFLAGS="$SLKCFLAGS" \
 ./configure \
   --prefix=/usr \
diff -ur slackware64-14.2/patches/source/libjpeg-turbo/libjpeg-turbo.SlackBuild
--- slackware64-14.2/patches/source/libjpeg-turbo/libjpeg-turbo.SlackBuild.orig	2022-07-04 13:15:48.784815154 +0000
+++ slackware64-14.2/patches/source/libjpeg-turbo/libjpeg-turbo.SlackBuild	2022-07-04 19:50:27.728260488 +0000
@@ -94,6 +94,7 @@
     -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DLIB_SUFFIX="$LIBDIRSUFFIX" \
+    -DCMAKE_INSTALL_LIBDIR=/usr/lib${LIBDIRSUFFIX} \
     -DCMAKE_INSTALL_DOCDIR=/usr/doc/libjpeg-turbo-${VERSION} \
     -DCMAKE_INSTALL_MANDIR=/usr/man \
     -DENABLE_STATIC=OFF \
diff -ur slackware64-current/source/l/libssh/libssh.SlackBuild slackware64-current.2/source/l/libssh/libssh.SlackBuild
--- slackware64-current/source/l/libssh/libssh.SlackBuild	2021-11-04 12:17:09.000000000 +0100
+++ slackware64-current.2/source/l/libssh/libssh.SlackBuild	2022-01-11 20:29:10.000000000 +0100
@@ -92,6 +92,7 @@
     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
     -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+    -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
     -DWITH_GCRYPT=1 \
     -DWITH_SSH1=1 \
     -DWITH_PCAP=1 \
diff -ur slackware64-14.2/patches/source/lxc/lxc.SlackBuild
--- slackware64-14.2/patches/source/lxc/lxc.SlackBuild.orig	2022-07-04 13:15:48.784815154 +0000
+++ slackware64-14.2/patches/source/lxc/lxc.SlackBuild	2022-07-04 19:50:27.728260488 +0000
@@ -76,6 +76,9 @@
 tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
 cd $PKGNAM-$VERSION
 
+# Add support for getxpid (alpha):
+zcat $CWD/alpha_getxpid.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-14.2/source/l/mozilla-nss/mozilla-nss.SlackBuild slackware64-14.2.patcharm/source/l/mozilla-nss/mozilla-nss.SlackBuild
--- slackware64-14.2/source/l/mozilla-nss/mozilla-nss.SlackBuild	2016-03-09 18:57:25.000000000 +0100
+++ slackware64-14.2.patcharm/source/l/mozilla-nss/mozilla-nss.SlackBuild	2018-08-23 20:45:53.965492043 +0200
@@ -46,7 +46,6 @@
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -fPIC"
   LIBDIRSUFFIX="64"
-  export USE_64=1
 elif [ "$ARCH" = "armv7hl" ]; then
   SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
   LIBDIRSUFFIX=""
@@ -62,6 +64,11 @@
 # Seems parallel build does not work with this.
 #NUMJOBS=${NUMJOBS:-" -j7 "}
 
+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
 
diff -ur slackware64-14.2/patches/source/zlib/zlib.SlackBuild
--- slackware64-14.2/patches/source/zlib/zlib.SlackBuild.orig	2022-07-04 13:15:48.784815154 +0000
+++ slackware64-14.2/patches/source/zlib/zlib.SlackBuild	2022-07-04 19:50:27.728260488 +0000
@@ -72,6 +72,9 @@
 tar xvf $CWD/zlib-$VERSION.tar.xz || exit 1
 cd zlib-$VERSION || exit 1
 
+# Fix incorrect option for sparc:
+sed -i 's/-Wl,--no-warn-rwx-segments//' configure
+
 chown -R root:root .
 find . \
   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff -ur slackware64-14.2/patches/source/ghostscript/ghostscript.SlackBuild
--- slackware64-14.2/patches/source/ghostscript/ghostscript.SlackBuild.orig	2021-09-30 16:23:02.891888608 +0200
+++ slackware64-14.2/patches/source/ghostscript/ghostscript.SlackBuild	2023-05-15 16:11:06.235145538 +0200
@@ -90,6 +90,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 . \
diff -ur slackware64-14.2/patches/source/openvpn/openvpn.SlackBuild
--- slackware64-14.2/patches/source/openvpn/openvpn.SlackBuild.orig	2020-04-17 05:32:14.020869619 +0200
+++ slackware64-14.2/patches/source/openvpn/openvpn.SlackBuild	2024-02-11 13:26:20.208176080 +0100
@@ -24,7 +24,7 @@
 cd $(dirname $0) ; CWD=$(pwd)
 
 PKGNAM=openvpn
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
 BUILD=${BUILD:-1_slack14.2}
 
 # Automatically determine the architecture we're building on:
@@ -68,7 +68,7 @@
 mkdir -p $TMP $PKG
 cd $TMP
 rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
 cd $PKGNAM-$VERSION || exit 1
 
 # Fix ownership and permissions inside the source tarball.
diff -ur slackware64-14.2/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild
--- slackware64-14.2/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild.orig	2022-01-19 18:32:39.886151755 +0100
+++ slackware64-14.2/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild	2024-02-29 11:24:18.154927388 +0100
@@ -25,7 +25,7 @@
 
 PKGNAM=wpa_supplicant
 VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-2_slack14.2}
+BUILD=${BUILD:-3_slack14.2}
 
 SRCVERSION=$(printf $VERSION | tr _ -)
 
@@ -103,6 +103,9 @@
 zcat $CWD/patches/0002-dragonfly-Add-sqrt-helper-function.patch.gz | patch -p1 --verbose || exit 1
 zcat $CWD/patches/0003-SAE-Derive-the-y-coordinate-for-PWE-with-own-impleme.patch.gz | patch -p1 --verbose || exit 1
 zcat $CWD/patches/0004-EAP-pwd-Derive-the-y-coordinate-for-PWE-with-own-imp.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/8e6485a1bcb0baffdea9e55255a81270b768439c.patch.gz | patch -p1 --verbose || exit 1
+# The above patch is for newer gcc, that automatically include <stdbool.h>. Fix it for gcc 5:
+zcat $CWD/patches/missing_stdbool_include_gcc5.diff.gz | patch -p1 --verbose || exit 1
 
 ## This patch is not applicable to systems running OpenSSL before 1.1.1:
 ## Allow legacy tls to avoid breaking WPA2-Enterprise:
diff -ur slackware64-14.2/source/l/glibc/glibc.SlackBuild slackware64-14.2.patcharm/source/l/glibc/glibc.SlackBuild
--- slackware64-14.2/source/l/glibc/glibc.SlackBuild	2016-02-20 18:34:55.000000000 +0100
+++ slackware64-14.2.patcharm/source/l/glibc/glibc.SlackBuild	2024-04-26 18:02:40.184637206 +0200
@@ -70,20 +70,23 @@
     OPTIMIZ="-O3 -fPIC"
     LIBDIRSUFFIX="64"
     ;;
+  aarch64)
+    OPTIMIZ="-O3"
+    LIBDIRSUFFIX="64"
+    ;;
+  sparc)
+    OPTIMIZ="-O3 -mcpu=leon3"
+    LIBDIRSUFFIX=""
+    ;;
   *)
     OPTIMIZ="-O3"
-    LIBDIRSUFFIX=""
+    LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
     ;;
 esac
 
 case $ARCH in
-  x86_64)
-    TARGET=${TARGET:-x86_64}
-    ;;
-  i586)
-    # This should be i586 for all 32-bit x86 arch:
-    TARGET=${TARGET:-i586}
-    ;;
+    arm*) TARGET=${TARGET:-$ARCH-slackware-linux-gnueabi} ;;
+    *)    TARGET=${TARGET:-$ARCH-slackware-linux} ;;
 esac
 
 # Hand off the $ARCH variable to $SLACKWARE_ARCH to avoid confusing glibc:
@@ -108,18 +107,42 @@
 # This function fixes a doinst.sh file for x86_64.
 # With thanks to Fred Emmott.
 fix_doinst() {
-  if [ "x$LIBDIRSUFFIX" = "x" ]; then
-    return;
-  fi;
+  if [ "x$LIBDIRSUFFIX" != "x" ]; then
   # Fix "( cd usr/lib ;" occurrences
   sed -i "s#lib ;#lib${LIBDIRSUFFIX} ;#" install/doinst.sh
   # Fix "lib/" occurrences
   sed -i "s#lib/#lib${LIBDIRSUFFIX}/#g" install/doinst.sh
   # Fix "( cd lib" occurrences
   sed -i "s#( cd lib\$#( cd lib${LIBDIRSUFFIX}#" install/doinst.sh
+  fi;
 
   if [ "$SLACKWARE_ARCH" = "x86_64" ]; then
     sed -i 's#ld-linux.so.2#ld-linux-x86-64.so.2#' install/doinst.sh
+  elif [ "$SLACKWARE_ARCH" = "aarch64" ]; then
+    sed -i 's#ld-linux.so.2#ld-linux-aarch64.so.1#' 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
+      sed -i "s|^# Reload|(cd lib; ln -sf ../lib$LIBDIRSUFFIX/ld-linux-aarch64.so.1 .)\n\n# Reload|" install/doinst.sh
+    fi
+  elif [ "$SLACKWARE_ARCH" = "s390x" ]; then
+    sed -i 's#ld-linux.so.2#ld64.so.1#' install/doinst.sh
+    if [[ "x$LIBDIRSUFFIX" != "x" ]]
+    then
+      # All binaries are linked by default to /lib/ld64.so.1, so make sure
+      # the file/link exists
+      sed -i "s|^# Reload|(cd lib; ln -sf ../lib$LIBDIRSUFFIX/ld64.so.1 .)\n\n# Reload|" install/doinst.sh
+    fi
+  elif [ "$SLACKWARE_ARCH" = "hppa" ]; then
+    sed -i 's#ld-linux.so.2#ld.so.1#' 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
+      sed -i "s|^# Reload|(cd lib$LIBDIRSUFFIX; ln -s $lib.1 $lib 2>/dev/null)\n# Reload|" install/doinst.sh
+    done
   fi
 }
 
@@ -228,7 +240,7 @@
   --with-tls \
   --with-__thread \
   --without-cvs \
-  $TARGET-slackware-linux
+  $TARGET
 
 make $NUMJOBS || make || exit 1
 make install install_root=$PKG || exit 1
diff -ur slackware64-14.2/patches/source/libarchive/libarchive.SlackBuild
--- slackware64-14.2/patches/source/libarchive/libarchive.SlackBuild.orig	2023-09-18 07:06:14.730724072 +0200
+++ slackware64-14.2/patches/source/libarchive/libarchive.SlackBuild	2024-04-26 17:47:32.535288547 +0200
@@ -25,7 +25,7 @@
 
 PKGNAM=libarchive
 VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1_slack14.2}
+BUILD=${BUILD:-2_slack14.2}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -73,6 +73,9 @@
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;
 
+# CVE-2024-26256:
+cat $CWD/eb7939b24a681a04648a59cdebd386b1e9dc9237.patch | patch -p1 --verbose || exit 1
+
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
 ./configure \
