From c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 2 Aug 2018 17:33:11 +0000 Subject: Vendor import of clang trunk r338536: https://llvm.org/svn/llvm-project/cfe/trunk@338536 --- lib/Driver/ToolChains/Linux.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/Driver/ToolChains/Linux.cpp') diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp index d27f994d32ab..f8f36239180c 100644 --- a/lib/Driver/ToolChains/Linux.cpp +++ b/lib/Driver/ToolChains/Linux.cpp @@ -376,7 +376,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) } addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths); - addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths); + // 64-bit OpenEmbedded sysroots may not have a /usr/lib dir. So they cannot + // find /usr/lib64 as it is referenced as /usr/lib/../lib64. So we handle + // this here. + if (Triple.getVendor() == llvm::Triple::OpenEmbedded && + Triple.isArch64Bit()) + addPathIfExists(D, SysRoot + "/usr/" + OSLibDir, Paths); + else + addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths); if (IsRISCV) { StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths); -- cgit v1.2.3