[cfe-commits] r156853 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/arclite-link.c

Douglas Gregor dgregor at apple.com
Tue May 15 14:00:28 PDT 2012


Author: dgregor
Date: Tue May 15 16:00:27 2012
New Revision: 156853

URL: http://llvm.org/viewvc/llvm-project?rev=156853&view=rev
Log:
Add the Objective-C runtime linking arguments after user-specified
linker arguments. Fixes <rdar://problem/11417441>. 

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/arclite-link.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=156853&r1=156852&r2=156853&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue May 15 16:00:27 2012
@@ -4224,6 +4224,8 @@
     // This is more complicated in gcc...
     CmdArgs.push_back("-lgomp");
 
+  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
+  
   if (isObjCRuntimeLinked(Args) &&
       !Args.hasArg(options::OPT_nostdlib) &&
       !Args.hasArg(options::OPT_nodefaultlibs)) {
@@ -4246,8 +4248,6 @@
     CmdArgs.push_back("-lobjc");
   }
 
-  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
-
   if (LinkingOutput) {
     CmdArgs.push_back("-arch_multiple");
     CmdArgs.push_back("-final_output");

Modified: cfe/trunk/test/Driver/arclite-link.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arclite-link.c?rev=156853&r1=156852&r2=156853&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arclite-link.c (original)
+++ cfe/trunk/test/Driver/arclite-link.c Tue May 15 16:00:27 2012
@@ -1,9 +1,10 @@
 // RUN: touch %t.o
-// RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-ARCLITE-OSX %s
+// RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -lfoo -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-ARCLITE-OSX %s
 // RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.8 %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOARCLITE %s
 // RUN: %clang -### -target i386-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOARCLITE %s
 // RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -nostdlib %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOSTDLIB %s
 
+// CHECK-ARCLITE-OSX: -lfoo
 // CHECK-ARCLITE-OSX: libarclite_macosx.a
 // CHECK-ARCLITE-OSX: -framework
 // CHECK-ARCLITE-OSX: Foundation





More information about the cfe-commits mailing list