tc16_armhf (on tc15 armhf) on pi5 with unamehack(armv7l)

tce-load -i compiletc bash texinfo squashfs-tools python3.11 coreutils

###perl5 ncurses-dev bash mpc-dev libudev-dev coreutils glibc_apps gettext python3.11 texinfo

export TC=/mnt/tc [***]

export MAKEFLAGS='-j6'

sudo mkdir $TC
sudo mount /dev/nvme0n1p6 $TC [***]

sudo mkdir -pv $TC/usr
sudo mkdir -pv $TC/lib
sudo mkdir -pv $TC/var
sudo mkdir -pv $TC/etc
sudo mkdir -pv $TC/bin
sudo mkdir -pv $TC/sbin

sudo chown -v tc:staff $TC/usr
sudo chown -v tc:staff $TC/lib
sudo chown -v tc:staff $TC/var
sudo chown -v tc:staff $TC/etc
sudo chown -v tc:staff $TC/bin
sudo chown -v tc:staff $TC/sbin


sudo mkdir $TC/tools [***] 
sudo chown tc:staff $TC/tools [***]

sudo ln -s $TC/tools / [***]

sudo mkdir $TC/sources
sudo chown tc:staff $TC/sources

cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\[\033[01;32m\]\u@tc15:\[\033[00m\]\[\033[01;34m\]\w\$ \[\033[00m\]' /bin/bash
EOF

cat > ~/.bashrc << "EOF"
set +h
umask 022
TC=/mnt/tc
LC_ALL=POSIX
TC_TGT=arm-tc-linux-gnueabihf
PATH=$TC/tools/bin:/usr/local/bin:/bin:/usr/bin
export TC LC_ALL TC_TGT PATH
export MAKEFLAGS='-j6'

alias ls='ls -p'
alias ll='ls -l'
alias la='ls -la'
EOF

source ~/.bash_profile

----------

cd binutils-2.43.1

mkdir build
cd build

../configure --prefix=$TC/tools --with-sysroot=$TC --target=$TC_TGT --disable-nls --enable-gprofng=no --disable-werror \
--enable-new-dtags --enable-default-hash-style=gnu --with-float=hard --with-fpu=vfp

make && make install
#[1m52.511s]


cd gcc-14.2.0

tar -xf ../mpfr-4.2.1.tar.xz
mv mpfr-4.2.1 mpfr
tar -xf ../gmp-6.3.0.tar.xz
mv gmp-6.3.0 gmp
tar -xf ../mpc-1.3.1.tar.gz
mv mpc-1.3.1 mpc

mkdir build
cd build

../configure --target=$TC_TGT --prefix=$TC/tools --with-glibc-version=2.40 --with-sysroot=$TC --with-newlib \
--without-headers --enable-default-pie --enable-initfini-array --disable-nls --disable-shared --disable-multilib \
--disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libquadmath \
--disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ \
--with-float=hard --with-fpu=vfp

make && make install
#[20m21.674s]

cd ..
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > `dirname $($TC_TGT-gcc -print-libgcc-file-name)`/include/limits.h


cd linux-rpi-6.12.y

make mrproper

make headers
find usr/include -type f ! -name '*.h' -delete
cp -rv usr/include $TC/usr [need to save]


cd glibc-2.40

edit manual/libc.tcexinfo
remove @documentencoding UTF-8

#####sed '/MAKEFLAGS :=/s/)r/) -r/' -i Makerules

patch -Np1 -i ../glibc-2.40-fhs-1.patch

mkdir build
cd build

echo "rootsbindir=/usr/sbin" > configparms

../configure --prefix=/usr --host=$TC_TGT --build=$(../scripts/config.guess) --enable-kernel=6.6.1 \
--with-headers=$TC/usr/include libc_cv_slibdir=/lib --disable-nscd

make && make DESTDIR=$TC install
#[10m17.933s]

sed '/RTLDLIST=/s@/usr@@g' -i $TC/usr/bin/ldd

echo 'int main(){}' > dummy.c
$TC_TGT-gcc dummy.c
readelf -l a.out | grep '/ld-linux'

[Requesting program interpreter: /lib/ld-linux-armhf.so.3]  Must referecne armhf

rm dummy.c a.out

#######$TC/tools/libexec/gcc/$TC_TGT/14.2.0/install-tools/mkheaders


cd gcc-14.2.0 (libstdc++)

mkdir build
cd build

../libstdc++-v3/configure --host=$TC_TGT --build=$(../config.guess) --prefix=/usr --disable-multilib \
--disable-nls --disable-libstdcxx-pch --with-gxx-include-dir=/tools/$TC_TGT/include/c++/14.2.0

make && make DESTDIR=$TC install
#[0m46.085s]

rm -v $TC/usr/lib/lib{stdc++{,exp,fs},supc++}.la

----

cd m4-1.4.19

./configure --prefix=/usr --host=$TC_TGT --build=$(build-aux/config.guess)

make && make DESTDIR=$TC install
#[14s]


cd ncurses-6.5

mkdir build
cd build
  ../configure
  make -C include
  make -C progs tic
cd ..

./configure --prefix=/usr --host=$TC_TGT --build=$(./config.guess) --mandir=/usr/share/man \
--with-manpage-format=normal --with-shared --without-normal --with-cxx-shared --without-debug \
--without-ada --disable-stripping AWK=gawk

make [0m26.163s]

make DESTDIR=$TC TIC_PATH=$(pwd)/build/progs/tic install

ln -sv libncursesw.so $TC/usr/lib/libncurses.so
sed -e 's/^#if.*XOPEN.*$/#if 1/' -i $TC/usr/include/curses.h


cd bash-5.2.37

./configure --prefix=/usr --build=$(support/config.guess) --host=$TC_TGT --without-bash-malloc

make && make DESTDIR=$TC install
#[0m20.225s]


ln -sv $TC/usr/bin/bash $TC/bin/sh
ln -sv $TC/usr/bin/bash $TC/bin/bash

cd coreutils-9.5

./configure --prefix=/usr --host=$TC_TGT --build=$(build-aux/config.guess) --enable-install-program=hostname \
--enable-no-install-program=kill,uptime

make && make DESTDIR=$TC install
#[0m35.924s]

mv -v $TC/usr/bin/chroot $TC/usr/sbin
mkdir -pv $TC/usr/share/man/man8
mv -v $TC/usr/share/man/man1/chroot.1 $TC/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $TC/usr/share/man/man8/chroot.8


cd diffutils-3.10

./configure --prefix=/usr --host=$TC_TGT --build=$(./build-aux/config.guess)

make && make DESTDIR=$TC install
#[0m5.853s]


cd file-5.46

mkdir build
cd build
../configure --disable-bzlib --disable-libseccomp --disable-xzlib --disable-zlib
make
cd ..

./configure --prefix=/usr --host=$TC_TGT --build=$(./config.guess)

make -j6 FILE_COMPILE=$(pwd)/build/src/file && make DESTDIR=$TC install
# [0m6.344s]

rm -v $TC/usr/lib/libmagic.la


cd findutils-4.10.0

./configure --prefix=/usr -localstatedir=/var/lib/locale --host=$TC_TGT --build=$(build-aux/config.guess)

make && make DESTDIR=$TC install
#[0m11.780s]


cd gawk-5.3.1

sed -i 's/extras//' Makefile.in

./configure --prefix=/usr --host=$TC_TGT --build=$(./config.guess)

make && make DESTDIR=$TC install
#[0m15.242s]


cd grep-3.11

./configure --prefix=/usr --host=$TC_TGT

make && make DESTDIR=$TC install
#[0m5.899s]


cd gzip-1.13

./configure --prefix=/usr --host=$TC_TGT

make && make DESTDIR=$TC install
#[0m3.227s]


cd make-4.4.1

./configure --prefix=/usr --without-guile --host=$TC_TGT --build=$(build-aux/config.guess)

make && make DESTDIR=$TC install
#[0m3.691s]


cd patch-2.7.6

./configure --prefix=/usr --host=$TC_TGT --build=$(build-aux/config.guess)

make && make DESTDIR=$TC install
#[0m5.111s]


cd sed-4.9

./configure --prefix=/usr --host=$TC_TGT

make && make DESTDIR=$TC install
#[0m3.913s]


cd tar-1.35

./configure --prefix=/usr --host=$TC_TGT --build=$(build-aux/config.guess)

make && make DESTDIR=$TC install
#[0m14.615s]


cd xz-5.6.3

./configure --prefix=/usr --host=$TC_TGT --build=$(build-aux/config.guess) --disable-static \
--docdir=/usr/share/doc/xz-5.6.3

make && make DESTDIR=$TC install
#[0m7.392s]

rm -v $TC/usr/lib/liblzma.la


cd binutils-2.43.1

sed '6009s/$add_dir//' -i ltmain.sh

mkdir build
cd build

../configure --prefix=/usr --build=$(../config.guess) --host=$TC_TGT --disable-nls --enable-shared \
--enable-gprofng=no --disable-werror --enable-64-bit-bfd --enable-default-hash-style=gnu \
--with-float=hard --with-fpu=vfp

make && make DESTDIR=$TC install
#[2m2.112s]

rm -v $TC/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}


cd gcc-14.2.0

tar -xf ../mpfr-4.2.1.tar.xz
mv mpfr-4.2.1 mpfr
tar -xf ../gmp-6.3.0.tar.xz
mv gmp-6.3.0 gmp
tar -xf ../mpc-1.3.1.tar.gz
mv mpc-1.3.1 mpc


sed '/thread_header =/s/@.*@/gthr-posix.h/' -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in

mkdir build
cd build

../configure --build=$(../config.guess) --host=$TC_TGT --target=$TC_TGT LDFLAGS_FOR_TARGET=-L$PWD/$TC_TGT/libgcc \
--prefix=/usr --with-build-sysroot=$TC --enable-default-pie --enable-default-ssp  --disable-nls --disable-multilib \
--disable-libatomic --disable-libgomp --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libvtv \
--enable-languages=c,c++ --with-cpu=arm1176jzf-s --with-float=hard --with-fpu=vfp

make && make DESTDIR=$TC install
#[21m46.893s]

ln -sv gcc $TC/usr/bin/cc

----

sudo chown -R root:root $TC/{usr,lib,var,etc,bin,sbin,tools}

sudo mkdir -pv $TC/{dev,proc,sys,run}

sudo mount -v --bind /dev $TC/dev

sudo mount -v --bind /dev/pts $TC/dev/pts
sudo mount -vt proc proc $TC/proc
sudo mount -vt sysfs sysfs $TC/sys
sudo mount -vt tmpfs tmpfs $TC/run

sudo /usr/local/sbin/chroot "$TC" /usr/bin/env -i HOME=/root TERM="$TERM" \
PS1='(chrt16)\[\033[01;32m\]\u:\[\033[00m\]\[\033[01;34m\]\w\$\[\033[00m\]  ' \
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin /usr/bin/bash --login +h

----

mkdir -pv /{boot,home,mnt,opt,srv}

mkdir -pv /etc/{opt,sysconfig}
mkdir -pv /lib/firmware
mkdir -pv /media/{floppy,cdrom}
mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -pv /usr/{,local/}share/man/man{1..8}
mkdir -pv /var/{cache,local,log,mail,opt,spool}
mkdir -pv /var/lib/{color,misc,locate}

ln -sfv /run /var/run
ln -sfv /run/lock /var/lock

install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp

ln -sv /proc/self/mounts /etc/mtab

cat > /etc/hosts << EOF
127.0.0.1  localhost $(hostname)
::1        localhost
EOF

[copy tc /etc/passwd and /etc/group files to $TC/etc]

exec /usr/bin/bash --login +h

touch /var/log/{btmp,lastlog,faillog,wtmp}

chmod -v 664  /var/log/lastlog
chmod -v 600  /var/log/btmp

export MAKEFLAGS='-j6'

----

cd gettext-0.22.5

./configure --disable-shared

make [4m9.107s]

cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin


###cd bison-3.8.2  - segfaults in some cases on arm, use older version.
cd bison-3.7.6

./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.6

make && make install
#[0m30.294s]


cd perl-5.40.1

sh Configure -des -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/lib/perl5/5.40/core_perl \
-Darchlib=/usr/lib/perl5/5.40/core_perl -Dsitelib=/usr/lib/perl5/5.40/site_perl \
-Dsitearch=/usr/lib/perl5/5.40/site_perl -Dvendorlib=/usr/lib/perl5/5.40/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.40/vendor_perl

make && make install
#[5m25.069s]


cd Python-3.13.2  (Required libatomic, use 3.12.2 for now)

./configure --prefix=/usr --enable-shared --without-ensurepip

make && make install
#[5m13.577s]


cd texinfo-7.1.1

./configure --prefix=/usr

make && make install
#[0m35.538s]


cd util-linux-2.40.2

add tty:x:5: to /etc/group

mkdir -pv /var/lib/hwclock

./configure ADJTIME_PATH=/var/lib/hwclock/adjtime --libdir=/usr/lib --docdir=/usr/share/doc/util-linux-2.40.2 \
--disable-chfn-chsh --disable-login --disable-nologin --disable-su --disable-setpriv --disable-runuser \
--disable-pylibmount --disable-static --without-python --disable-liblastlog2 runstatedir=/run

make && make install
[2m15.747s]

----

find /usr/{lib,libexec} -name \*.la -delete
rm -rf /usr/share/{info,man,doc}/*

*/////
----

cd glibc-2.40

######sed '/MAKEFLAGS :=/s/)r/) -r/' -i Makerules

patch -Np1 -i ../glibc-2.40-fhs-1.patch

edit Makeconfig
remove -g -O

edit manual/libc.texinfo
remove @documentencoding UTF-8

mkdir build
cd build

echo "rootsbindir=/usr/sbin" > configparms

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" ../configure --prefix=/usr --disable-werror \
--enable-kernel=6.6.1 --enable-stack-protector=strong --with-headers=/usr/include libc_cv_slibdir=/lib \
--disable-nscd --enable-obsolete-rpc --libexecdir=/usr/lib/glibc [still get libexec...]

verify config.h
/* The ARM hard-float ABI is being used.  */
#define HAVE_ARM_PCS_VFP 1

find . -name config.make -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;
find ../ -name Makeconfig -type f -exec sed -i 's/-g -O2//g' {} \;

make [10m33.457s]

touch /etc/ld.so.conf

sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile

make install [install install_root=/tmp/pkg] 

sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd

make localedata/install-locales [13m37.869s]

localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true

[copy tc /etc/nsswitch.conf and /etc/ld.so.conf files to $TC/etc]


cd libxcrypt-4.4.36

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk \
-Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr --disable-static --enable-hashes=strong,glibc \
--disable-failure-tokens --enable-obsolete-api=glibc --docdir=/usr/local/share/doc/libxcrypt-4.4.36

find . -name Makefile -type f -exec sed -i 's/-O3//g' {} \;

make && make install
# [0m8.974s]

rm /usr/lib/libcrypt.la


cd zlib-1.2.13

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk \
-Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr

find . -name Makefile -type f -exec sed -i 's/-O3//g' {} \;

make && make install
#[0m4.404s]


cd bzip2-1.0.8

patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch

sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile

Edit Makefile-libbz2_so
CC=gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe
CFLAGS=-fpic -fPIC -Wall -Winline $(BIGFILES)

make -f Makefile-libbz2_so [0m1.897s]
make clean

Edit Makefile
CC=gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe
CFLAGS=-Wall -Winline $(BIGFILES)

make [0m2.169s]
make PREFIX=/usr/local install

cp bzip2-shared /usr/local/bin/bzip2
cp -a libbz2.so* /usr/local/lib
cd /usr/local/lib
ln -s libbz2.so.1.0 libbz2.so
cd ../bin
rm {bunzip2,bzcat}
ln -s bzip2 bunzip2
ln -s bzip2 bzcat

ldconfig

cd xz-5.6.3

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk \
-Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --disable-static \
--docdir=/usr/local/share/doc/xz-5.6.3

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make && make install
#[0m17.246s]


ldconfig


cd zstd-1.5.6

find . -name Makefile -type f -exec sed -i 's/-O3//g' {} \;
find . -name libzstd.mk -type f -exec sed -i 's/-O3//g' {} \;

make -j6 CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" [0m25.340s]

make CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" prefix=/usr/local install

ldconfig


cd file-5.46

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make && make install
#[0m7.850s]


ldconfig


cd readline-8.2.13

sed -i '/MV.*old/d' Makefile.in
sed -i '/{OLDSUFF}/c:' support/shlib-install


CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --disable-static --with-curses --docdir=/usr/local/share/doc/readline-8.2.13

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make SHLIB_LIBS="-lncursesw" [0m8.267s]
make SHLIB_LIBS="-lncursesw" install


cd m4-1.4.19

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make && make install
#[0m16.857s]


cd bc-7.0.3 

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" ./configure  --prefix=/usr/local -G -r

make && make install
#[0m4.343s]



cd flex-2.6.4

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --docdir=/usr/local/share/doc/flex-2.6.4

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make && make install
#[0m12.411s]

ln -sv flex /usr/local/bin/lex

ldconfig

cd pkg-config-0.29.2

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --with-internal-glib --disable-host-tool \
--docdir=/usr/local/share/doc/pkg-config-0.29.2 \
--with-pc-path="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/share/pkgconfig"

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-g -Wall -O2/-Wall/g' {} \;

make && make install
#[0m15.100s]


cd binutils-2.43.1

patch -Np1 -i ../binutils-2.43.1-upstream_fix-1.patch

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
../configure --prefix=/usr --enable-gold --enable-ld=default --enable-plugins --enable-shared \
--disable-werror --enable-64-bit-bfd --with-system-zlib --enable-new-dtags --enable-default-hash-style=gnu  \
--with-float=hard --with-fpu=vfp

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \;

make tooldir=/usr [8m32.816s]

make -k check
grep '^FAIL:' $(find -name '*.log')

make tooldir=/usr install

rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a


cd gmp-6.3.0

mv config{fsf,}.guess
mv config{fsf,}.sub

# Need to disable assembly when compiling on a pi4, perhaps recompile on a pizero later

ABI=32 \
CFLAGS="-mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -mfloat-abi=hard" \
CXXFLAGS="-mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -mfloat-abi=hard" \
./configure --prefix=/usr/local --enable-cxx --disable-static --docdir=/usr/local/share/doc/gmp-6.3.0 \
--enable-assembly=no

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [1m7.135s]
make install

ldconfig


cd mpfr-4.2.1

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
./configure --prefix=/usr/local --disable-static --enable-thread-safe --docdir=/usr/local/share/doc/mpfr-4.2.1

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m44.418s]
make install

ldconfig


cd mpc-1.3.1

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
./configure --prefix=/usr/local --disable-static --docdir=/usr/local/share/doc/mpc-1.3.1

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m9.559s]
make install

ldconfig


cd isl-0.24 [https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.24.tar.bz2]

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
./configure --prefix=/usr/local --disable-static

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O3//g' {} \;

make [1m1.755s]
make install

ldconfig


cd gcc-14.2.0

#do not disable bootstrap on arm - libstdc++ will not build properly

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
../configure --prefix=/usr LD=ld --enable-languages=c,c++ --enable-default-pie --enable-default-ssp \
--disable-multilib --with-system-zlib --libexecdir=/usr/lib \
--with-cpu=arm1176jzf-s --with-float=hard --with-fpu=vfp \
--with-isl=/usr/local \
--with-mpfr=/usr/local \
--with-gmp=/usr/local \
--with-mpc=/usr/local \
--enable-lto \
--with-pkgversion=piCore \
--disable-fixincludes

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;
[-O2 still appears building libs]

make [79m31.108s]
make install

ln -svr /usr/bin/cpp /usr/lib

ln -sfv ../../lib/gcc/$(gcc -dumpmachine)/14.2.0/liblto_plugin.so /usr/lib/bfd-plugins/

mkdir -pv /usr/share/gdb/auto-load/usr/lib
mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib

echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'

      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]

grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log

[grep -E -o '/usr/lib.*/S?crt[1in].*succeeded' dummy.log]
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/14.2.0/../../../crti.o succeeded
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/14.2.0/../../../crtn.o succeeded


grep -B4 '^ /usr/include' dummy.log

#include <...> search starts here:
 /usr/lib/gcc/armv7l-unknown-linux-gnueabihf/14.2.0/include
 /usr/local/include
 /usr/lib/gcc/armv7l-unknown-linux-gnueabihf/14.2.0/include-fixed
 /usr/include


grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'

SEARCH_DIR("/usr/armv7l-unknown-linux-gnueabihf/lib")
SEARCH_DIR("/usr/local/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("/usr/lib");

grep "/lib.*/libc.so.6 " dummy.log

attempt to open /lib/libc.so.6 succeeded

grep found dummy.log

found ld-linux-armhf.so.3 at /lib/ld-linux-armhf.so.3

rm -v dummy.c a.out dummy.log

#Before stripping libstdc++.so check
nm /usr/lib/libstdc++.so.6.0.33 | grep futex

[001b2f99 b _ZNSt12_GLOBAL__N_132futex_clock_realtime_unavailableE
001b2f98 b _ZNSt12_GLOBAL__N_133futex_clock_monotonic_unavailableE
000ba644 T _ZNSt28__atomic_futex_unsigned_base19_M_futex_notify_allEPj
000ba264 T _ZNSt28__atomic_futex_unsigned_base19_M_futex_wait_untilEPjjbNSt6chrono8durationIxSt5ratioILx1ELx1EEEENS2_IxS3_ILx1ELx1000000000EEEE
000ba458 T _ZNSt28__atomic_futex_unsigned_base26_M_futex_wait_until_steadyEPjjbNSt6chrono8durationIxSt5ratioILx1ELx1EEEENS2_IxS3_ILx1ELx1000000000EEEE
]


----

cd binutils-2.43.1

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
../configure --prefix=/usr/local --enable-gold --enable-ld=default --enable-plugins --enable-shared \
--disable-werror --enable-64-bit-bfd --with-system-zlib   --enable-new-dtags --enable-default-hash-style=gnu \
--with-float=hard --with-fpu=vfp

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \;

make tooldir=/usr/local [9m14.277s]
make tooldir=/usr/local install

rm -v $TMPDIR/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}

[remove binutils from /usr]
ldconfig


cd gcc-14.2.0

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
../configure --prefix=/usr/local --enable-languages=c,c++ --enable-default-pie --enable-default-ssp \
--disable-multilib --disable-bootstrap --with-system-zlib --libexecdir=/usr/local/lib \
--with-cpu=arm1176jzf-s --with-float=hard --with-fpu=vfp \
--with-isl=/usr/local \
--with-mpfr=/usr/local \
--with-gmp=/usr/local \
--with-mpc=/usr/local \
--enable-lto \
--with-pkgversion=piCore \
--disable-fixincludes


find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;

make [45m31.900s]
make install

ln -sv /usr/local/bin/gcc /usr/local/bin/cc [check]
ln -sv /usr/local/bin/cpp /usr/local/lib
install -v -dm755 /usr/local/lib/bfd-plugins
ln -sfv /usr/local/lib/gcc/$(gcc -dumpmachine)/14.2.0/liblto_plugin.so /usr/local/lib/bfd-plugins/

mkdir -pv /usr/local/share/gdb/auto-load/usr/local/lib
mv -v /usr/local/lib/*gdb.py /usr/local/share/gdb/auto-load/usr/local/lib

[remove gcc from /usr except libstdc++ and libgcc_s]

ldconfig

----

cd pkg-config-0.29.2

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --with-internal-glib --disable-host-tool \
--docdir=/usr/local/share/doc/pkg-config-0.29.2 \
--with-pc-path="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/share/pkgconfig"

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-g -Wall -O2/-Wall/g' {} \;

make [0m15.100s]
make install


cd ncurses-6.5

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --mandir=/usr/local/share/man --with-shared --without-debug \
--without-normal --with-cxx-shared --enable-pc-files --enable-widec \
--with-pkg-config-libdir=/usr/local/lib/pkgconfig

find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;

make [0m51.052s]
make install

[remove ncurses from /usr]
ldconfig

cd sed-4.9

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m5.768s]
make install

[rm /usr/bin/sed]


cd gettext-0.22.5

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --disable-static --docdir=/usr/local/share/doc/gettext-0.21.1

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [6m42.799s]
make install

chmod -v 0755 /usr/local/lib/preloadable_libintl.so

[rm /usr/bin/{msgfmt,msgmerge,xgettext}]

ldconfig


cd bison-3.7.6   (3.8.2 segfaults on armhf during certain builds)

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --docdir=/usr/local/share/doc/bison-3.8.2

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m18.907s]
make install

[remove bison files from /usr]


cd grep-3.11

sed -i "s/echo/#echo/" src/egrep.sh

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m7.409s]
make install

[remove grep from /bin]


cd bash-5.2.37

LIBS="-lncursesw" CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --docdir=/usr/local/share/doc/bash-5.2.37 --without-bash-malloc \
--with-installed-readline

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m34.300s]
make install

cd /bin
rm sh
ln -sv /usr/local/bin/bash ./
ln -sv /usr/local/bin/bash ./sh

exec /bin/bash --login +h


cd libtool-2.4.7

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --disable-static

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m1.554s]
make install


cd gperf-3.1

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --docdir=/usr/local/share/doc/gperf-3.1

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m2.487s]
make install


cd expat-2.6.2

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --disable-static --docdir=/usr/local/share/doc/expat-2.5.0

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m5.956s]
make install

ldconfig


cd perl-5.40.1

export BUILD_ZLIB=False
export BUILD_BZIP2=0

sh Configure -des -Dcc="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
-Dprefix=/usr/local -Dvendorprefix=/usr/local -Dprivlib=/usr/local/lib/perl5/core_perl \
-Darchlib=/usr/local/lib/perl5/5.40/core_perl -Dsitelib=/usr/local/lib/perl5/site_perl \
-Dsitearch=/usr/local/lib/perl5/5.40/site_perl -Dvendorlib=/usr/local/lib/perl5/vendor_perl \
-Dvendorarch=/usr/local/lib/perl5/5.40/vendor_perl -Dman1dir=/usr/local/share/man/man1 \
-Dman3dir=/usr/local/share/man/man3 -Dpager="/usr/bin/less -isR" -Duseshrplib -Dusethreads \
-Duselargefiles -Dusemultiplicity -Duse64bitint -Darchname=arm-linux-gnueabihf-thread-multi-64int

find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;

make [4m57.025s]
make install

unset BUILD_ZLIB BUILD_BZIP2

rm /usr/bin/perl


cd XML-Parser-2.46

perl Makefile.PL

find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;

make [0m2.140s]
make install


cd intltool-0.51.0

sed -i 's:\\\${:\\\$\\{:' intltool-update.in

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

make [0m0.032s]
make install


cd autoconf-2.71

sed -e 's/SECONDS|/&SHLVL|/' -e '/BASH_ARGV=/a\        /^SHLVL=/ d' -i.orig tests/local.at

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

make [0m0.827s]
make install


cd automake-1.16.5

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

make [0m0.683s]
make install


cd coreutils-9.5

patch -Np1 -i ../coreutils-9.5-i18n-2.patch

autoreconf -fiv

export FORCE_UNSAFE_CONFIGURE=1
CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --enable-no-install-program=kill,uptime --libexecdir=/usr/local/lib

[flto fails]

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;

make [1m2.727s]
make install

mv -v /usr/local/bin/chroot /usr/local/sbin

unset FORCE_UNSAFE_CONFIGURE=1

cd diffutils-3.10

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m9.563s]
make install


cd gawk-5.3.1

sed -i 's/extras//' Makefile.in

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --libexecdir=/usr/local/lib/gawk

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m22.426s]
make install


cd findutils-4.10.0

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --localstatedir=/var/lib/locate --libexecdir=/usr/local/lib/findutils

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m12.526s]
make install

edit /usr/local/bin/updatedb
/usr/local/bin/sort -> /usr/bin/sort


cd groff-1.23.0

edit /usr/bin/texi2any
#! /usr/local/bin/perl

PAGE=A4 CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make -j1 [1m11.581s]
make install


cd gzip-1.13

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m4.211s]
make install


cd make-4.4.1

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m6.032s]]
make install


cd patch-2.7.6

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m6.396s]
make install


cd tar-1.35

FORCE_UNSAFE_CONFIGURE=1 CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --libexecdir=/usr/local/lib/tar

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m19.495s]
make install


cd texinfo-7.1.1

edit configure
TERMLIB_VARIANTS="tinfo ncursesw curses termlib termcap terminfo"
#include <ncursesw/termcap.h

CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [0m23.159s]
make install
make TEXMF=/usr/local/share/texmf install-tex


cd util-linux-2.40.2

mkdir -pv /var/lib/hwclock

ADJTIME_PATH=/var/lib/hwclock/adjtime CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --disable-chfn-chsh --disable-login --disable-nologin --disable-su --disable-setpriv \
--disable-runuser --disable-pylibmount --disable-static --without-python --without-systemd \
--without-systemdsystemunitdir --libexecdir=/lib runstatedir=/run --docdir=/usr/local/share/doc/util-linux-2.40.2

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [1m36.640s]
make install

ldconfig

Required for base
/lib/libblkid.so.1
/lib/libblkid.so.1.1.0
/lib/libuuid.so.1
/lib/libuuid.so.1.3.0
/sbin/blkid
/usr/bin/uuidgen



cd e2fsprogs-1.47.1

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
../configure --prefix=/usr --bindir=/bin --with-root-prefix="" --enable-elf-shlibs \
--disable-libblkid --disable-libuuid --disable-uuidd --disable-fsck

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;

make [0m49.376s]
make install
make install-libs
chmod u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a

Required for base
/etc/mke2fs.conf
/lib/libcom_err.so.2
/lib/libcom_err.so.2.1
/lib/libe2p.so.2
/lib/libe2p.so.2.3
/lib/libext2fs.so.2
/lib/libext2fs.so.2.4
/sbin/e2fsck
/sbin/mke2fs
/sbin/tune2fs
/sbin/resize2fs
/usr/sbin/mklost+found

----------

cd util-linux-2.40.2

ADJTIME_PATH=/var/lib/hwclock/adjtime CC="gcc  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++  -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local --disable-chfn-chsh --disable-login --disable-nologin --disable-su \
--disable-setpriv --disable-runuser --disable-pylibmount --disable-static --without-python \
--without-systemd --without-systemdsystemunitdir --libexecdir=/usr/local/lib --localstatedir=/var \
runstatedir=/run --docdir=/usr/local/share/doc/util-linux-2.40.2

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [1m36.801s]
make install


cd e2fsprogs-1.47.1

mkdir build
cd build

CC="gcc -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe" \
CXX="g++ -mtune=arm1176jzf-s -mfpu=vfp -march=armv6zk -Os -pipe -fno-exceptions -fno-rtti" \
../configure --prefix=/usr/local --enable-elf-shlibs --disable-libblkid --disable-libuuid \
--disable-uuidd --disable-fsck

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;

make [0m49.489s]
make install
make install-libs
chmod u+w /usr/local/lib/{libcom_err,libe2p,libext2fs,libss}.a

[remove files to match base/extension setup]
