tce-load -i compiletc cmake libxml2-dev libffi-dev ninja python cd llvm-8.0.0.src tar -xf ../cfe-8.0.0.src.tar.xz -C tools tar -xf ../compiler-rt-8.0.0.src.tar.xz -C projects mv tools/cfe-8.0.0.src tools/clang mv projects/compiler-rt-8.0.0.src projects/compiler-rt mkdir build cd build cmake -LAH -DCMAKE_C_FLAGS_RELEASE="-march=pentium-m -mtune=i686 -Os -pipe" -DCMAKE_CXX_FLAGS_RELEASE="-march=pentium-m -mtune=i686 -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;AMDGPU;BPF" -DLLVM_ENABLE_RTTI=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE -DLLVM_BINUTILS_INCDIR=/usr/local/include -Wno-dev -G Ninja ../ [-i486 fails] [-lto fail due to lack of memory] find . -name flags.make -type f -exec sed -i 's/ -O3 -g//g' {} \; find . -name flags.make -type f -exec sed -i 's/ -O3//g' {} \; find . -name link.txt -type f -exec sed -i 's/-Wl,-O3/-Wl -Os/g' {} \; find . -name AddLLVM.cmake -type f -exec sed -i 's/-Wl,-O3/-Wl,-Os/g' {} \; find . -name compile_commands.json -type f -exec sed -i 's/ -O3 -g//g' {} \; find . -name build.make -type f -exec sed -i 's/ -O3 -g//g' {} \; find . -name build.ninja -type f -exec sed -i 's/-Wl,-O3 -wl/-Wl,-Os -Wl/g' {} \; find . -name build.ninja -type f -exec sed -i 's/-Wl,-O3/-Wl,-Os/g' {} \; find . -name build.ninja -type f -exec sed -i 's/-O3 -g/-Os/g' {} \; find . -name build.ninja -type f -exec sed -i 's/-O3/-Os/g' {} \; find . -name compile_commands.json -type f -exec sed -i 's/-O3/-Os/g' {} \; ninja [1h 24m 36s] sudo ninja install sudo mkdir /usr/local/lib/bfd-plugins cd /usr/local/lib/bfd-plugins sudo ln -s ../LLVMgold.so ./ [links against ncursesw without ncursesw-dev]