about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartinNowack <martin.nowack@gmail.com>2016-05-24 16:37:21 +0200
committerMartinNowack <martin.nowack@gmail.com>2016-05-24 16:37:21 +0200
commit4278fdcb819bb9a68ed43f88c86df21c6b04a0ab (patch)
treee0b95412cf85394f4f22b8b516938efbeb05e302
parentf8a757c17454d7e5f4297cef5fad5591e40a6a87 (diff)
parentb5c41d2689c2b05987232a1e206e6a1ac46b8489 (diff)
downloadklee-4278fdcb819bb9a68ed43f88c86df21c6b04a0ab.tar.gz
Merge pull request #386 from ShayDamir/relocatable-klee
Allow relocation of installed klee tree
-rw-r--r--tools/klee/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 80161caa..7fe64c72 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -606,11 +606,15 @@ std::string KleeHandler::getRunTimeLibraryPath(const char *argv0) {
 
   SmallString<128> libDir;
 
-  if ( strcmp(toolRoot.c_str(), KLEE_INSTALL_BIN_DIR ) == 0)
+  if (strlen( KLEE_INSTALL_BIN_DIR ) != 0 &&
+      strlen( KLEE_INSTALL_RUNTIME_DIR ) != 0 &&
+      toolRoot.str().endswith( KLEE_INSTALL_BIN_DIR ))
   {
     KLEE_DEBUG_WITH_TYPE("klee_runtime", llvm::dbgs() <<
                          "Using installed KLEE library runtime: ");
-    libDir = KLEE_INSTALL_RUNTIME_DIR ;
+    libDir = toolRoot.str().substr(0, 
+               toolRoot.str().size() - strlen( KLEE_INSTALL_BIN_DIR ));
+    llvm::sys::path::append(libDir, KLEE_INSTALL_RUNTIME_DIR);
   }
   else
   {