My usual build invocation suddenly started recently failing because it's selecting gold as the linker and passing it an invalid option --color-diagnostics
.
Here is the error:
FAILED: lib/swift/linux/x86_64/libswiftRemoteMirror.so
: && /home/augusto/developer/swift-project-2/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./bin/clang++ -fPIC -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3 -Wl,--color-diagnostics -target x86_64-unknown-linux-gnu -fuse-ld=gold -shared -Wl,-soname,libswiftRemoteMirror.so -o lib/swift/linux/x86_64/libswiftRemoteMirror.so stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/ErrorHandling.cpp.o stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/Hashing.cpp.o stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/MemAlloc.cpp.o stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/SmallPtrSet.cpp.o stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/SmallVector.cpp.o stdlib/public/LLVMSupport/CMakeFiles/swiftLLVMSupport-linux-x86_64.dir/StringRef.cpp.o stdlib/public/SwiftRemoteMirror/CMakeFiles/swiftRemoteMirror-linux-x86_64.dir/SwiftRemoteMirror.cpp.o -L/home/augusto/developer/swift-project-2/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib -L/home/augusto/developer/swift-project-2/build/Ninja-ReleaseAssert/swift-linux-x86_64/./lib/swift/linux/x86_64 -L/home/augusto/developer/swift-project-2/build/Ninja-ReleaseAssert/swift-linux-x86_64/./bin/../lib/swift/linux/x86_64 -L/home/augusto/developer/swift-project-2/build/Ninja-ReleaseAssert/swift-linux-x86_64/./bin/../lib/swift/linux -L//usr/lib/swift -Wl,-rpath,"\$ORIGIN" lib/swift/linux/x86_64/libswiftReflection.a -lpthread -ldl && :
/usr/bin/ld.gold: --color-diagnostics: unknown option
/usr/bin/ld.gold: use the --help option for usage information
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
Notice that we're selecting gold as the linker: -fuse-ld=gold
.
I'm unsure if the problem is that we're selecting gold as the linker, or if that's correct and we shouldn't be passing --color-diagnostics
.
Could this be a bug on the make file that applies only to Ubuntu 20.04?