[pkg-d-commits] [ldc] 186/211: Forward `-L` linker args starting with `-Wl, ` to gcc driver

Matthias Klumpp mak at moszumanska.debian.org
Sun Apr 23 22:36:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.1.0
in repository ldc.

commit 505a01b278fe0e2e5a87029680e7af42fc5c1b88
Author: Martin <noone at nowhere.com>
Date:   Sun Dec 4 15:06:53 2016 +0100

    Forward `-L` linker args starting with `-Wl,` to gcc driver
---
 driver/linker.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/driver/linker.cpp b/driver/linker.cpp
index 477e2ef..496fd87 100644
--- a/driver/linker.cpp
+++ b/driver/linker.cpp
@@ -145,7 +145,7 @@ std::string getLTOGoldPluginPath() {
     };
 
     // Try all searchPaths and early return upon the first path found.
-    for (auto p : searchPaths) {
+    for (const auto &p : searchPaths) {
       if (llvm::sys::fs::exists(p))
         return p;
     }
@@ -359,10 +359,11 @@ static int linkObjToBinaryGcc(bool sharedLib, bool fullyStatic) {
     // Don't push -l and -L switches using -Xlinker, but pass them indirectly
     // via GCC. This makes sure user-defined paths take precedence over
     // GCC's builtin LIBRARY_PATHs.
-    // Options starting with -shared and -static are not handled by
+    // Options starting with `-Wl,`, -shared or -static are not handled by
     // the linker and must be passed to the driver.
     auto str = llvm::StringRef(p);
     if (!(str.startswith("-l") || str.startswith("-L") ||
+          str.startswith("-Wl,") ||
           str.startswith("-shared") || str.startswith("-static"))) {
       args.push_back("-Xlinker");
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list