about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorMarek Chalupa <mchqwerty@gmail.com>2014-12-01 09:26:19 +0100
committerMarek Chalupa <mchqwerty@gmail.com>2014-12-01 10:07:32 +0100
commit060c39c512aa6d06a01a9d52dbefa8ff45054b32 (patch)
tree03c1d7e1799c094d8ecd09e6cd816e13c4a76f54 /tools
parente72b75e019e9f7ccfb222f164f335fc99bb90126 (diff)
downloadklee-060c39c512aa6d06a01a9d52dbefa8ff45054b32.tar.gz
klee: let user override path to runtime library
When looking for runtime library, look first
into KLEE_RUNTIME_LIBRARY_PATH environment variable.
This allows to use klee not only in 'hardcoded' environment.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index a92aa559..23c07f03 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -575,6 +575,11 @@ void KleeHandler::getOutFiles(std::string path,
 }
 
 std::string KleeHandler::getRunTimeLibraryPath(const char *argv0) {
+  // allow specifying the path to the runtime library
+  const char *env = getenv("KLEE_RUNTIME_LIBRARY_PATH");
+  if (env)
+    return std::string(env);
+
   // Take any function from the execution binary but not main (as not allowed by
   // C++ standard)
   void *MainExecAddr = (void *)(intptr_t)getRunTimeLibraryPath;