[cfe-commits] r116758 - /cfe/trunk/lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Mon Oct 18 15:08:36 PDT 2010


Author: ddunbar
Date: Mon Oct 18 17:08:36 2010
New Revision: 116758

URL: http://llvm.org/viewvc/llvm-project?rev=116758&view=rev
Log:
Driver/Darwin: Forward -ObjC when linking, which may be needed when using static
libraries with Objective-C code.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=116758&r1=116757&r2=116758&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Oct 18 17:08:36 2010
@@ -2504,6 +2504,12 @@
   Args.AddAllArgs(CmdArgs, options::OPT_m_Separate);
   Args.AddAllArgs(CmdArgs, options::OPT_r);
 
+  // Forward -ObjC when either -ObjC or -ObjC++ is used, to force loading
+  // members of static archive libraries which implement Objective-C classes or
+  // categories.
+  if (Args.hasArg(options::OPT_ObjC) || Args.hasArg(options::OPT_ObjCXX))
+    CmdArgs.push_back("-ObjC");
+    
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());
 





More information about the cfe-commits mailing list