Skip to content

Commit

Permalink
Existing relative RPATHs are not removed (probonopd#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Mueller committed Oct 31, 2018
1 parent 7749d00 commit 6c26010
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tools/linuxdeployqt/shared.cpp
Expand Up @@ -841,8 +841,21 @@ void changeIdentification(const QString &id, const QString &binaryPath)
setenv("LD_LIBRARY_PATH",newPath.toUtf8().constData(),1);
}
}
LogNormal() << "Changing rpath in" << binaryPath << "to" << id;
runPatchelf(QStringList() << "--set-rpath" << id << binaryPath);

QStringList rpath = oldRpath.split(":", QString::SkipEmptyParts);
rpath.prepend(id);
rpath.removeDuplicates();
foreach(QString path, QStringList(rpath)) {
// remove any non-relative path that would point outside the package
if (!path.startsWith("$ORIGIN"))
{
LogWarning() << "Removing absolute rpath of " << path << " in " << binaryPath;
rpath.removeAll(path);
}
}

LogNormal() << "Changing rpath in" << binaryPath << "to" << rpath.join(":");
runPatchelf(QStringList() << "--set-rpath" << rpath.join(":") << binaryPath);

// qt_prfxpath:
if (binaryPath.contains("libQt5Core")) {
Expand Down

0 comments on commit 6c26010

Please sign in to comment.