Compiled on RPI4B-8G with 6.6.47-piCore-v8 on portable SSD

Compile Flags:
CC='clang --gcc-install-dir=/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/13.2.0'
CXX='clang++ --gcc-install-dir=/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/13.2.0'
CFLAGS='-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe'
CXXFLAGS='-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe'
EXTRA_C=' -L/usr/local/lib -flto=full -fuse-ld=lld -fno-exceptions -Wno-fortify-source'
EXTRA_CXX=' -L/usr/local/lib -flto=full -fuse-ld=lld -fno-exceptions -fno-rtti -Wno-fortify-source'
CFLAGS="${CFLAGS}${EXTRA_C}"
CXXFLAGS="${CXXFLAGS}${EXTRA_CXX}"
LDFLAGS='-Wl,-L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,-O1'
export CC CXX CFLAGS CXXFLAGS LDFLAGS

Dependencies:
automake
clang
coreutils
gettext-dev
git
gtk3-dev
libtool-dev
lld
procps-ng
python3.11-setuptools
python3.11-dev

Commands:

# System adjustment, stop python from adding unwanted flags (-g, -O3)
# Make these files are modified
py1=/usr/local/lib/python3.11/config-3.11-arm-linux-gnueabihf/Makefile
py2=/usr/local/lib/python3.11/_sysconfigdata__linux_arm-linux-gnueabihf.py
sudo busybox cp $(realpath $py1) $py1
sudo busybox cp $(realpath $py2) $py2
sudo sed -i 's/-g -fwrapv -O3/-fwrapv/g' $py1 $py2
unset py1 py2

git clone --depth 1 https://github.com/distcc/distcc.git

cd distcc/

############################################
$ git log -n 1
commit 5394870bed00c20fc9914e303356103ecd3394a6 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Martin Pool <mbp@sourcefrog.net>
Date:   Tue Oct 15 08:16:13 2024 -0700

    Merge pull request #532 from distcc/ci-macos

    fix: disable macOS CI for now
############################################


# -Wno-strict-prototypes
patch -Np1 < ../distcc.void.patch

# adjust hardcoded file path for TC (/usr/lib --> /usr/local/lib)
patch -Np1 < ../distcc.path.patch

./autogen.sh

./configure --prefix=/usr/local --without-libiberty

time make -j4
real    0m 27.70s
user    1m 8.05s
sys     0m 4.58s

make install DESTDIR=/mnt/sda1/unstripped-copies/distcc

# packing

cd $(mktemp -d)

cp -r /mnt/sda1/unstripped-copies/distcc .

rm -fr ./distcc/usr/local/sbin ./distcc/usr/local/lib/python3.11/site-packages/include_server/__pycache__/ ./distcc/usr/local/share/man ./distcc/usr/local/share/doc/distcc/example ./distcc/usr/local/share/doc/distcc/*txt

# MASQUERADING

mkdir ./distcc/usr/local/lib/distcc

cd ./distcc/usr/local/lib/distcc

COMPILER='gfortran
armv7l-unknown-linux-gnueabihf-c++
armv7l-unknown-linux-gnueabihf-g++
armv7l-unknown-linux-gnueabihf-gcc
c++
cc
g++
gcc'

for COM in $COMPILER; do
  ln -s /usr/local/bin/distcc $COM
done

# clang needs special care on piCore 32-bit
vi clang clang++
chmod +x clang clang++

# /usr/local/tce.installed/distcc

cd ../..
mkdir -m 775 tce.installed
cp /mnt/sda1/notes/tce-installed/distcc tce.installed/

# strip

find -type f -exec head -c4 {} ';' -print | awk '/^\x7fELF/{print(substr($0,5))}' | xargs llvm-strip --strip-unneeded

# example file

cp /mnt/sda1/notes/extra-files/distcc/tc.sh ./share/doc/distcc/

# commands.allow.sh

cat /mnt/sda1/notes/extra-files/distcc/commands.allow.sh > ./etc/distcc/commands.allow.sh

# extra deps

echo procps-ng.tcz >> distcc.tcz.dep