From: soeren@soeren-tempel.net
To: 68296@debbugs.gnu.org
Subject: [bug#68296] [PATCH v3 1/2] gnu: Add klee-uclibc.
Date: Wed, 28 Feb 2024 18:04:45 +0100 [thread overview]
Message-ID: <99fdb88daa1db94c659f2c79b42b39c704fd8bde.1709139885.git.soeren@soeren-tempel.net> (raw)
In-Reply-To: <890dc6595ccef88cb60ff0a380be9d323df479aa.1704573641.git.soeren@soeren-tempel.net>
From: Sören Tempel <soeren@soeren-tempel.net>
* gnu/packages/check.scm (klee-uclibc): New variable.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
---
Changes since v2: Rebase against the current master branch, this resolves
a merge conflict in the copyright comment section. No functional changes.
gnu/packages/check.scm | 62 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 5428098c15..50fd105b2c 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -49,6 +49,7 @@
;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -82,6 +83,7 @@ (define-module (gnu packages check)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages guile-xyz)
+ #:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
@@ -3635,3 +3637,63 @@ (define-public subunit
command line filters to process a subunit stream and language bindings for
Python, C, C++ and shell. Bindings are easy to write for other languages.")
(license (list license:asl2.0 license:bsd-3)))) ;user can pick
+
+(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)
+ ;; Only x86_64 is presently supported by KLEE upstream.
+ (supported-systems '("x86_64-linux"))
+ (arguments
+ `(#:tests? #f ;upstream uClibc tests do not work in the fork
+ #: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")))))))
+ (inputs (list clang-toolchain-13))
+ ;; ncurses is only needed for the `make menuconfig` interface.
+ (native-inputs (list 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.github.io/")
+ (license license:lgpl2.1))))
base-commit: bc6840316c665e5959469e5c857819142cc4a47b
next prev parent reply other threads:[~2024-02-28 17:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-06 20:40 [bug#68296] [PATCH] gnu: Add KLEE soeren
2024-02-13 8:49 ` Julien Lepiller
2024-02-13 14:09 ` Sören Tempel
2024-02-13 14:08 ` [bug#68296] [PATCH v2 1/2] gnu: Add klee-uclibc soeren
2024-02-13 14:08 ` [bug#68296] [PATCH v2 2/2] gnu: Add klee soeren
2024-02-28 17:04 ` soeren [this message]
2024-02-28 17:04 ` [bug#68296] [PATCH v3 " soeren
2024-03-11 9:54 ` [bug#68296] gnu: Add KLEE Sören Tempel
2024-03-28 19:20 ` [bug#68296] [PATCH v4 1/2] gnu: Add klee-uclibc soeren
2024-03-28 19:20 ` [bug#68296] [PATCH v4 2/2] gnu: Add klee soeren
2024-06-23 13:46 ` bug#71634: " Liliana Marie Prikler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99fdb88daa1db94c659f2c79b42b39c704fd8bde.1709139885.git.soeren@soeren-tempel.net \
--to=soeren@soeren-tempel.net \
--cc=68296@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.