From 8d75be48c2bbe314390ff292e3a26c5403a5896a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Jun 2018 10:15:44 +0200 Subject: 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 Reviewed-by: Joerg Bornemann --- share/qbs/modules/cpp/gcc.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3