Fix a bug found by inspection.
[oota-llvm.git] / tools / bugpoint / ToolRunner.cpp
index 6480c23cd8e9011bc0de4b8527a1be241c55d281..a967e3e8377728a820d90c56a120504f4a96f671 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/Support/FileUtilities.h"
 #include <fstream>
 #include <sstream>
+#include <iostream>
 using namespace llvm;
 
 ToolExecutionError::~ToolExecutionError() throw() { }
@@ -398,6 +399,9 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
   GCCArgs.push_back("-O2");                // Optimize the program a bit...
 #if defined (HAVE_LINK_R)
   GCCArgs.push_back("-Wl,-R.");            // Search this dir for .so files
+#endif
+#ifdef __sparc__
+  GCCArgs.push_back("-mcpu=v9");
 #endif
   GCCArgs.push_back(0);                    // NULL terminator
 
@@ -456,6 +460,9 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
 
 #if defined(__ia64__) || defined(__alpha__)
     "-fPIC",                     // IA64 requires shared objs to contain PIC
+#endif
+#ifdef __sparc__
+    "-mcpu=v9",
 #endif
     "-o", OutputFile.c_str(),    // Output to the right filename...
     "-O2",                       // Optimize the program a bit...