Skip to content

Commit cfae3be

Browse files
committed
clang: Prepend trailing '/' to sysroot
This is needed to handle a case where clang isntall and target sysroot are perilously same e.g. sysroot = /mnt/clang/recipe-sysroot clang install = /mnt/clang/recipe-sysroot-native in this case it will mistakenly assume that clang is installed under the same sysroot dir and it will try to add relative ../lib paths to linker steps which would then be wrong since they will become relative to clang installation and not sysroot Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent ffff5c8 commit cfae3be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
215215
Multilibs = GCCInstallation.getMultilibs();
216216
SelectedMultilibs.assign({GCCInstallation.getMultilib()});
217217
llvm::Triple::ArchType Arch = Triple.getArch();
218-
std::string SysRoot = computeSysRoot();
218+
std::string SysRoot = computeSysRoot() + "/";
219219
ToolChain::path_list &PPaths = getProgramPaths();
220220

221221
Generic_GCC::PushPPaths(PPaths);

0 commit comments

Comments
 (0)