Compiled on {RPI4B4G, RPI3B} cluster with 5.10.77-piCore-v8 Dependencies: python3.8 distcc cmake libxml2-dev ninja Distcc: RPI4B4G is the worker (Volunteer) tce-load -i distcc (Worker) mkdir ~/.distcc # 3 jobs on localhost, 5 jobs will freeze, 4 jobs not tested vi ~/.distcc/hosts localhost/3 192.168.0.30/5 Turn off "-flto" because distcc [-DLLVM_ENABLE_LTO=Full] [libexecdir needs setting] --> untouched Commands: export PATH=/usr/lib/distcc:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin tar -xf llvm-13.0.1.src.tar.xz cd llvm-13.0.1.src tar -xf ../clang-13.0.1.src.tar.xz -C tools tar -xf ../compiler-rt-13.0.1.src.tar.xz -C projects mv tools/clang-13.0.1.src tools/clang mv projects/compiler-rt-13.0.1.src projects/compiler-rt mkdir build && cd build time cmake -LAH -DCMAKE_C_FLAGS_RELEASE="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe" \ -DCMAKE_CXX_FLAGS_RELEASE="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe" \ -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_ENABLE_FFI=ON -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_ENABLE_RTTI=ON \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE \ -DLLVM_BINUTILS_INCDIR=/usr/local/include -Wno-dev -G Ninja .. 2>&1 | tee /tmp/cmake real 1m 38.30s user 1m 0.46s sys 0m 26.17s sed -i.orig -e 's:-Wl,-O3:-Wl,-Os:g' -e 's: -O3 : :g' -e 's: -g : :g' build.ninja CMakeCache.txt compile_commands.json time ninja -j8 2>&1 | tee /tmp/ninja real 5h 38m 17s user 16h 17m 23s sys 44m 3.42s Packing: DESTDIR=/tmp/packing-llvm ninja install sudo ninja install cd /tmp/packing-llvm find -type f -exec file {} ';' > /tmp/file.info # strip .a files grep 'current ar archive' /tmp/file.info | cut -d : -f 1 | xargs llvm-strip --strip-debug # strip executables, shared objects grep 'not stripped' /tmp/file.info | grep -v 'relocatable' | cut -d : -f 1 | xargs llvm-strip --strip-unneeded # these 'relocatable' files should not be stripped # ./usr/local/lib/clang/13.0.1/lib/linux/clang_rt.crtbegin-aarch64.o # ./usr/local/lib/clang/13.0.1/lib/linux/clang_rt.crtend-aarch64.o ## llvm-bin mkdir -p /tmp/packing-llvm-bin/usr/local/bin mkdir -p /tmp/packing-llvm-dev/usr/local/bin mkdir -p /tmp/packing-clang/usr/local/bin cd ./usr/local/bin # llvm-config belongs to dev mv llvm-config /tmp/packing-llvm-dev/usr/local/bin mv llvm* /tmp/packing-llvm-bin/usr/local/bin # binaries for clang mv *clang* /tmp/packing-clang/usr/local/bin for F in *; do grep -q "bin/${F}$" /tmp/clang.tcz.list && \ mv $F /tmp/packing-clang/usr/local/bin done # c-index-test diagtool mv c-index-test diagtool /tmp/packing-clang/usr/local/bin # the rest mv * /tmp/packing-llvm-bin/usr/local/bin # reset directory cd ../../.. ## clang # LTO mkdir -p /tmp/packing-clang/usr/local/lib/bfd-plugins mv ./usr/local/lib/LLVMgold.so /tmp/packing-clang/usr/local/lib ln -vs /usr/local/lib/LLVMgold.so -t /tmp/packing-clang/usr/local/lib/bfd-plugins # include/clang mkdir -p /tmp/packing-clang/usr/local/include mv ./usr/local/include/clang /tmp/packing-clang/usr/local/include # include/clang-c mv ./usr/local/include/clang-c /tmp/packing-clang/usr/local/include # share/clang mkdir -p /tmp/packing-clang/usr/local/share mv ./usr/local/share/clang /tmp/packing-clang/usr/local/share # share/scan-build mv ./usr/local/share/scan-build /tmp/packing-clang/usr/local/share # share/scan-view mv ./usr/local/share/scan-view /tmp/packing-clang/usr/local/share # share/opt-viewer mv ./usr/local/share/opt-viewer /tmp/packing-clang/usr/local/share # libexec mv ./usr/local/libexec /tmp/packing-clang/usr/local # lib/cmake/clang mkdir -p /tmp/packing-clang/usr/local/lib/cmake mv ./usr/local/lib/cmake/clang /tmp/packing-clang/usr/local/lib/cmake # lib/libclang* mv ./usr/local/lib/libclang* /tmp/packing-clang/usr/local/lib # lib/clang mv ./usr/local/lib/clang /tmp/packing-clang/usr/local/lib # lib/libscanbuild mv ./usr/local/lib/libscanbuild /tmp/packing-clang/usr/local/lib ## llvm-lib # libLLVM-13.0.1.so, libLLVM-13.so, libLLVM.so, libLTO.so, libLTO.so.13, libRemarks.so, libRemarks.so.13 mkdir -p /tmp/packing-llvm-lib/usr/local/lib mv ./usr/local/lib/*so* /tmp/packing-llvm-lib/usr/local/lib ## llvm-dev mkdir -p /tmp/packing-llvm-dev/usr/local/include mv ./usr/local/include/llvm* /tmp/packing-llvm-dev/usr/local/include # lib directory mv ./usr/local/lib /tmp/packing-llvm-dev/usr/local # remove empty directories (if any) find /tmp/packing-* -depth -exec rmdir {} ';' 2> /dev/null Start-up script # /usr/local/tce.installed/clang #!/bin/sh # distcc if [ -f /usr/local/tce.installed/distcc ]; then cd /usr/lib/distcc ln -sf ../../local/bin/distcc clang ln -sf ../../local/bin/distcc clang++ cd /usr/local/lib/distcc ln -sf ../../bin/distcc clang ln -sf ../../bin/distcc clang++ fi