]> granicus.if.org Git - clang/commitdiff
Enable -mconstructor-aliases by default on non-darwin platforms.
authorJohn McCall <rjmccall@apple.com>
Fri, 19 Feb 2010 02:45:38 +0000 (02:45 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 19 Feb 2010 02:45:38 +0000 (02:45 +0000)
The linker bug holding this back is Darwin-specific.

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

lib/Driver/Tools.cpp

index e65abaedd58045762ad30cb5de5fca67fefc481d..d2391b391cd1375616511b47fd877a143c693a68 100644 (file)
@@ -799,6 +799,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("Arguments");
   }
 
+  // Enable -mconstructor-aliases except on darwin, where we have to
+  // work around a linker bug;  see <rdar://problem/7651567>.
+  if (getToolChain().getTriple().getOS() != llvm::Triple::Darwin)
+    CmdArgs.push_back("-mconstructor-aliases");
+
   // This is a coarse approximation of what llvm-gcc actually does, both
   // -fasynchronous-unwind-tables and -fnon-call-exceptions interact in more
   // complicated ways.