summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains/Gnu.cpp3
-rw-r--r--clang/lib/Driver/ToolChains/Linux.cpp9
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 2c83598f3d7..ad702b6d06a 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2188,7 +2188,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
// this on Freescale triples, though, since some systems put a *lot* of
// files in that location, not just GCC installation data.
{CandidateTriple.str(), "..",
- TargetTriple.getVendor() == llvm::Triple::Freescale},
+ TargetTriple.getVendor() == llvm::Triple::Freescale ||
+ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded},
// Natively multiarch systems sometimes put the GCC triple-specific
// directory within their multiarch lib directory, resulting in the
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index d27f994d32a..f8f36239180 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud