0027-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 4d5267f96021615db4af1b8df4840d613df263ff Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:54:42 +0800
  4. Subject: [PATCH 27/34] clang: Fix x86 triple for non-debian multiarch linux
  5. distros
  6. OpenEmbedded does not hardcode mutli-arch like debian therefore ensure
  7. that it still uses the proper tuple
  8. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  9. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  10. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  11. ---
  12. clang/lib/Driver/ToolChains/Linux.cpp | 3 +++
  13. 1 file changed, 3 insertions(+)
  14. diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
  15. index abaab04c8266..aa2be27d8062 100644
  16. --- a/clang/lib/Driver/ToolChains/Linux.cpp
  17. +++ b/clang/lib/Driver/ToolChains/Linux.cpp
  18. @@ -623,6 +623,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
  19. GCCInstallation.getTriple().getArch() == llvm::Triple::x86
  20. ? "i386-linux-gnu"
  21. : TripleStr;
  22. + // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian
  23. + if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded)
  24. + DebianMultiarch = TripleStr;
  25. // Try generic GCC detection first.
  26. if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args,
  27. --
  28. 2.33.1