diff mbox series

[bug#71925,2/2] gnu: klee: Build with klee-uclibc support.

Message ID 50e13182dab9f13a90c63a670a286eb447133e44.1720033365.git.soeren@soeren-tempel.net
State New
Headers show
Series Add klee-uclibc. | expand

Commit Message

Sören Tempel July 3, 2024, 7:09 p.m. UTC
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/check.scm (klee): Use klee-uclibc.
---
 gnu/packages/check.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Comments

Liliana Marie Prikler July 6, 2024, 6:49 p.m. UTC | #1
Am Mittwoch, dem 03.07.2024 um 21:09 +0200 schrieb
soeren@soeren-tempel.net:
> From: Sören Tempel <soeren@soeren-tempel.net>
> 
> * gnu/packages/check.scm (klee): Use klee-uclibc.
> ---
>  gnu/packages/check.scm | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 35e26ba6da..ad589f6e15 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -1062,13 +1062,26 @@ (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/"))))))))
The leading colon is pointless here, since you're doing an "=" assign.
More importantly, can we make this a search path?
>       #: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++"))
> +             "-DENABLE_POSIX_RUNTIME=ON"
> +             (string-append "-DKLEE_UCLIBC_PATH=" #$klee-uclibc))))
Can we use search-input-file for this and dirname our way up?
>     (native-inputs (list clang-13 llvm-13 python-lit))
> -   (inputs (list gperftools sqlite z3))
> +   (inputs (list bash-minimal gperftools sqlite z3))
>     (build-system cmake-build-system)
>     (home-page "https://klee-se.org/")
>     (synopsis "Symbolic execution engine")

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 35e26ba6da..ad589f6e15 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1062,13 +1062,26 @@  (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++"))
+             "-DENABLE_POSIX_RUNTIME=ON"
+             (string-append "-DKLEE_UCLIBC_PATH=" #$klee-uclibc))))
    (native-inputs (list clang-13 llvm-13 python-lit))
-   (inputs (list gperftools sqlite z3))
+   (inputs (list bash-minimal gperftools sqlite z3))
    (build-system cmake-build-system)
    (home-page "https://klee-se.org/")
    (synopsis "Symbolic execution engine")