Skip to content
Dan Liew edited this page Dec 22, 2013 · 2 revisions

What is klee-uclibc?

klee-uclibc is a fork of the small C library uClibc. It is used by the KLEE project to provide C library functions.

Dependencies

  • Ncurses development headers and library
  • LLVM tools ( llvm-dis, llvm-config, llvm-ar )
  • LLVM bitcode compiler ( clang or llvm-gcc )
  • Linux development header files
  • GNU Make
  • Python >= 2.7

Note the LLVM version of the bitcode compiler and other LLVM tools must match!

Just like uClibc, klee-uclibc is Linux ONLY!

Building klee-uclibc

1. Obtain the source code

If you only want to build klee-uclibc but do not intend do any development of the project run

$ git clone --depth 1 --branch klee_0_9_29 https://github.com/ccadar/klee-uclibc.git

this will do a shallow clone so you only get the project history of the latest commit.

If you intend to do development on the project then you will need the full project history so instead run

$ git clone --branch klee_0_9_29 https://github.com/ccadar/klee-uclibc.git
2. Configure

This step will try to configure your build of klee-uclibc. The results of the configure will be written to config.log.

To configure make sure the LLVM tools and the bitcode compiler are in your PATH and run

$ cd klee-uclibc
$ ./configure -l

If you want to force a particular compiler and LLVM toolset then you can run

$ CC=/path/to/compiler ./configure -l --with-llvm-config /path/to/llvm-config

The configure script has several other options, to see this run

$ ./configure --help

3. Additional configuration

If configuration was successful a pre-built .config file will be placed in the root of the klee-uclibc directory. If this configuration is not to your liking you can easily change it before building by running the following command, tweaking the options and saving the configuration.

$ make menuconfig

4. Build

Now you simply run make

$ make -jN

where N is the number of jobs to run in parallel.

If everything went okay the libraries will be built in the lib/ directory.