Skip to content

Commit

Permalink
Merge pull request klee#63 from delcypher/nouclibc
Browse files Browse the repository at this point in the history
Exit if using --libc=uclibc and KLEE was not configured with uclibc
  • Loading branch information
delcypher committed Nov 5, 2013
2 parents a8dbdaf + 2322587 commit daa26b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/klee/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "llvm/Instructions.h"
#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 7)
#include "llvm/LLVMContext.h"
#include "llvm/Support/FileSystem.h"
#endif
#endif
#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7)
Expand Down Expand Up @@ -1013,6 +1014,12 @@ static void replaceOrRenameFunction(llvm::Module *module,
}

static llvm::Module *linkWithUclibc(llvm::Module *mainModule) {
// Ensure that KLEE_UCLIBC exists
bool uclibcRootExists=false;
llvm::sys::fs::is_directory(KLEE_UCLIBC, uclibcRootExists);
if (!uclibcRootExists)
klee_error("Cannot link with uclibc. KLEE_UCLIBC (\"" KLEE_UCLIBC "\") is not a directory.");

Function *f;
// force import of __uClibc_main
mainModule->getOrInsertFunction("__uClibc_main",
Expand Down

0 comments on commit daa26b1

Please sign in to comment.