Properly set rpath in existing files

This commit is contained in:
TheAssassin
2018-09-03 21:07:43 +02:00
parent 63764e2e18
commit 371343baed

View File

@@ -820,7 +820,21 @@ namespace linuxdeploy {
if (!d->deployElfDependencies(executable))
return false;
d->setElfRPathOperations[executable] = "$ORIGIN/../lib";
const auto systemElfClass = elf::ElfFile::getSystemElfClass();
const auto elfClass = elf::ElfFile(executable).getElfClass();
std::string libSuffix = "";
if (systemElfClass != elfClass) {
if (elfClass == ELFCLASS32)
libSuffix = "32";
else
libSuffix = "64";
}
std::string rpath = "$ORIGIN/../lib" + libSuffix;
d->setElfRPathOperations[executable] = rpath;
}
for (const auto& sharedLibrary : listSharedLibraries()) {