Waiting for clang. Forever and ever.

FreeBSD compiles with LLVM/clang by default. Part of this is compiling the compiler to accommodate upgrades of the compiler.

On my laptop FreeBSD compiles in about 2 hours. But clang takes 2 hours on its own. The culprit is that now and than a small fix is made to the compiler which triggers 2 hours of extra building.

It is also possible to install llvm as a pkg. This saves you hours of compiling. I tried to built base with the port, but it did not succeed yet. I now have setup FreeBSD in a container (FreeBSD jail) which helps greatly in fixing mistakes instead of a non bootable system without a working compiler I can now just reinstall the container from a working host.

My changes to make this working:

This is on:
FreeBSD sjakie 13.0-CURRENT FreeBSD 13.0-CURRENT #11 r364932M: Sat Aug 29 03:21:18 CEST 2020

Add to /etc/src.conf:
WITHOUT_CLANG=true
WITHOUT_CLANG_IS_CC=true
WITHOUT_CLANG_BOOTSTRAP=true
WITHOUT_LLD=true
WITHOUT_LLD_IS_LD=true
WITHOUT_LLD_BOOTSTRAP=true
WITHOUT_LLDB=true
WITHOUT_LLVM_COV=true

Add to /etc/make.conf:
LLVMVER=11
CC=/usr/local/bin/clang${LLVMVER}
CXX=/usr/local/bin/clang++${LLVMVER}
CPP=/usr/local/bin/clang-cpp${LLVMVER}
LD=/usr/local/bin/ld.lld${LLVMVER}
XCC=${CC}
XLD=${LD}

And "pkg install llvm11" or the llvm version that is current in your version of FreeBSD.

Next up: configuring this on my Raspberry Pi 3 on which compilation takes far longer, so the win is much bigger.

Comments

Popular posts from this blog

FreeBSD running vlan and bridge on one shared interface