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="-flto -fuse-linker-plugin -mtune=generic -Os -pipe" -DCMAKE_C_FLAGS_RELEASE="-flto -fuse-linker-plugin -mtune=generic -Os -pipe" -DCMAKE_CXX_FLAGS_RELEASE="-flto -fuse-linker-plugin -mtune=generic -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 -DCMAKE_VERBOSE_MAKEFILE=TRUE -DLLVM_BINUTILS_INCDIR=/usr/local/include -Wno-dev ../ -DLLVM_ENABLE_LTO=OFF 31,849,592 libLLVM-4.0.so 32,063,666 libclangSema.a -DLLVM_ENABLE_LTO=ON 28,733,176 libLLVM-4.0.so 142,114,566 libclangSema.a -DBUILD_SHARED_LIBS=ON [not used - all libs shared] -DCMAKE_INSTALL_LIBEXECDIR="lib/clang" [has no effect] find . -name Makefile.config -type f -exec sed -i 's/-O3//g' {} \; make -j5 [1h 5m 00s] no lto [49m 22.84s] sudo make install