Permalink
Browse files

Fixed build but unit test still failing

  • Loading branch information...
1 parent e708ab4 commit b6fca15d6cb31751b8ed429c10ebd7c7b1081a0e @peryaudo committed Mar 20, 2016
Showing with 15 additions and 8 deletions.
  1. +4 −0 build/unix/.gitignore
  2. +1 −1 build/unix/Makefile
  3. +9 −6 src/LLVMCodeGen.cc
  4. +1 −1 src/Main.cc
@@ -0,0 +1,4 @@
+bin
+obj
+test
+dep
View
@@ -10,7 +10,7 @@ endif
CXXFLAGS = -Wall -coverage -g
CPPFLAGS =
-LDFLAGS = `llvm-config --ldflags`
+LDFLAGS = `llvm-config --ldflags` -lpthread -lz -lncurses -ldl
OBJDIR = obj
TEST_OBJDIR = test/obj
View
@@ -2,16 +2,18 @@
// to remove LLVM dependecies from other part of the compiler
// and to enclosure all of them in the class.
#include <sstream>
+#include <system_error>
#include <deque>
#include "llvm/IR/Module.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
-#include "llvm/PassManager.h"
-#include "llvm/Assembly/PrintModulePass.h"
+#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "SymbolTable.h"
@@ -257,11 +259,12 @@ void LLVMCodeGen::Impl::generate() {
assert(blocks.empty());
- llvm::PassManager pm;
- std::string error;
- llvm::raw_fd_ostream rawStream(fileName_.c_str(), error);
+ // This may help for fixing it: https://github.com/numba/llvmlite/issues/5
+ llvm::legacy::PassManager pm;
+ std::error_code error;
+ llvm::raw_fd_ostream rawStream(fileName_.c_str(), error, llvm::sys::fs::F_None);
- pm.add(createPrintModulePass(&rawStream));
+ pm.add(createPrintModulePass(rawStream));
pm.run(module_);
rawStream.close();
View
@@ -219,7 +219,7 @@ int main(int argc, char *argv[])
std::stringstream ss;
if (opt.runtime == "unixcl")
{
- ss<<"gcc -s -w -o \""<<opt.outputFileName<<"\"";
+ ss<<"gcc -s -w -lm -o \""<<opt.outputFileName<<"\"";
ss<<" \""<<opt.tmpDir<<"/tmp.o\" \""<<opt.runtimePath<<"/"<<opt.runtime<<".o\"";
}
else if (opt.runtime == "win32")

0 comments on commit b6fca15

Please sign in to comment.