]> granicus.if.org Git - clang/commitdiff
Driver: When compiling i386 -fapple-kext code, we fallback to llvmgcc.
authorChad Rosier <mcrosier@apple.com>
Mon, 1 Aug 2011 19:58:48 +0000 (19:58 +0000)
committerChad Rosier <mcrosier@apple.com>
Mon, 1 Aug 2011 19:58:48 +0000 (19:58 +0000)
Unfortunately, llvmgcc doesn't always work when writing temporary output to
/dev/null.  Therefore, create a temp file that is later deleted.
rdar://9837692

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

lib/Driver/Tools.cpp

index 5fd2b9b48646d9f883b84a87cace2c2946ceb124..9748da449c373a67bafe9362ccb713b780427a9d 100644 (file)
@@ -2841,7 +2841,10 @@ void darwin::Compile::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-o");
     // NOTE: gcc uses a temp .s file for this, but there doesn't seem
     // to be a good reason.
-    CmdArgs.push_back("/dev/null");
+    const char *TmpPath = C.getArgs().MakeArgString(
+      D.GetTemporaryPath("s"));
+    C.addTempFile(TmpPath);
+    CmdArgs.push_back(TmpPath);
 
     CmdArgs.push_back("--output-pch=");
     CmdArgs.push_back(Output.getFilename());