swift
swift copied to clipboard
Enable Build-Time Configurable Linker Selection in The Old Swift Driver
Adding the ability to specify the default linker at toolchain-build time instead of using the existing heuristics. This will allow us to build internally consistent toolchains that use lld, for example. This also lines the old driver behavior up with the new driver, which falls back on clang to determine the default linker to use. This means that the new driver is indirectly configured to use whatever CLANG_DEFAULT_LINKER
was set to as its default linker. To match everything up, I am re-using that macro-define in the old driver to ensure that it uses the same linker.
You may notice that I've also pulled out the PRETTY_NAME
check for the string "Amazon Linux 2023"
. This is fairly brittle as the string may not exactly match that (might contain build numbers or dot releases), and it isn't exactly scalable. Instead, we should just configure the toolchain to use lld
when building the toolchain on (and for) Amazon Linux 2023.
Finally, I've added a new set of builbot_linux presets that use lld
as the default linker (both in the new and old driver).