MaskRay wrote:

The include and library path code in the driver needs more love. I have cleaned 
up some a few years ago but there is still quite a bit tech debt.

In particular, the 2018 commit you mentioned (https://reviews.llvm.org/D48862) 
introduced
```
  if (Triple.getVendor() == llvm::Triple::OpenEmbedded &&
      Triple.isArch64Bit())
    addPathIfExists(D, SysRoot + "/usr/" + OSLibDir, Paths);
  else
    addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
```

which could be simplified to `/usr/ + OSLibDir`, and the latter `/usr/lib` 
could be removed  if OSLibDir is "lib". 
I am testing https://github.com/llvm/llvm-project/pull/128428 and will push it 
when the Windows tests pass (it's annoying but Windows uses \\, making a lot of 
tests ugly..)

---

A lot of ELF-specific Triple::VendorType should not have been added in the 
first place.

Can you confirm whether you added new OpenEmbedded VendorType due to the 
following customization?
This is an unfortunate special case and I hope that OpenEmbedded moves away 
from the difference. Just pick gcc/ or gcc-cross/ or install symlinks so that 
Clang doesn't need to more probing.
It does not scale if there are similar projects like OpenEmbedded that do a 
similar thing and want to add a new VendorType to LLVM just to make their 
upstream divergent customization working.

```
      // This is the normal place.
      {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists},

      // Debian puts cross-compilers in gcc-cross.
      {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists},

      // The Freescale PPC SDK has the gcc libraries in
      // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do
      // this on Freescale triples, though, since some systems put a *lot* of
      // files in that location, not just GCC installation data.
      {CandidateTriple.str(), "..",
       TargetTriple.getVendor() == llvm::Triple::Freescale ||
           TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}};
```


https://github.com/llvm/llvm-project/pull/121302
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to