0011-clang-Define-releative-gcc-installation-dir.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 1545fd910e641757705cb580a15ba6cd511be72e Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:15:04 +0800
  4. Subject: [PATCH 11/34] clang: Define / releative gcc installation dir
  5. This is required for OE gcc installation to work.
  6. Without this its not able to find the paths for libgcc
  7. and other standard headers and libraries from gcc
  8. installation in OE
  9. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  12. ---
  13. clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++-------
  14. 1 file changed, 7 insertions(+), 7 deletions(-)
  15. diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
  16. index 278064d9edca..31d1c5c756fd 100644
  17. --- a/clang/lib/Driver/ToolChains/Gnu.cpp
  18. +++ b/clang/lib/Driver/ToolChains/Gnu.cpp
  19. @@ -2534,19 +2534,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
  20. // Whether this library suffix is relevant for the triple.
  21. bool Active;
  22. } Suffixes[] = {
  23. - // This is the normal place.
  24. - {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists},
  25. -
  26. - // Debian puts cross-compilers in gcc-cross.
  27. - {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists},
  28. -
  29. // The Freescale PPC SDK has the gcc libraries in
  30. // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do
  31. // this on Freescale triples, though, since some systems put a *lot* of
  32. // files in that location, not just GCC installation data.
  33. {CandidateTriple.str(), "..",
  34. TargetTriple.getVendor() == llvm::Triple::Freescale ||
  35. - TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}};
  36. + TargetTriple.getVendor() == llvm::Triple::OpenEmbedded},
  37. +
  38. + // This is the normal place.
  39. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists},
  40. +
  41. + // Debian puts cross-compilers in gcc-cross.
  42. + {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}};
  43. for (auto &Suffix : Suffixes) {
  44. if (!Suffix.Active)
  45. --
  46. 2.33.1