This is a modified version version of uClibc for KLEE. Please see README for information about uClibc.
To build uClibc for KLEE:
-
Make sure
llvm-configis in your PATH (or set using--with-llvm-config). The LLVM version used byllvm-configshould match the LLVM version used by the C LLVM Bitcode compiler you intend to use in step 2. -
Make sure you have one of the following C LLVM compilers
clangbuilt in the LLVM tool directory (llvm-config --bindir)clangin yourPATH
The C compiler to be used will be looked for in the above order with the first working compiler to be used.
Note you can also force a particular C compiler by using the CC
environment variable or by using --with-cc with the configure
script.
-
Run the configure script.
$ ./configure --make-llvm-libTo see all options run
$ ./configure --help -
By default a uClibc pre built
.configfile will be added to the uClibc root directory by the configure script. This is done to make compilation easier for users. However the --disable-prebuilt-config flag can be used to prevent a.configfile being added. If you wish to create your own.configyou can do so by runningmake menuconfigormake configafter running the configure script. -
Compile
$ makeYou can also add optional flags by running adding
KLEE_CFLAGS=...to the end of the make line above. In particular, to compile printf, which is excluded by default, use:make KLEE_CFLAGS="-DKLEE_SYM_PRINTF"To compile in optimized mode use the
--enable-releaseflag. Warning things might break if you do this.