I tried with both ld.gold and lld and they are now both getting this error:
CMake Error at /home/build/swift-project/build/buildbot_linux/llvm-linux-aarch64/lib/cmake/llvm/HandleLLVMOptions.cmake:330 (message):
Host compiler does not support '-fuse-ld=lld'
And:
CMake Error at cmake/modules/HandleLLVMOptions.cmake:330 (message):
Host compiler does not support '-fuse-ld=ld.gold'
Call Stack (most recent call first):
CMakeLists.txt:918 (include)
I tried with the short modification you sent, as well as the full gentoo section one you had also provided.