Skip to content

Commit ffdb94e

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 <[email protected]>
1 parent 95eeb64 commit ffdb94e

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
@@ -222,7 +222,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
222222
Multilibs = GCCInstallation.getMultilibs();
223223
SelectedMultilibs.assign({GCCInstallation.getMultilib()});
224224
llvm::Triple::ArchType Arch = Triple.getArch();
225-
std::string SysRoot = computeSysRoot();
225+
std::string SysRoot = computeSysRoot() + "/";
226226
ToolChain::path_list &PPaths = getProgramPaths();
227227

228228
Generic_GCC::PushPPaths(PPaths);

0 commit comments

Comments
 (0)