[klee-dev] Install Problems for LLVM2.9
Dan Liew
dan at su-root.co.uk
Wed Jan 21 13:49:34 GMT 2015
On 21 January 2015 at 13:33, Zhiyi Zhang <xianlingzibiying at gmail.com> wrote:
> Hello,
>
> I encountered a problem when I installed LLVM2.9. The error information is
> as following:
>
> Intercept.cpp:69:67: error: ‘lseek64’ was not declared in this scope
> sys::DynamicLibrary::AddSymbol("\x1lseek64", (void*)(intptr_t)lseek64);
> ^
> /bin/rm: cannot remove
> ‘/home/loveling10/klee/llvm-2.9/lib/ExecutionEngine/JIT/Release+Asserts/Intercept.d.tmp’:
> No such file or directory
> /home/loveling10/klee/llvm-2.9/Makefile.rules:1492: recipe for target
> '/home/loveling10/klee/llvm-2.9/lib/ExecutionEngine/JIT/Release+Asserts/Intercept.o'
> failed
> make[3]: ***
> [/home/loveling10/klee/llvm-2.9/lib/ExecutionEngine/JIT/Release+Asserts/Intercept.o]
> Error 1
> make[3]: Leaving directory
> '/home/loveling10/klee/llvm-2.9/lib/ExecutionEngine/JIT'
> /home/loveling10/klee/llvm-2.9/Makefile.rules:829: recipe for target
> 'JIT/.makeall' failed
> make[2]: *** [JIT/.makeall] Error 2
> make[2]: Leaving directory
> '/home/loveling10/klee/llvm-2.9/lib/ExecutionEngine'
> /home/loveling10/klee/llvm-2.9/Makefile.rules:829: recipe for target
> 'ExecutionEngine/.makeall' failed
> make[1]: *** [ExecutionEngine/.makeall] Error 2
> make[1]: Leaving directory '/home/loveling10/klee/llvm-2.9/lib'
> /home/loveling10/klee/llvm-2.9/Makefile.rules:780: recipe for target 'all'
> failed
> make: *** [all] Error 1
>
> Fortunately, I have found one solution from the
> mail-list(https://mailman.ic.ac.uk/mailman/htdig/klee-dev/2013-September/000359.html).
> It is said that I need a fixed patch about
> LLVM2.9(unistd-llvm-2.9-jit.patch). However, the attachment maybe invalid
> so I can not download it. So Could you send a unistd-llvm-2.9-jit.patch to
> me?
The patch is very simple it's this
```
diff -u -r llvm-2.9/lib/ExecutionEngine/JIT/Intercept.cpp
src/lib/ExecutionEngine/JIT/Intercept.cpp
--- llvm-2.9/lib/ExecutionEngine/JIT/Intercept.cpp 2010-11-29
18:16:10.000000000 +0000
+++ src/lib/ExecutionEngine/JIT/Intercept.cpp 2013-09-27
12:11:02.464085889 +0100
@@ -50,6 +50,7 @@
#if defined(__linux__)
#if defined(HAVE_SYS_STAT_H)
#include <sys/stat.h>
+#include <unistd.h>
#endif
#include <fcntl.h>
/* stat functions are redirecting to __xstat with a version number. On x86-64
```
You can easily apply this change manually if some reason you can't get
hold of the patch file.
> Another question is that do I need to have the below environment variables
> set when installing LLVM2.9?
>
> C_INCLUDE_PATH=/usr/include/x86-linux-gnu
> CPLUS_INCLUDE_PATH=/usr/include/x86-linux-gnu
This is a hack to make llvm-gcc work under Ubuntu/Debian because it's
include path is not what llvm-gcc expects.
If you're not using Ubuntu/Debian you won't need this.
Please note if you were to use a newer version of LLVM and clang
instead (see http://klee.github.io/experimental/ ) then
you would avoid these issues.
Thanks,
Dan.
More information about the klee-dev
mailing list