2019-12-22 02:22:55 +01:00
|
|
|
--- tools/clang/lib/Driver/ToolChains/Linux.cpp.orig 2019-12-21 22:30:03.676720096 +0000
|
|
|
|
+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp 2019-12-21 22:34:42.941719383 +0000
|
2020-03-28 16:53:46 +01:00
|
|
|
@@ -403,7 +403,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|
|
|
if (Triple.getVendor() == llvm::Triple::OpenEmbedded &&
|
|
|
|
Triple.isArch64Bit())
|
|
|
|
addPathIfExists(D, SysRoot + "/usr/" + OSLibDir, Paths);
|
|
|
|
- else
|
|
|
|
+ else if (!IsAndroid)
|
|
|
|
addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
|
|
|
|
if (IsRISCV) {
|
|
|
|
StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple);
|
|
|
|
@@ -451,7 +451,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|
|
|
addPathIfExists(D, D.Dir + "/../lib", Paths);
|
2019-03-28 02:42:04 +01:00
|
|
|
|
2020-03-28 16:53:46 +01:00
|
|
|
addPathIfExists(D, SysRoot + "/lib", Paths);
|
|
|
|
- addPathIfExists(D, SysRoot + "/usr/lib", Paths);
|
|
|
|
+ bool nativeBuild = MultiarchTriple == llvm::sys::getDefaultTargetTriple();
|
|
|
|
+ if (nativeBuild || !IsAndroid)
|
|
|
|
+ addPathIfExists(D, SysRoot + "/usr/lib", Paths);
|
2019-09-06 18:03:46 +02:00
|
|
|
+
|
2020-03-28 16:53:46 +01:00
|
|
|
+ if (IsAndroid) {
|
|
|
|
+ addPathIfExists(D, SysRoot + "/usr/" + MultiarchTriple + "/lib", Paths);
|
|
|
|
+ addPathIfExists(D, "/system/" + OSLibDir, Paths);
|
|
|
|
+ ExtraOpts.push_back("-rpath=" + SysRoot + "/usr/lib");
|
2019-03-14 04:46:10 +01:00
|
|
|
+ }
|
2020-03-28 16:53:46 +01:00
|
|
|
}
|
2019-03-14 04:46:10 +01:00
|
|
|
|
2020-03-28 16:53:46 +01:00
|
|
|
ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
|