]> granicus.if.org Git - clang/commitdiff
Tweak link order on Solaris so that global ctors work.
authorDavid Chisnall <csdavec@swan.ac.uk>
Thu, 16 Feb 2012 16:00:47 +0000 (16:00 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Thu, 16 Feb 2012 16:00:47 +0000 (16:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 4f8febd8795a9b20814987fe52e7ecffdcbf1c00..7d8dbb526d997bebe52255ccc8a42654ce1c7454 100644 (file)
@@ -4252,7 +4252,6 @@ void solaris::Link::ConstructJob(Compilation &C, const JobAction &JA,
     } else {
       CmdArgs.push_back(Args.MakeArgString(LibPath + "crti.o"));
     }
-    CmdArgs.push_back(Args.MakeArgString(LibPath + "crtn.o"));
   }
 
   CmdArgs.push_back(Args.MakeArgString("-L" + GCCLibPath));
@@ -4277,6 +4276,7 @@ void solaris::Link::ConstructJob(Compilation &C, const JobAction &JA,
     if (!Args.hasArg(options::OPT_shared))
       CmdArgs.push_back(Args.MakeArgString(GCCLibPath + "crtend.o"));
   }
+  CmdArgs.push_back(Args.MakeArgString(LibPath + "crtn.o"));
 
   addProfileRT(getToolChain(), Args, CmdArgs, getToolChain().getTriple());