From: David Chisnall Date: Thu, 16 Feb 2012 16:00:47 +0000 (+0000) Subject: Tweak link order on Solaris so that global ctors work. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1ac03ebac3ab5a8456b955e3f8634f786843f9a;p=clang Tweak link order on Solaris so that global ctors work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150696 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 4f8febd879..7d8dbb526d 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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());