aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-25 10:15:44 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-06-26 10:56:20 +0000
commit8d75be48c2bbe314390ff292e3a26c5403a5896a (patch)
tree82570883f9516c13c9c97ca485b79a076d2f1ca2
parentc87299f5d0c406b1ee804760c4336f7963ecd344 (diff)
GCC: Filter libraryPaths for entries from systemRunPaths
... when constructing the command line, the same way as we already did for rpaths. Change-Id: I7d69e85fe4ba9a5659653a941adcdbe6cc328a67 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--share/qbs/modules/cpp/gcc.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 896ae48fa..95e3d198c 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -254,6 +254,9 @@ function linkerFlags(project, product, inputs, output, linkerPath) {
var weakFrameworks = product.cpp.weakFrameworks;
var rpaths = (product.cpp.useRPaths !== false) ? product.cpp.rpaths : undefined;
var systemRunPaths = product.cpp.systemRunPaths || [];
+ var canonicalSystemRunPaths = systemRunPaths.map(function(p) {
+ return File.canonicalFilePath(p);
+ });
var i, args = additionalCompilerAndLinkerFlags(product);
var escapableLinkerFlags = [];
@@ -337,8 +340,12 @@ function linkerFlags(project, product, inputs, output, linkerPath) {
return rpath;
}
+ function isNotSystemRunPath(p) {
+ return !systemRunPaths.contains(p)
+ && !canonicalSystemRunPaths.contains(File.canonicalFilePath(p));
+ };
for (i in rpaths) {
- if (systemRunPaths.indexOf(rpaths[i]) === -1)
+ if (isNotSystemRunPath(rpaths[i]))
escapableLinkerFlags.push("-rpath", fixupRPath(rpaths[i]));
}
@@ -382,6 +389,8 @@ function linkerFlags(project, product, inputs, output, linkerPath) {
allLibraryPaths = allLibraryPaths.uniqueConcat(libraryPaths);
if (distributionLibraryPaths)
allLibraryPaths = allLibraryPaths.uniqueConcat(distributionLibraryPaths);
+ if (systemRunPaths.length > 0)
+ allLibraryPaths = allLibraryPaths.filter(isNotSystemRunPath);
args = args.concat(allLibraryPaths.map(function(path) { return '-L' + path }));
var linkerScripts = inputs.linkerscript