tce-load -i compiletc cmake libxml2-dev libffi-dev ninja wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang-13.0.0.src.tar.xz wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/compiler-rt-13.0.0.src.tar.xz cd llvm-13.0.0.src tar -xf ../clang-13.0.0.src.tar.xz -C tools mv tools/clang-13.0.0.src tools/clang tar -xf ../compiler-rt-13.0.0.src.tar.xz -C projects mv projects/compiler-rt-13.0.0.src projects/compiler-rt grep -rl '#!.*python' | xargs sed -i '1s/python$/python3/' 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 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_LIBEXECDIR=lib/clang -Wno-dev -G Ninja ../ [static libs huge with -flto] 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 [2h 11m 46s] 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] FAILED: lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o /usr/local/bin/c++ -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen/SelectionDAG -I../lib/CodeGen/SelectionDAG -Iinclude -I../include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -march=pentium-m -mtune=i686 -Os -pipe -fno-exceptions -std=c++14 -MD -MT lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o -MF lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o.d -o lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o -c ../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp {standard input}: Assembler messages: {standard input}:54880: Warning: end of file not at end of a line; newline inserted {standard input}:55525: Error: bad register name `%eb' {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive c++: fatal error: Killed signal terminated program cc1plus compilation terminated.