r195054 - Change the clang driver with the use of -no-integrated-as for darwin to use

Kevin Enderby enderby at apple.com
Mon Nov 18 15:30:29 PST 2013


Author: enderby
Date: Mon Nov 18 17:30:29 2013
New Revision: 195054

URL: http://llvm.org/viewvc/llvm-project?rev=195054&view=rev
Log:
Change the clang driver with the use of -no-integrated-as for darwin to use
the -Q flag to the as(1) assembler driver.

We will soon be switching the darwin as(1) assembler driver to call clang(1)
and use the intergated assembler by default.  To do this and still support
clang(1)'s -no-integrated-as flag, when clang(1) runs the as(1) assembler
driver and -no-integrated-as is used it needs to pass the -Q flag to as(1)
so it uses its GNU based assembler, and not turn around and call clag(1)'s
integrated assembler. 

rdar://15495921

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/darwin-as.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=195054&r1=195053&r2=195054&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Nov 18 17:30:29 2013
@@ -4604,6 +4604,11 @@ void darwin::Assemble::ConstructJob(Comp
     SourceAction = SourceAction->getInputs()[0];
   }
 
+  // If -no_integrated_as is used add -Q to the darwin assember driver to make
+  // sure it runs its system assembler not clang's integrated assembler.
+  if (Args.hasArg(options::OPT_no_integrated_as))
+    CmdArgs.push_back("-Q");
+
   // Forward -g, assuming we are dealing with an actual assembly file.
   if (SourceAction->getType() == types::TY_Asm ||
       SourceAction->getType() == types::TY_PP_Asm) {

Modified: cfe/trunk/test/Driver/darwin-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-as.c?rev=195054&r1=195053&r2=195054&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-as.c (original)
+++ cfe/trunk/test/Driver/darwin-as.c Mon Nov 18 17:30:29 2013
@@ -2,16 +2,16 @@
 // RUN:   -no-integrated-as -static -dynamic 2>%t
 // RUN: FileCheck -check-prefix=CHECK-STATIC_AND_DYNAMIC-32 --input-file %t %s
 //
-// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
+// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-Q" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
 
 // RUN: %clang -target x86_64-apple-darwin10 -### -x assembler -c %s \
 // RUN:   -no-integrated-as -static 2>%t
 // RUN: FileCheck -check-prefix=CHECK-STATIC-64 --input-file %t %s
 //
-// CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
+// CHECK-STATIC-64: as{{(.exe)?}}" "-Q" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
 
 // RUN: %clang -target x86_64-apple-darwin10 -### \
 // RUN:   -arch armv6 -no-integrated-as -x assembler -c %s 2>%t
 // RUN: FileCheck -check-prefix=CHECK-ARMV6 --input-file %t %s
 //
-// CHECK-ARMV6: as{{(.exe)?}}" "-arch" "armv6" "-o"
+// CHECK-ARMV6: as{{(.exe)?}}" "-Q" "-arch" "armv6" "-o"





More information about the cfe-commits mailing list