]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
authorDaniel Dunbar <daniel@zuster.org>
Mon, 9 May 2011 17:23:16 +0000 (17:23 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 9 May 2011 17:23:16 +0000 (17:23 +0000)
when POSIXLY_COMPLIANT is set.
 - Patch by Dave Vasilevsky!

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

lib/Driver/Tools.cpp
test/Driver/darwin-ld.c

index b140a15d18ba0a6edcb5421e1fc1849eae912f6a..a8998c49a7028d5f979da7fda07874aec0356559 100644 (file)
@@ -3166,14 +3166,14 @@ void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
                                     const char *LinkingOutput) const {
   ArgStringList CmdArgs;
 
+  CmdArgs.push_back("-o");
+  CmdArgs.push_back(Output.getFilename());
+
   assert(Inputs.size() == 1 && "Unable to handle multiple inputs.");
   const InputInfo &Input = Inputs[0];
   assert(Input.isFilename() && "Unexpected dsymutil input.");
   CmdArgs.push_back(Input.getFilename());
 
-  CmdArgs.push_back("-o");
-  CmdArgs.push_back(Output.getFilename());
-
   const char *Exec =
     Args.MakeArgString(getToolChain().GetProgramPath("dsymutil"));
   C.addCommand(new Command(JA, *this, Exec, CmdArgs));
index 3f2b69185a5847ae48b2a1f5796ff63436794892..5835f7948ed324dcae131f8a626aad79f1caf805 100644 (file)
@@ -5,9 +5,9 @@
 
 // Make sure we run dsymutil on source input files.
 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
-// RUN: grep '".*dsymutil" "BAR"' %t.log
+// RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log
 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
-// RUN: grep '".*dsymutil" "BAR"' %t.log
+// RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log
 
 // Splatter test case. This is gross, but it works for now. For the
 // driver, just getting coverage of the tool code and checking the