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

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 610d6a7c8c9d21f10b225f971a377be49bbaea4f 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. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  17. ---
  18. clang/lib/Driver/ToolChains/Linux.cpp | 2 +-
  19. 1 file changed, 1 insertion(+), 1 deletion(-)
  20. diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
  21. index 97e987c37e4a..f9e233f15dfc 100644
  22. --- a/clang/lib/Driver/ToolChains/Linux.cpp
  23. +++ b/clang/lib/Driver/ToolChains/Linux.cpp
  24. @@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
  25. Multilibs = GCCInstallation.getMultilibs();
  26. SelectedMultilib = GCCInstallation.getMultilib();
  27. llvm::Triple::ArchType Arch = Triple.getArch();
  28. - std::string SysRoot = computeSysRoot();
  29. + std::string SysRoot = computeSysRoot() + "/";
  30. ToolChain::path_list &PPaths = getProgramPaths();
  31. Generic_GCC::PushPPaths(PPaths);