Hi,

I have two linking problems.

The first one is when compiling a program that uses sockets. In my  
case, it should be OK if the socket calls/syscalls are executed as  
external functions, however, I get this error message:

KLEE: WARNING: undefined reference to function: __socketcall
.
.
.
KLEE: WARNING: calling external: __socketcall
KLEE: ERROR: failed external call: __socketcall

I can see that in the file system model you are ignoring __socketcall  
(and basically return an error (klee_warning("ignoring  
(EAFNOSUPPORT)")) but in this particular case I am not using the model  
and this is not called.

Looking at uclibc, I can see in libc/sysdeps/linux/common/ 
__socketcall.c that the function is defined and thus KLEE should see  
it since it automatically links against microlibc.

Is there any way to see why the external call failed?

Could it be that uclibc is not compiled with socket support in the  
first place (I am using the default configure file for uclibc which  
looks like does not disable the networking support)?

The second problem is when I compile a library called NL using klee- 
gcc and separately a program (also with klee-gcc) that links against  
this library.

I do something like make CC=klee-gcc AR="llvm-ar cru" RANLIB="llvm- 
ranlib" to make the library and everything goes ok, no errors.

Then I simply do "make CC=klee-gcc" for the program that links against  
the NL library which in the end runs
llvm-ld --disable-opt -lNL -L../src program.o -o program
Again no errors.

However, when running with klee, I get the warning
"KLEE: WARNING: undefined reference to function"
for all library functions and the same "failed external call" error  
for the first invocation of a function from the library.

I noticed that llvm-ld does not complain if I just run llvm-ld -- 
disable-opt program.o -o program without linking at all.

My question is if you have any idea what I am doing wrong.
Also, is there a llvm-ldd which I can use to see how llvm-ld links?

Thanks a lot for your help.

Cheers,
Cristi





Reply via email to