@@ -1036,7 +1036,7 @@ (define-public klee-uclibc
(lambda* (#:key outputs #:allow-other-keys)
(install-file "lib/libc.a"
(string-append (assoc-ref outputs "out")
- "/lib")))))))
+ "/klee/lib")))))))
;; ncurses is only needed for the `make menuconfig` interface.
(native-inputs (list clang-13 llvm-13 python ncurses))
(synopsis "Variant of uClibc tailored to symbolic execution")
@@ -1062,13 +1062,28 @@ (define-public klee
(base32 "1nma6dqi8chjb97llsa8mzyskgsg4dx56lm8j514j5wmr8vkafz6"))))
(arguments
(list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'wrap-hooks
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (lib (string-append out "/lib")))
+ ;; Ensure that KLEE finds runtime libraries (e.g. uclibc).
+ (wrap-program (string-append bin "/klee")
+ `("KLEE_RUNTIME_LIBRARY_PATH" =
+ (,(string-append lib "/klee/runtime/"))))))))
#:configure-flags
#~(list (string-append "-DLLVMCC="
(search-input-file %build-inputs "/bin/clang"))
(string-append "-DLLVMCXX="
- (search-input-file %build-inputs "/bin/clang++")))))
+ (search-input-file %build-inputs "/bin/clang++"))
+ (string-append "-DKLEE_UCLIBC_PATH="
+ (let ((uclibc (search-input-file %build-inputs "/klee/lib/libc.a")))
+ (dirname (dirname uclibc))))
+ "-DENABLE_POSIX_RUNTIME=ON")))
(native-inputs (list clang-13 llvm-13 python-lit))
- (inputs (list gperftools sqlite z3))
+ (inputs (list bash-minimal klee-uclibc gperftools sqlite z3))
(build-system cmake-build-system)
(home-page "https://klee-se.org/")
(synopsis "Symbolic execution engine")
From: Sören Tempel <soeren@soeren-tempel.net> * gnu/packages/check.scm (klee): Use klee-uclibc. --- gnu/packages/check.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)