From 88634440530ff833fb834f9f11e97d9aebcc71d5 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 12 Oct 2023 19:17:20 +0200 Subject: [PATCH] macdeployqt: Fix codesigning with @loader_path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the -executable parameter is specified, macdeployqt uses @loader_path instead of @rpath. This case was not handled in getBinaryDependencies() used for the code signing. Fixes: QTBUG-118075 Change-Id: Ie1e0d0781305e1849df9ec0d5fb1c3ce6713a62b Reviewed-by: Tor Arne Vestbø (cherry picked from commit 1eddd7add027d05cec2470a5209f46809e690478) Reviewed-by: Qt Cherry-pick Bot --- src/tools/macdeployqt/shared/shared.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp index 101afb9a97b..2ae4f998944 100644 --- a/src/tools/macdeployqt/shared/shared.cpp +++ b/src/tools/macdeployqt/shared/shared.cpp @@ -598,6 +598,10 @@ QStringList getBinaryDependencies(const QString executablePath, QString binary = QDir::cleanPath(executablePath + trimmedLine.mid(QStringLiteral("@executable_path/").length())); if (binary != path) binaries.append(binary); + } else if (trimmedLine.startsWith("@loader_path/")) { + QString binary = QDir::cleanPath(QFileInfo(path).path() + "/" + trimmedLine.mid(QStringLiteral("@loader_path/").length())); + if (binary != path) + binaries.append(binary); } else if (trimmedLine.startsWith("@rpath/")) { if (!rpathsLoaded) { rpaths = getBinaryRPaths(path, true, executablePath);