Discussion:
Wllvm cannot find klee
Saikat Dutta
2013-10-04 07:03:11 UTC
Permalink
Hi,
I was executing bc-1.06 using the following steps:
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
It results in the following error:
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o execute.o
load.o storage.o util.o global.o ../lib/libbc.a -lfl
main.o: In function `main':
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2


How do i include klee's library during make step?
Daniel Liew
2013-10-04 10:08:18 UTC
Permalink
You can try linking to "libkleeRunTest.so" in KLEE's binary build folder.

You need something like

wllvm -g -O0 -Wall -funsigned-char -I /path/to/klee_source/include
-o bc main.o bc.o scan.o execute.o load.o storage.o util.o global.o
../lib/libbc.a -lfl -L /path/to/klee_build/Release+Asserts/lib
-Wl,-rpath=/path/to/klee_build/Relase+Asserts/lib -lkleeRunTest

And your program using klee_make_symbolic should have #include
<klee/klee.h> in it somewhere.

As for making the build system set the right flags, you are on your own.
Post by Saikat Dutta
Hi,
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o execute.o
load.o storage.o util.o global.o ../lib/libbc.a -lfl
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2
How do i include klee's library during make step?
Saikat Dutta
2013-10-04 10:58:41 UTC
Permalink
Hi,
I am using klee over multiple file application. How to do it at make or
configure step?
Post by Daniel Liew
You can try linking to "libkleeRunTest.so" in KLEE's binary build folder.
You need something like
wllvm -g -O0 -Wall -funsigned-char -I /path/to/klee_source/include
-o bc main.o bc.o scan.o execute.o load.o storage.o util.o global.o
../lib/libbc.a -lfl -L /path/to/klee_build/Release+Asserts/lib
-Wl,-rpath=/path/to/klee_build/Relase+Asserts/lib -lkleeRunTest
And your program using klee_make_symbolic should have #include
<klee/klee.h> in it somewhere.
As for making the build system set the right flags, you are on your own.
Post by Saikat Dutta
Hi,
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o execute.o
load.o storage.o util.o global.o ../lib/libbc.a -lfl
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2
How do i include klee's library during make step?
Daniel Liew
2013-10-04 22:08:10 UTC
Permalink
If you run the command I gave you and then run make again make should
continue past building bc because it's already been built (that's
whole point of make!).

I'll reiterate what I said earlier though:

"As for making the build system set the right flags, you are on your own."
Post by Saikat Dutta
Hi,
I am using klee over multiple file application. How to do it at make or
configure step?
Post by Daniel Liew
You can try linking to "libkleeRunTest.so" in KLEE's binary build folder.
You need something like
wllvm -g -O0 -Wall -funsigned-char -I /path/to/klee_source/include
-o bc main.o bc.o scan.o execute.o load.o storage.o util.o global.o
../lib/libbc.a -lfl -L /path/to/klee_build/Release+Asserts/lib
-Wl,-rpath=/path/to/klee_build/Relase+Asserts/lib -lkleeRunTest
And your program using klee_make_symbolic should have #include
<klee/klee.h> in it somewhere.
As for making the build system set the right flags, you are on your own.
Post by Saikat Dutta
Hi,
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o execute.o
load.o storage.o util.o global.o ../lib/libbc.a -lfl
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2
How do i include klee's library during make step?
Saikat Dutta
2013-10-05 07:32:48 UTC
Permalink
The command doesnt work... shows errors:
***@saikat-laptop:~/Downloads/bc_gprof/bc$ wllvm -g -O0 -Wall
-funsigned-char -I/home/saikat/Downloads/kleesvn/include
-L/home/saikat/Downloads/kleesvn/Release+Asserts/lib -o bc main.o bc.o
scan.o execute.o load.o storage.o util.o global.o ../lib/libbc.a -lfl
-Wl,-rpath=/home/saikat/kleesvn/Release+Asserts/lib -lkleeRunTest
/usr/bin/ld: cannot find -lkleeRunTest
collect2: ld returned 1 exit status
Post by Daniel Liew
If you run the command I gave you and then run make again make should
continue past building bc because it's already been built (that's
whole point of make!).
"As for making the build system set the right flags, you are on your own."
Post by Saikat Dutta
Hi,
I am using klee over multiple file application. How to do it at make or
configure step?
Post by Daniel Liew
You can try linking to "libkleeRunTest.so" in KLEE's binary build
folder.
Post by Saikat Dutta
Post by Daniel Liew
You need something like
wllvm -g -O0 -Wall -funsigned-char -I /path/to/klee_source/include
-o bc main.o bc.o scan.o execute.o load.o storage.o util.o global.o
../lib/libbc.a -lfl -L /path/to/klee_build/Release+Asserts/lib
-Wl,-rpath=/path/to/klee_build/Relase+Asserts/lib -lkleeRunTest
And your program using klee_make_symbolic should have #include
<klee/klee.h> in it somewhere.
As for making the build system set the right flags, you are on your own.
Post by Saikat Dutta
Hi,
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o
execute.o
Post by Saikat Dutta
Post by Daniel Liew
Post by Saikat Dutta
load.o storage.o util.o global.o ../lib/libbc.a -lfl
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2
How do i include klee's library during make step?
Daniel Liew
2013-10-06 11:30:42 UTC
Permalink
Please learn how to link with dynamic libraries...

http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html
Post by Saikat Dutta
-funsigned-char -I/home/saikat/Downloads/kleesvn/include
-L/home/saikat/Downloads/kleesvn/Release+Asserts/lib -o bc main.o bc.o
scan.o execute.o load.o storage.o util.o global.o ../lib/libbc.a -lfl
-Wl,-rpath=/home/saikat/kleesvn/Release+Asserts/lib -lkleeRunTest
/usr/bin/ld: cannot find -lkleeRunTest
collect2: ld returned 1 exit status
Post by Daniel Liew
If you run the command I gave you and then run make again make should
continue past building bc because it's already been built (that's
whole point of make!).
"As for making the build system set the right flags, you are on your own."
Post by Saikat Dutta
Hi,
I am using klee over multiple file application. How to do it at make or
configure step?
Post by Daniel Liew
You can try linking to "libkleeRunTest.so" in KLEE's binary build folder.
You need something like
wllvm -g -O0 -Wall -funsigned-char -I /path/to/klee_source/include
-o bc main.o bc.o scan.o execute.o load.o storage.o util.o global.o
../lib/libbc.a -lfl -L /path/to/klee_build/Release+Asserts/lib
-Wl,-rpath=/path/to/klee_build/Relase+Asserts/lib -lkleeRunTest
And your program using klee_make_symbolic should have #include
<klee/klee.h> in it somewhere.
As for making the build system set the right flags, you are on your own.
Post by Saikat Dutta
Hi,
CC="wllvm" CFLAGS="-g -O0" ./configure
make CC="wllvm"
wllvm -g -O0 -Wall -funsigned-char -o bc main.o bc.o scan.o execute.o
load.o storage.o util.o global.o ../lib/libbc.a -lfl
/home/saikat/Downloads/bc_gprof/bc//main.c:163: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:164: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:167: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:168: undefined reference to
`klee_make_symbolic'
/home/saikat/Downloads/bc_gprof/bc//main.c:169: undefined reference to
`klee_make_symbolic'
main.o:/home/saikat/Downloads/bc_gprof/bc//main.c:170: more undefined
references to `klee_make_symbolic' follow
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/saikat/Downloads/bc_gprof/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/saikat/Downloads/bc_gprof'
make: *** [all-recursive-am] Error 2
How do i include klee's library during make step?
Loading...