[klee-dev] KLEE installation problem

Daniel Liew daniel.liew at imperial.ac.uk
Tue Jun 25 10:45:49 BST 2013


That's a little weird. My guess is your compiler is not configured
correctly as macros like _NR_open and _NR_stat are system call numbers
which are usually defined in unistd_64.h or unistd_32.h which is
indirectly included . For example the file runtime/POSIX/fd.c includes
"sys/syscall.h" which on my system includes "asm/unistd.h".

You will need to investigate which header file on your system you need
to include to get you system call numbers defined. Perhaps you could
try the following...

1. Check /usr/include is being included by llvm-gcc

$ $( llvm-gcc -print-prog-name=cc1) -v
ignoring nonexistent directory
"/home/duncan/llvm-2.9/64/Phase2/Release/llvmgcc42-2.9-release.install/include"
ignoring nonexistent directory
"/home/duncan/llvm-2.9/64/Phase2/Release/llvmgcc42-2.9-release.install/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/include"
ignoring nonexistent directory
"/home/duncan/llvm-2.9/64/Phase2/Release/llvmgcc42-2.9-release.install/x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include
End of search list.


2. Once you have confirmed that llvm-gcc will be including the system
headers then find where the syscall numbers are defined

$ grep -rH '__NR_OPEN' /usr/include

3. Then perhaps check to see if there is a header file that includes
that (assuming it's called unistd.h or unistd_64.h or unistd_32.h on
your system)

$ grep -rHE '^#include <.+/unistd(_(32|64))?\.h>' /usr/include/

If you can find one (on my system that is /usr/include/sys/syscall.h
which is already included in fd.c)


You could also take a look a look at what include paths are being
$ cd /path/to/klee/build/runtime/POSIX/
$ make clean
$ make VERBOSE=1

This will show you the commands being executed to build the runtime library.

Hope that helps,

Dan.


On 25 June 2013 04:54, koxiaozi at aliyun.com <koxiaozi at aliyun.com> wrote:
> Hello,
>      I'm writing this email for my problems while I make install the klee
>     After I sucessfully set  ./configure --with-llvm=$INSTALLDIR/$LLVM
> --with-stp=$INSTALLDIR/$STP --with-uclibc=$INSTALLDIR/$POSIX
> --enable-posix-runtime  , I do make ENABLE_OPTIMIZED=1, then, the errors
> reported like this
>        fd.c:81: error: '_NR_access' undeclared (first use in this function)
>        fd.c:81: error: (Each undeclared identifier is reported only once
>        fd.c:81: error: for each function it appears in.)
>        fd.c: In function '_fd_open':
>        fd.c: 181: error: '_NR_open' undeclared (first use in this function)
>        fd.c: In function '_fd_lseek':
>        fd.c: 390: error: '_NR_lseek' undeclared (first use in this function)
>        fd.c: In function '_fd_stat':
>        fd.c: 439: error: '_NR_stat' undeclared (first use in this function)
>        fd.c: In function '_fd_lstat':
>        fd.c: 458: error: '_NR_lstat' undeclared (first use in this function)
>        .........
>        fd.c: In function 'select':
>        fd.c: 1187: error: '_NR_select' undeclared (first use in this
> function)
>        make[2]: ***[$INSTALLDIR/klee/runtime/POSIX/Release+Asserts/fd.ll]
> Error 1
>        make[2]: leaving directory `$INSTALLDIR/klee/runtime/POSIX'
>        make[1]: ***[POSIX/.makeall]  Error 2
>        make[1]: leaving directory  `$INSTALLDIR/klee/runtime'
>        make: *** [all] Error 1
>      Would you please give me some advice?
>      Thank you in advance.
>
>      Best Regards.
>      Demo.




More information about the klee-dev mailing list