diff options
Diffstat (limited to 'src/rpath.c')
-rw-r--r-- | src/rpath.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rpath.c b/src/rpath.c index 42a4c07..fbfdb18 100644 --- a/src/rpath.c +++ b/src/rpath.c @@ -209,6 +209,7 @@ char *rpath_autodetect(const char *filename) { char *start = realpath(rootdir, NULL); char *cwd = realpath(".", NULL); char *result = NULL; + int multilib_os = (exists("/lib64") == 0); // Change directory to the requested root chdir(start); @@ -228,7 +229,11 @@ char *rpath_autodetect(const char *filename) { } // Using the current visit path, check if it contains a lib directory - char *path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); + char *path = NULL; + if (multilib_os) + path = join((char *[]) {visit, "lib64", NULL}, DIRSEPS); + else + path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); if (access(path, F_OK) == 0) { // Check whether the lib directory contains one of `filename`'s libraries @@ -248,7 +253,11 @@ char *rpath_autodetect(const char *filename) { // Stop processing when a good lib directory is found if (has_real_libdir != 0) { - strcat(relative, "lib"); + if (multilib_os) { + strcat(relative, "lib64"); + } else { + strcat(relative, "lib"); + } free(path); free(visit); break; |