In theory? we should be able to build -HEAD with CROSS_TOOLCHAIN even if we don't have a host compiler. However in practice, building the host tools fails very early because we're checking the compiler/type version early in the .mk files, before CC is defined correctly. Also, there's a fun question around whether this is acceptable or not, as we still need /host/ tools and a cross compile GCC is't that. (ie, we don't TECHICALLY have a HOST_TOOLCHAIN option.) To reproduce: * build a system with WITHOUT_TOOLCHAIN="YES" * make, make install * pkg install llvm13 (for example) * make delete-old ; this will remove the old compiler pieces and make things very broken * try rebuilding
I also stepped into this issue by running make delete-old, which then removes "cc". What i expected, that /usr/share/toolchains/llvm14.mk ( which is created after pkg install llvm14 ) is, then, correctly exported and used during CROSS_TOOLCHAIN but it doesn't. The only way to use external toolchain is to explicitly set CC, CXX, LD, AR, AS, OBJDUMP ( and all other ) with corresponding PATH, installed by llvm pkg, in /etc/make.conf. I am not sure whether it is expected, works as intended, but it looks that more information WITHOUT_TOOLCHAIN and potential danger steps user can make.