]> granicus.if.org Git - clang/commitdiff
Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386
authorJoerg Sonnenberger <joerg@bec.de>
Tue, 7 Jun 2011 23:39:17 +0000 (23:39 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Tue, 7 Jun 2011 23:39:17 +0000 (23:39 +0000)
may pick it up. This would create bad text relocations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132736 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 03b7e2029f2171eaa9d88bb99b66e5abca92561e..bc3ff6873b71b8124cdc917ade696183e46cfad8 100644 (file)
@@ -3751,7 +3751,6 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
     }
     // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
     // the default system libraries. Just mimic this for now.
-    CmdArgs.push_back("-lgcc");
     if (Args.hasArg(options::OPT_static)) {
       CmdArgs.push_back("-lgcc_eh");
     } else {
@@ -3759,6 +3758,7 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-lgcc_s");
       CmdArgs.push_back("--no-as-needed");
     }
+    CmdArgs.push_back("-lgcc");
 
     if (Args.hasArg(options::OPT_pthread))
       CmdArgs.push_back("-lpthread");