Skip to content

Commit ba4ef24

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 318d43b commit ba4ef24

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
@@ -216,7 +216,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
216216
Multilibs = GCCInstallation.getMultilibs();
217217
SelectedMultilibs.assign({GCCInstallation.getMultilib()});
218218
llvm::Triple::ArchType Arch = Triple.getArch();
219-
std::string SysRoot = computeSysRoot();
219+
std::string SysRoot = computeSysRoot() + "/";
220220
ToolChain::path_list &PPaths = getProgramPaths();
221221

222222
Generic_GCC::PushPPaths(PPaths);

0 commit comments

Comments
 (0)