diff --git a/README.md b/README.md index 9a67caa0909ad29bc3282fb4e5aadd07d146990d..714b20927b30b2ddddfe9fa2aec846035170b226 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,28 @@ LLVM (http://llvm.org/): If your build fails at some point, consult the docs [building klee](https://klee.github.io/build-llvm9/). +## Install KLEE from `aur` (arch linux) + +The `aur` package [klee](https://aur.archlinux.org/packages/klee/), installs KLEE in `/usr/bin` (binaries), `/usr/include` (C-include files), and `usr/lib` (libraries). These are the default system folders respectively, so it makes it easier to compile, link, and run the KLEE tools. + +```shell +> yay -S klee +> klee -version +KLEE 2.2 (https://klee.github.io) + Build mode: Release (Asserts: ON) + Build revision: 5719d2803e93252e5d4613f43afc7db0d72332f1 + +LLVM (http://llvm.org/): + LLVM version 11.0.0 + Optimized build. + Default target: x86_64-pc-linux-gnu + Host CPU: skylake +``` + +Notice, if you have previously installed from source, but want to use the `aur` instead you should remove the source installed files found in `/usr/local/bin`, `/usr/local/include` and `/usr/local/lib` (please make sure that you only remove the KLEE related files). + +--- + ## Testing a small function See the `examples/get_sign` folder. diff --git a/examples/get_sign.c b/examples/get_sign.c index 52e5f755cf04ca9b0085fcfae6a2122a9bb8c802..f7ccc2fee670bb4739036590274078134a61f05c 100644 --- a/examples/get_sign.c +++ b/examples/get_sign.c @@ -66,10 +66,21 @@ int main() // > ls /usr/local/lib // klee libkleeRuntest.so libkleeRuntest.so.1.0 // +// If you installed Klee using the package manager +// the path might be different: +// +// Using `aur` (arch) files are stored in the system default +// folders, `/usr/include` and `/usr/lib`. +// // If those are ok, then you can compile for replay: // // > clang -I /usr/local/include/ -L /usr/local/lib get_sign.c -l kleeRuntest // +// Or just +// > clang get_sign -l kleeRuntest +// +// If the `include` and `lib` paths are the system defaults. +// // To replay the first test: // // We need to add the libary path so it can be dynamically loaded: @@ -81,6 +92,9 @@ int main() // Under `fish` // > set -x LD_LIBRARY_PATH /usr/local/lib/:$LD_LIBRARY_PATH // +// Once again, if using the system default system folders +// you don't need to add anything to `LD_LIBRARY_PATH`. +// // > KTEST_FILE=klee-last/test000001.ktest ./a.out // // Now let's inspect the status (return code), in `bash`: @@ -124,6 +138,9 @@ int main() // First build it with debug symbols (`-g`). // > clang -g -I /usr/local/include/ -L /usr/local/lib get_sign.c -l kleeRuntest // +// Or if using system defaults: +// > clang -g get_sign.c -l kleeRuntest +// // Then start `gdb`: // > KTEST_FILE=klee-last/test000001.ktest gdb ./a.out // (gdb) break get_sign