0008-clang-Prepend-trailing-to-sysroot.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 51b99c1b9836f2e6967f1192f16fb639e127df2e Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Thu, 16 Mar 2017 09:02:13 -0700
  4. Subject: [PATCH] clang: Prepend trailing '/' to sysroot
  5. This is needed to handle a case where clang
  6. isntall and target sysroot are perilously same
  7. e.g.
  8. sysroot = /mnt/clang/recipe-sysroot
  9. clang install = /mnt/clang/recipe-sysroot-native
  10. in this case it will mistakenly assume that
  11. clang is installed under the same sysroot dir
  12. and it will try to add relative ../lib paths
  13. to linker steps which would then be wrong
  14. since they will become relative to clang
  15. installation and not sysroot
  16. Upstream-Status: Pending
  17. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  18. ---
  19. clang/lib/Driver/ToolChains/Linux.cpp | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
  22. index 2a58f876a68d..c68a842b45e0 100644
  23. --- a/clang/lib/Driver/ToolChains/Linux.cpp
  24. +++ b/clang/lib/Driver/ToolChains/Linux.cpp
  25. @@ -184,7 +184,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
  26. Multilibs = GCCInstallation.getMultilibs();
  27. SelectedMultilib = GCCInstallation.getMultilib();
  28. llvm::Triple::ArchType Arch = Triple.getArch();
  29. - std::string SysRoot = computeSysRoot();
  30. + std::string SysRoot = computeSysRoot() + "/";
  31. ToolChain::path_list &PPaths = getProgramPaths();
  32. Generic_GCC::PushPPaths(PPaths);