From patchwork Wed Feb 28 17:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Tempel?= X-Patchwork-Id: 61230 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0BA4927BBE2; Wed, 28 Feb 2024 17:41:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 018AC27BBEA for ; Wed, 28 Feb 2024 17:41:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfNvE-0007kt-5z; Wed, 28 Feb 2024 12:40:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfNv3-0007eC-AE for guix-patches@gnu.org; Wed, 28 Feb 2024 12:40:39 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfNv2-0004UR-H7 for guix-patches@gnu.org; Wed, 28 Feb 2024 12:40:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfNvT-0007eA-5O for guix-patches@gnu.org; Wed, 28 Feb 2024 12:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68296] [PATCH v3 1/2] gnu: Add klee-uclibc. References: <890dc6595ccef88cb60ff0a380be9d323df479aa.1704573641.git.soeren@soeren-tempel.net> In-Reply-To: <890dc6595ccef88cb60ff0a380be9d323df479aa.1704573641.git.soeren@soeren-tempel.net> Resent-From: soeren@soeren-tempel.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Feb 2024 17:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68296 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68296@debbugs.gnu.org Received: via spool by 68296-submit@debbugs.gnu.org id=B68296.170914202329218 (code B ref 68296); Wed, 28 Feb 2024 17:41:03 +0000 Received: (at 68296) by debbugs.gnu.org; 28 Feb 2024 17:40:23 +0000 Received: from localhost ([127.0.0.1]:56923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfNuo-0007b9-5L for submit@debbugs.gnu.org; Wed, 28 Feb 2024 12:40:23 -0500 Received: from magnesium.8pit.net ([45.76.88.171]:45015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfNPs-00062k-2p; Wed, 28 Feb 2024 12:08:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=dBZcFcOWKA 7HHKM4gY/KZOQRed0KohARWQaTBXGblMM=; h=date:subject:to:from; d=soeren-tempel.net; b=qxmy3mSC9rmXLNXPnIfuU/0TH0KMfKZ+6Kwc1mjXmIPYomf 7MGpKReRkik6s8b/tnB/ZNMwVIynzS0V+vc2qGZwsaQ9eztv+z8zhpPHmpXt3EzhqdL80b rz+fFz7MTi1Rz6Lpp5fZsK8+8+D9KSMhxFBjjFHdnVx0ixkOcV2x28= Received: from localhost (dynamic-2a02-3102-49da-001b-77ea-c25c-fe03-c73c.310.pool.telefonica.de [2a02:3102:49da:1b:77ea:c25c:fe03:c73c]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 581ad21b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Wed, 28 Feb 2024 18:06:39 +0100 (CET) From: soeren@soeren-tempel.net Date: Wed, 28 Feb 2024 18:04:45 +0100 Message-ID: <99fdb88daa1db94c659f2c79b42b39c704fd8bde.1709139885.git.soeren@soeren-tempel.net> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Sören Tempel * gnu/packages/check.scm (klee-uclibc): New variable. Signed-off-by: Sören Tempel --- 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(+) base-commit: bc6840316c665e5959469e5c857819142cc4a47b 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 ;;; Copyright © 2023 Troy Figiel ;;; Copyright © 2024 Giacomo Leidi +;;; Copyright © 2024 Sören Tempel ;;; ;;; 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))))