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

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