aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-06-13 10:03:11 +0000
committerDimitry Andric <dim@FreeBSD.org>2026-06-16 17:01:10 +0000
commitf81c82a9db12685f98421bfe9c368ff9a214c844 (patch)
tree9694c08ee9c62f56b4464b6907e98ad8430c6ffc
parente5e9bda914251583fe073fbb360b6f4dc988e4e9 (diff)
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596) When the linker is specified as ld, toolchain applies special handling by invoking (triple)-ld instead of resolving ld via standard PATH lookup. This causes GNU ld installed via the system package manager to take the precedence (since (triple)-ld appears earlier in the search path), effectively overriding ld.lld. As a result, we set the default Linker on FreeBSD to ld.lld to indicate we want to use lld by default. PR: 292067 MFC after: 3 days (cherry picked from commit 2b619b7c7b5300cbaf59e4e9d75bc8472df014e9)
-rw-r--r--contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
index 7d090ba682b3..60ce0bdbfc31 100644
--- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
+++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
@@ -91,6 +91,10 @@ public:
// Until dtrace (via CTF) and LLDB can deal with distributed debug info,
// FreeBSD defaults to standalone/full debug info.
bool GetDefaultStandaloneDebug() const override { return true; }
+ // On FreeBSD, `/usr/bin/ld` is `ld.lld`, but other things may be installed in
+ // the path named `ld` or `{triple}-ld`, which may be picked by preference if
+ // we default to `ld` here.
+ const char *getDefaultLinker() const override { return "ld.lld"; }
protected:
Tool *buildAssembler() const override;