unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: soeren@soeren-tempel.net, 71925@debbugs.gnu.org
Cc: julien@lepiller.eu
Subject: [bug#71925] [PATCH 1/2] gnu: Add klee-uclibc.
Date: Sat, 06 Jul 2024 20:50:18 +0200	[thread overview]
Message-ID: <ddaeaed1aaf85915778faf0f63060af899f114f9.camel@gmail.com> (raw)
In-Reply-To: <05cf10c887315b7b2ee2a4ee5d43a6baea969d6c.1720033365.git.soeren@soeren-tempel.net>

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-uclibc): New variable.
> ---
>  gnu/packages/check.scm | 58
> ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
> 
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 550a5d0f1d..35e26ba6da 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -87,6 +87,7 @@ (define-module (gnu packages check)
>    #:use-module (gnu packages guile)
>    #:use-module (gnu packages guile-xyz)
>    #:use-module (gnu packages maths)
> +  #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
> @@ -989,6 +990,63 @@ (define-public greatest
>  runner.  It is quite unopinionated with most of its features being
> optional.")
>     (license license:isc)))
>  
> +(define-public klee-uclibc
> +  (let ((commit "955d502cc1f0688e82348304b053ad787056c754"))
> +    (package
> +      (name "klee-uclibc")
> +      (version (git-version "20230612" "0" commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/klee/klee-uclibc")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32
> "12fnr5mq80cxwvv09gi844mi31jgi8067swagxnlxlhxj4mi125j"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:tests? #f ;upstream uClibc tests do not work in the fork
> +         #:strip-directories '() ;only ships a static library, so
> don't strip anything.
> +         #:phases (modify-phases %standard-phases
> +                    ;; Disable locales as these would have to be
> downloaded and
> +                    ;; shouldn't really be needed for symbolic
> execution either.
> +                    (add-after 'unpack 'patch-config
> +                      (lambda _
> +                        (substitute* "klee-premade-
> configs/x86_64/config"
> +                         
> (("UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y")
> +                          
> "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=n")
> +                          (("UCLIBC_PREGENERATED_LOCALE_DATA=y")
> +                           "UCLIBC_PREGENERATED_LOCALE_DATA=n")
> +                          (("UCLIBC_HAS_LOCALE=y")
> +                           "UCLIBC_HAS_LOCALE=n")
> +                          (("UCLIBC_HAS_XLOCALE=y")
> +                           "UCLIBC_HAS_XLOCALE=n"))))
> +
> +                    ;; Upstream uses a custom non-GNU configure
> script written
> +                    ;; in Python, replace the default configure
> phase accordingly.
> +                    (replace 'configure
> +                      (lambda _
> +                        (invoke "./configure" "--make-llvm-lib"
> +                                "--enable-release")))
> +
> +                    ;; Custom install phase to only install the
> libc.a file manually.
> +                    ;; This is the only file which is used/needed by
> KLEE itself.
> +                    (replace 'install
> +                      (lambda* (#:key outputs #:allow-other-keys)
> +                        (install-file "lib/libc.a"
> +                                      (string-append (assoc-ref
> outputs "out")
> +                                                     "/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")
> +      (description
> +       "Modified version of uClibc for symbolic execution of
> +Unix userland software.  This library can only be used in
> conjunction
> +with the @code{klee} package.")
> +      (home-page "https://klee-se.org/")
> +      (license license:lgpl2.1))))
Is this only distributed as an .a file or could we make a .so out of
it?

  reply	other threads:[~2024-07-06 18:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 19:03 [bug#71925] [PATCH 0/2] Add klee-uclibc soeren
2024-07-03 19:09 ` [bug#71925] [PATCH 1/2] gnu: " soeren
2024-07-06 18:50   ` Liliana Marie Prikler [this message]
2024-07-03 19:09 ` [bug#71925] [PATCH 2/2] gnu: klee: Build with klee-uclibc support soeren
2024-07-06 18:49   ` Liliana Marie Prikler
2024-07-07 11:24     ` Sören Tempel
2024-07-07 12:51       ` Liliana Marie Prikler
2024-07-07 16:50         ` Sören Tempel
2024-07-07 16:53           ` Liliana Marie Prikler
2024-07-07 17:28             ` Sören Tempel
2024-07-07 18:27               ` Liliana Marie Prikler
2024-07-07 19:18                 ` Sören Tempel
2024-07-07 17:26 ` [bug#71925] [PATCH v2 1/2] gnu: Add klee-uclibc soeren
2024-07-07 17:26   ` [bug#71925] [PATCH v2 2/2] gnu: klee: Build with klee-uclibc support soeren
2024-07-07 19:19 ` [bug#71925] [PATCH v3 1/2] gnu: Add klee-uclibc soeren
2024-07-07 19:19   ` [bug#71925] [PATCH v3 2/2] gnu: klee: Build with klee-uclibc support soeren
2024-07-08  7:44 ` [bug#71925] [PATCH v4 1/2] gnu: Add klee-uclibc soeren
2024-07-08  7:44   ` [bug#71925] [PATCH v4 2/2] gnu: klee: Build with klee-uclibc support soeren
2024-07-08  8:47 ` [bug#71925] [PATCH 0/2] Add klee-uclibc Sören Tempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddaeaed1aaf85915778faf0f63060af899f114f9.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=71925@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    --cc=soeren@soeren-tempel.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).