tce-load -i compiletc cmake python libxml2-dev libffi-dev cd llvm-4.0.1.src tar -xf ../cfe-4.0.1.src.tar.xz -C tools tar -xf ../compiler-rt-4.0.1.src.tar.xz -C projects mv tools/cfe-4.0.1.src tools/clang mv projects/compiler-rt-4.0.1.src projects/compiler-rt patch -Np1 -d projects/compiler-rt < ../compiler-rt-4.0.1-glibc-2.26-1.patch mkdir build cd build cmake -LAH -DCMAKE_ASM_FLAGS_RELEASE="-march=i486 -mtune=i686 -Os -pipe" -DCMAKE_C_FLAGS_RELEASE="-march=i486 -mtune=i686 -Os -pipe" -DCMAKE_CXX_FLAGS_RELEASE="-march=i486 -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" -DCMAKE_BUILD_TYPE=release -DLLVM_ENABLE_LTO=OFF -DCMAKE_VERBOSE_MAKEFILE=TRUE -DLLVM_BINUTILS_INCDIR=/usr/local/include -Wno-dev ../ -flto will not build in 4gb find . -name Makefile.config -type f -exec sed -i 's/-O3//g' {} \; make -j5 non-lto [59m 11.15s] sudo make install sudo mkdir /usr/local/lib/bfd-plugins cd /usr/local/lib/bfd-plugins sudo ln -s ../LLVMgold.so ./