mirror of
https://github.com/termux/termux-packages.git
synced 2025-01-31 21:22:27 +00:00
40 lines
1.7 KiB
Diff
40 lines
1.7 KiB
Diff
--- a/clang/lib/Driver/ToolChains/Linux.cpp
|
|
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
|
|
@@ -200,8 +200,8 @@
|
|
// FIXME: This is a bit of a hack. We should really unify this code for
|
|
// reasoning about oslibdir spellings with the lib dir spellings in the
|
|
// GCCInstallationDetector, but that is a more significant refactoring.
|
|
- if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() ||
|
|
- Triple.getArch() == llvm::Triple::sparc)
|
|
+ if (!Triple.isAndroid() && (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() ||
|
|
+ Triple.getArch() == llvm::Triple::sparc))
|
|
return "lib32";
|
|
|
|
if (Triple.getArch() == llvm::Triple::x86_64 && Triple.isX32())
|
|
@@ -333,7 +333,7 @@
|
|
if (Triple.getVendor() == llvm::Triple::OpenEmbedded &&
|
|
Triple.isArch64Bit())
|
|
addPathIfExists(D, concat(SysRoot, "/usr", OSLibDir), Paths);
|
|
- else
|
|
+ else if (!IsAndroid)
|
|
addPathIfExists(D, concat(SysRoot, "/usr/lib/..", OSLibDir), Paths);
|
|
if (IsRISCV) {
|
|
StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple);
|
|
@@ -344,7 +344,15 @@
|
|
Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
|
|
|
|
addPathIfExists(D, concat(SysRoot, "/lib"), Paths);
|
|
- addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths);
|
|
+ bool nativeBuild = MultiarchTriple == getMultiarchTriple(D, llvm::Triple(llvm::sys::getDefaultTargetTriple()), SysRoot);
|
|
+ if (nativeBuild || !IsAndroid)
|
|
+ addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths);
|
|
+
|
|
+ if (IsAndroid) {
|
|
+ addPathIfExists(D, concat(SysRoot, "/usr/", MultiarchTriple, "/lib"), Paths);
|
|
+ addPathIfExists(D, concat("/system/", OSLibDir), Paths);
|
|
+ ExtraOpts.push_back(concat("-rpath=", SysRoot, "/usr/lib"));
|
|
+ }
|
|
}
|
|
|
|
ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const {
|