[Bug 283155] Link fails with -flto: error loading plugin: Cannot open "/usr/bin/../lib/LLVMgold.so" (port multimedia/kew)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 06 Dec 2024 18:26:52 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283155

--- Comment #12 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to John Baldwin from comment #11)

One type of handling that avoids the likes of use
of x86_64-unknown-freebsd14.1-ld is to use, say,
-fuse-ld=lld on the command line. (Avoids adjusting
LLVM source.)

But that is very specific to ld.lld and the clang code
for finding tools is more general:

  const ToolChain::path_list &List = TC.getProgramPaths();
  for (const auto &TargetSpecificExecutable : TargetSpecificExecutables) {
    // For each possible name of the tool look for it in
    // program paths first, then the path.
    // Higher priority names will be first, meaning that
    // a higher priority name in the path will be found
    // instead of a lower priority name in the program path.
    // E.g. <triple>-gcc on the path will be found instead
    // of gcc in the program path
    for (const auto &Path : List) {
      SmallString<128> P(Path);
      if (ScanDirForExecutable(P, TargetSpecificExecutable))
        return std::string(P);
    }

Does FreeBSD's built-in toolchain have any intended-to-be-supported
potential use of <triple>-TOOL overriding TOOL from earlier in the
path? Any deliberate use of such already?

-- 
You are receiving this mail because:
You are the assignee for the bug.