I had planned to put together DistCC as an extension for x86/64 and ARM6/7/8 but I'm running into a few obstacles.
The first thing she complained about is missing the Libery Library (libiberty) which I'm "guessing" was deprecated a while back as I can see it in GCC source, but doesn't mean it was compiled in, so I'm building --without-libiberty to get passed the issue for the moment and config/make goes through without issue.
make check, however, fails with a python self-test (see source note below)
A fresh set of eyes would be truly appreciated!
#!/bin/sh
CUR=$(pwd)
# Common ANSI Colors
RED="$(echo -e '\033[1;31m')"; GREEN="$(echo -e '\033[1;32m')"
YELLOW="$(echo -e '\033[1;33m')"; BLUE="$(echo -e '\033[1;34m')"
MAGENTA="$(echo -e '\033[1;35m')"; CYAN="$(echo -e '\033[1;36m')"
WHITE="$(echo -e '\033[1;37m')"; NORMAL="$(echo -e '\033[0;39m')"
GetProcessorType()
{
BITS=""; [ ! "$(uname -r | grep 64)" == "" ] && BITS="64"
CPU=`uname -m`
case "$CPU" in
i686)
CFLAGS="$FLTO -fuse-linker-plugin -march=i486 -mtune=i686 $OPTIMIZE $SYMBOLS $DEFINES -pipe -Wall -Wextra -fno-plt"
CXXFLAGS="$FLTO -fuse-linker-plugin -march=i486 -mtune=i686 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn"
;;
x86_64)
CFLAGS="$FLTO -fuse-linker-plugin -mtune=generic $OPTIMIZE $SYMBOLS $DEFINES -pipe -Wall -Wextra -fno-plt"
CXXFLAGS="$FLTO -fuse-linker-plugin -mtune=generic $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_x86_64.xbn"
;;
armv*)
CFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp $OPTIMIZE $SYMBOLS $DEFINES -pipe -Wall -Wextra"
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-O1"
;;
aarch64)
CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 $OPTIMIZE $SYMBOLS $DEFINES -pipe -Wall -Wextra"
CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a72 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-O1"
;;
*)
echo "$PROCESSOR_TYPE: Unknown processor type. Please add an entry for it in this script."
exit
;;
esac
export CPU BITS CFLAGS CXXFLAGS LDFLAGS
}
nproc()
{
LARGE=0
ITEMS=$(cat /proc/cpuinfo | grep "processor" | grep ":" | awk -F: '{print $2}')
for ITEM in $ITEMS
do
[ $ITEM -gt $LARGE ] && LARGE=$ITEM
done
LARGE=$(expr $LARGE + 1) 2>/dev/null
echo $LARGE
}
###################################################################
### This is just to create a clean slate for running extensions ###
###################################################################
# echo "Dismounting extensions"; cd /tmp/tcloop; sudo umount * >/dev/null 2>&1; sudo rmdir * >/dev/null 2>&1
# echo "Clearing Installations"; cd /usr/local/tce.installed; sudo rm *
cd $CUR
echo -n "Loading extensions "
EXTS="wget compiletc cpp bc ncursesw-dev mpc-dev coreutils glibc_apps gettext gdb python3.9-dev \
git autoconf automake udev-lib-dev texinfo coreutils elfutils-dev zsync squashfs-tools \
libtirpc-dev libtool-dev pkg-config gtk4-dev libgnomecanvas-dev libglade-dev pango-dev"
CNT=0
for EXT in $EXTS
do
EXT=${EXT/.tcz/}
echo -n " ${YELLOW}${EXT}${NORMAL}"
[ ! -f /etc/sysconfig/tcedir/optional/${EXT}.tcz ] && tce-load -w ${EXT} >/dev/null 2>&1
[ ! -d /tmp/tcloop/${EXT} ] && tce-load -i ${EXT} >/dev/null 2>&1
CNT=$(expr $CNT + 1)
if [ $CNT -gt 6 ]; then
echo
echo -n " "
CNT=0
fi
done
echo
####################################################################
### This is just to get a list of tags/versions available on GIT ###
####################################################################
echo "Gathering source tags"
[ ! -f tags.html ] && wget -q -O tags.html https://github.com/distcc/distcc/tags
cat tags.html | grep "/tag/" | awk -F "href=" '{print $2}' | awk -F "\"" '{print $2}' > tags.lst
mkdir -p /tmp/taglist && rm /tmp/taglist -fR
mkdir -p /tmp/taglist
for TAG in $(cat tags.lst)
do
TAG=$(basename $TAG)
touch /tmp/taglist/$TAG
done
cd /tmp/taglist
ls -1 | grep "v" | sort -r > $CUR/tags.lst
########################################
### The version we're going to build ###
########################################
version=v3.4
### Go GIT our intended source
cd $CUR
[ ! -d distcc ] && git clone https://github.com/distcc/distcc.git
### Switch over to $version ###
cd distcc; git checkout ${version}
# Real Binary Python3 - probably not "NECESSARY" but just in case #
sudo rm /usr/local/bin/python3
sudo cp -a /usr/local/bin/python3.9 /usr/local/bin/python3
GetProcessorType
if [ ! -f ../configure ]; then
echo "Launching autogen"
./autogen.sh || exit 1
fi
mkdir -p build; cd build
#########################################
### LibIberty no longer in compiler?? ###
### MAY be necessary for @file calls ###
#########################################
if [ ! -f ../Makefile ]; then
echo "Launching configure"
../configure --without-libiberty || exit 1
fi
echo "${CYAN}Running MAKE${NORMAL}"
make -j$(nproc) || exit 1
### ERROR: include_analyzer_test.py
# ======================================================================
# FAIL: test_AdvancedComputedIncludes (__main__.IncludeAnalyzerTest)
# ----------------------------------------------------------------------
echo "${CYAN}Running MAKE : CHECK${NORMAL}"
make check || exit 1
echo "${CYAN}Running MAKE : INSTALL${NORMAL}"
sudo make DESTDIR=/tmp/distcc install
#echo "Running MAKE : INSTALL : CHECK"
#sudo make DESTDIR=/tmp/distcc installcheck