Skip to content

Commit b03056a

Browse files
committed
Recover original lld check
1 parent da36ced commit b03056a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,14 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
863863
const bool IsOSAIX = Triple.isOSAIX();
864864
const bool IsAMDGCN = Triple.isAMDGCN();
865865
StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ);
866+
const char *LinkerPath = Args.MakeArgString(ToolChain.GetLinkerPath());
866867
const Driver &D = ToolChain.getDriver();
867868
const bool IsFatLTO = Args.hasFlag(options::OPT_ffat_lto_objects,
868869
options::OPT_fno_fat_lto_objects, false);
869870
const bool IsUnifiedLTO = Args.hasArg(options::OPT_funified_lto);
870-
if (Linker != "lld" && Linker != "lld-link" && !Triple.isOSOpenBSD()) {
871+
if (Linker != "lld" && Linker != "lld-link" &&
872+
llvm::sys::path::filename(LinkerPath) != "ld.lld" &&
873+
llvm::sys::path::stem(LinkerPath) != "ld.lld" && !Triple.isOSOpenBSD()) {
871874
// Tell the linker to load the plugin. This has to come before
872875
// AddLinkerInputs as gold requires -plugin and AIX ld requires -bplugin to
873876
// come before any -plugin-opt/-bplugin_opt that -Wl might forward.

0 commit comments

Comments
 (0)