I just finished my first cross-compilation of busybox 1.31.1 for x86-64 using my running Slitaz...!
As a first successful run I strictly followed the Cross-Linux-From-Scratch instructions published under
http://clfs.org/view/sysvinit/x86_64/
to build a x86-64 toolchain containing gcc 7.1.0, glibc 2.25 and Kernel 4.9.21.
My sooner attempts with the newest tools and libraries (gcc 10.2.0, glibc 2.32 and Kernel 5.10.3) failed at some point but I will try to push further in the coming days.
If you download the source files as directed on the CLFS-page, you can either go through the process step by step or use the attached file containing the same (making it executable).
The cross-toolchain should be the first step; as soon as this is up and running stable with most recent versions, we should concentrate on the wok, that already contains cross-compiling capabilities (which might need adaption, I don't know yet...).
If we achieve a stable cross-compilation x86-64 wok, and therefore are able to cook all necessary packages, the way to a x86-64 Slitaz might be ready to go....
Or - dear more experienced experts - am I totally naive and wrong ?!?
Attachment not working... so as code:
#!/bin/sh
### Build up new SliTaz Toolchain for i686 and x86_64 cross compilation
### derived from Cross-Linux-From-Scratch: http://clfs.org/view/sysvinit/x86_64/
# compilation with i7-4700QM (haswell) 64bit Kernel 4.2.8 in RAM
# ${THREADS}=1: 1h14mm
# ${THREADS}=8: 0h25mm
### prepare path variables ###
export SFS=/home/slitaz
export TEMPPATH=/tmp
export SRCPATH=/media/Daten/Slitaz64_bootstrap/source
export CROSSPATH=$SFS/cross-tools
export TOOLPATH=/tools
export SFS_HOST=i486-slitaz-linux
export SFS_TARGET=x86_64-slitaz-linux-gnu
export SFS_TARGET32=i686-slitaz-linux-gnu
export BUILD32="-m32"
export BUILD64="-m64"
export THREADS=$(grep processor /proc/cpuinfo | wc -l)
mkdir -p ${SFS}${TOOLPATH}
ln -sf ${SFS}${TOOLPATH} /
mkdir -p ${CROSSPATH}
export PATH=${CROSSPATH}/bin:$PATH
### install local prerequisites, delete gcc 4.6 and choose gcc-8.3 ###
tazpkg recharge
tazpkg -gi slitaz-toolchain pkg-config patch libtool rsync file texinfo gawk
# texinfo bash gawk py3k gettext-tools grep file rsync libtool pkg-config patch
tazpkg -cc
mkdir -p $TEMPPATH/unpacked && cd $TEMPPATH/unpacked
# for SRCFILE in ${SRCPATH}/*.tar*; do tar xf $SRCFILE; done
find ${SRCPATH}/*tar* -exec sh -c "tar xf \"{}\" &" \;
while [ -n "$(pidof tar)" ]
do
wait
done
date +"%H:%M:%S" > /tmp/compiletime.txt
cd file*
./configure --prefix=${CROSSPATH} && make -j${THREADS} && make install
cd ../linux*
xzcat ${SRCPATH}/patch-4.9.21.xz | patch -Np1 -i -
make mrproper
make ARCH=x86_64 headers_check
make ARCH=x86_64 INSTALL_HDR_PATH=${TOOLPATH} headers_install
cd ../m4*
./configure --prefix=${CROSSPATH} && make -j${THREADS} && make install
cd ../ncurses*
AWK=gawk ./configure --prefix=${CROSSPATH} --without-debug && make -C include && make -C progs tic
install -v -m755 progs/tic ${CROSSPATH}/bin
cd ../pkg-config-lite*
./configure --prefix=${CROSSPATH} --host=${SFS_TARGET} --with-pc-path=${TOOLPATH}/lib64/pkgconfig:${TOOLPATH}/share/pkgconfig && make -j${THREADS} && make install
cd ../gmp*
./configure --prefix=${CROSSPATH} --enable-cxx --disable-static && make -j${THREADS} && make install
cd ../mpfr*
patch -Np1 -i ${SRCPATH}/mpfr-3.1.5-fixes-1.patch
LDFLAGS="-Wl,-rpath,${CROSSPATH}/lib" ./configure --prefix=${CROSSPATH} --disable-static --with-gmp=${CROSSPATH} && make -j${THREADS} && make install
cd ../mpc*
LDFLAGS="-Wl,-rpath,${CROSSPATH}/lib" ./configure --prefix=${CROSSPATH} --disable-static --with-gmp=${CROSSPATH} --with-mpfr=${CROSSPATH} && make -j${THREADS} && make install
cd ../isl*
LDFLAGS="-Wl,-rpath,${CROSSPATH}/lib" ./configure --prefix=${CROSSPATH} --disable-static --with-gmp-prefix=${CROSSPATH} && make -j${THREADS} && make install
cd ../binutils*
mkdir build && cd build/
AR=ar AS=as ../configure --prefix=${CROSSPATH} --host=${SFS_HOST} --target=${SFS_TARGET} --with-sysroot=${SFS} --with-lib-path=${TOOLPATH}/lib:${TOOLPATH}/lib64 --disable-nls --disable-static --enable-64-bit-bfd --enable-gold=yes --enable-plugins --enable-threads --disable-werror
make -j${THREADS} && make install
cd ../../gcc*
patch -Np1 -i ${SRCPATH}/gcc-7.1.0-specs-1.patch
echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "'${TOOLPATH}'/lib/"\n' >> gcc/config/linux.h
echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
touch ${TOOLPATH}/include/limits.h
mkdir build && cd build
AR=ar LDFLAGS="-Wl,-rpath,${CROSSPATH}/lib" ../configure --prefix=${CROSSPATH} --build=${SFS_HOST} --host=${SFS_HOST} --target=${SFS_TARGET} --with-sysroot=${SFS} --with-local-prefix=${TOOLPATH} --with-native-system-header-dir=${TOOLPATH}/include --disable-shared --with-mpfr=${CROSSPATH} --with-gmp=${CROSSPATH} --with-mpc=${CROSSPATH} --without-headers --with-newlib --disable-decimal-float --disable-libgomp --disable-libssp --disable-libatomic --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libvtv --disable-libcilkrts --disable-libstdc++-v3 --disable-threads --with-isl=${CROSSPATH} --enable-languages=c --with-glibc-version=2.25
make -j${THREADS} all-gcc all-target-libgcc
make install-gcc install-target-libgcc
cd ../../glibc*
mkdir build32 && cd build32
BUILD_CC="gcc" CC="${SFS_TARGET}-gcc ${BUILD32}" AR="${SFS_TARGET}-ar" RANLIB="${SFS_TARGET}-ranlib" ../configure --prefix=${TOOLPATH} --host=${SFS_TARGET32} --build=${SFS_HOST} --enable-kernel=3.12.0 --with-binutils=${CROSSPATH}/bin --with-headers=${TOOLPATH}/include --enable-obsolete-rpc
make -j${THREADS} && make install
cd ..
mkdir build64 && cd build64
echo "libc_cv_slibdir=${TOOLPATH}/lib64" >> config.cache
BUILD_CC="gcc" CC="${SFS_TARGET}-gcc ${BUILD64}" AR="${SFS_TARGET}-ar" RANLIB="${SFS_TARGET}-ranlib" ../configure --prefix=${TOOLPATH} --host=${SFS_TARGET} --build=${SFS_HOST} --libdir=${TOOLPATH}/lib64 --enable-kernel=3.12.0 --with-binutils=${CROSSPATH}/bin --with-headers=${TOOLPATH}/include --enable-obsolete-rpc --cache-file=config.cache
make -j${THREADS} && make install
cd ../../gcc*
mkdir build2 && cd build2
AR=ar LDFLAGS="-Wl,-rpath,${CROSSPATH}/lib" ../configure --prefix=${CROSSPATH} --build=${SFS_HOST} --target=${SFS_TARGET} --host=${SFS_HOST} --with-sysroot=${SFS} --with-local-prefix=${TOOLPATH} --with-native-system-header-dir=${TOOLPATH}/include --disable-static --enable-languages=c,c++ --with-mpc=${CROSSPATH} --with-mpfr=${CROSSPATH} --with-gmp=${CROSSPATH} --with-isl=${CROSSPATH}
make -j${THREADS} AS_FOR_TARGET="${SFS_TARGET}-as" LD_FOR_TARGET="${SFS_TARGET}-ld"
make install
date +"%H:%M:%S" >> /tmp/compiletime.txt