get search path order correct

This commit is contained in:
its-pointless 2019-03-17 10:44:53 +11:00 committed by Leonid Pliushch
parent d1fcb29c6e
commit 5a467757d4
1 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
--- /home/builder/Linux.cpp.orig 2019-03-16 21:28:28.549998238 +0000
+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp 2019-03-16 22:08:24.730161072 +0000
@@ -291,7 +291,30 @@
+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp 2019-03-16 23:43:01.266771835 +0000
@@ -291,7 +291,33 @@
// possible permutations of these directories, and seeing which ones it added
// to the link paths.
path_list &Paths = getFilePaths();
@ -8,31 +8,34 @@
+ if(IsAndroid) {
+ if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) {
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/arm-linux-androideabi/lib", Paths);
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/lib", Paths);
+ addPathIfExists(D, SysRoot + "/system/lib", Paths);
+ ExtraOpts.push_back("-rpath=@TERMUX_PREFIX@/arm-linux-androideabi/lib");
+ }
+ if (Arch == llvm::Triple::x86) {
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/i686-linux-android/lib", Paths);
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/lib", Paths);
+ addPathIfExists(D, SysRoot + "/system/lib", Paths);
+ ExtraOpts.push_back("-rpath=@TERMUX_PREFIX@/i686-linux-android/lib");
+ }
+ if (Arch == llvm::Triple::x86_64) {
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/x86_64-linux-android/lib", Paths);
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/lib", Paths);
+ addPathIfExists(D, SysRoot + "/system/lib64", Paths);
+ ExtraOpts.push_back("-rpath=@TERMUX_PREFIX@/x86_64-linux-android/lib");
+ }
+ if (Arch == llvm::Triple::aarch64) {
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/aarch64-linux-android/lib", Paths);
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/lib", Paths);
+ addPathIfExists(D, SysRoot + "/system/lib64", Paths);
+ ExtraOpts.push_back("-rpath=@TERMUX_PREFIX@/aarch64-linux-android/lib");
+ }
+ addPathIfExists(D, SysRoot + "@TERMUX_PREFIX@/lib", Paths);
+ ExtraOpts.push_back("-rpath=@TERMUX_PREFIX@/lib");
+ }
const std::string OSLibDir = getOSLibDir(Triple, Args);
const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
@@ -628,8 +651,27 @@
@@ -628,8 +654,27 @@
return;
if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
@ -61,7 +64,7 @@
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
SmallString<128> P(D.ResourceDir);
llvm::sys::path::append(P, "include");
@@ -903,7 +945,7 @@
@@ -903,7 +948,7 @@
}
bool Linux::isPIEDefault() const {