From patchwork Wed Feb 28 17:04:48 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: 61229 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 1F63827BBE9; Wed, 28 Feb 2024 17:41:37 +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=unavailable 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 C5CE727BBE2 for ; Wed, 28 Feb 2024 17:41:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfNvB-0007jW-Bl; Wed, 28 Feb 2024 12:40:45 -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-0007eD-AT 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 1rfNv3-0004UV-15 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-0007eI-L8 for guix-patches@gnu.org; Wed, 28 Feb 2024 12:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68296] [PATCH v3 2/2] gnu: Add klee. 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.170914202429233 (code B ref 68296); Wed, 28 Feb 2024 17:41:03 +0000 Received: (at 68296) by debbugs.gnu.org; 28 Feb 2024 17:40:24 +0000 Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfNup-0007bI-8i for submit@debbugs.gnu.org; Wed, 28 Feb 2024 12:40:24 -0500 Received: from magnesium.8pit.net ([45.76.88.171]:45015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfNPw-00062k-AC; Wed, 28 Feb 2024 12:08:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=DC/tywyrx2 ZkwZyVFOIgi33ienDylxvLpZfID3OkgUM=; h=references:in-reply-to:date: subject:to:from; d=soeren-tempel.net; b=H8s8geFvYzZGN6cyNFBxyJDTaoR0ec hBNoExqzHNfgph2ED2w6E2sZu88z1Sx1NZzeDUvvBHdJLSlD2bRgbtndKz18s83d1IBDMa b9NB4JJOAA0dKmaU87Dk1+JB08BiF6tpnfnC5Veq+RMSksN6JtwYsPpHgz1zzNFs0uS4Zh Y= 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 25a623a0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Wed, 28 Feb 2024 18:06:58 +0100 (CET) From: soeren@soeren-tempel.net Date: Wed, 28 Feb 2024 18:04:48 +0100 Message-ID: <262a52af77537ec120f0ac58a5d8c76d73a7aa92.1709139885.git.soeren@soeren-tempel.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <99fdb88daa1db94c659f2c79b42b39c704fd8bde.1709139885.git.soeren@soeren-tempel.net> References: <99fdb88daa1db94c659f2c79b42b39c704fd8bde.1709139885.git.soeren@soeren-tempel.net> 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): New variable. Signed-off-by: Sören Tempel --- Changes since v2: Switch to a non-debug build-type to workaround an internal error being triggered in clang while building KLEE with it. gnu/packages/check.scm | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 50fd105b2c..534852f029 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -74,6 +74,7 @@ (define-module (gnu packages check) #:use-module (gnu packages bash) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages glib) @@ -83,6 +84,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 maths) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -92,6 +94,7 @@ (define-module (gnu packages check) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages python-science) + #:use-module (gnu packages sqlite) #:use-module (gnu packages texinfo) #:use-module (gnu packages time) #:use-module (gnu packages xml) @@ -3697,3 +3700,55 @@ (define-public klee-uclibc with the @code{klee} package.") (home-page "https://klee.github.io/") (license license:lgpl2.1)))) + +(define-public klee + (package + (name "klee") + (version "3.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/klee/klee") + (commit (string-append "v" version)))) + (sha256 + (base32 "0dj20nazkcq84ryr87dihvjznapsbl1n21sa8dhhnb0wsad5d6fb")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + ;; Only x86_64 is presently supported by KLEE upstream. + (supported-systems '("x86_64-linux")) + (arguments + `(#:test-target "systemtests" + ;; Default build type (RelWithDebInfo) causes an internal error + ;; in clang while compiling KLEE, hence use a different build type. + #:build-type "Release" + #:strip-directories '("bin") + #:configure-flags ,#~(list "-DENABLE_KLEE_ASSERTS=OFF" + "-DENABLE_TCMALLOC=ON" + "-DENABLE_POSIX_RUNTIME=ON" + (string-append "-DKLEE_UCLIBC_PATH=" + #$klee-uclibc)) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-lit-config + (lambda _ + ;; Make sure that we retain the value of the GUIX_PYTHONPATH + ;; environment variable in the test environmented created by + ;; python-lit. Otherwise, the test scripts won't be able to + ;; find the python-tabulate dependency, causing test failures. + (substitute* "test/lit.cfg" + (("addEnv\\('PWD'\\)" env) + (string-append env "\n" "addEnv('GUIX_PYTHONPATH')")))))))) + ;; KLEE operates on LLVM IR generated by a specific toolchain version. + ;; Propergate the toolchain to allow users to transform code to this version. + (propagated-inputs (list clang-toolchain-13 llvm-13 python python-tabulate)) + (inputs (list z3 gperftools sqlite)) + (native-inputs (list python-lit)) + (synopsis + "Symbolic execution engine built on top of the LLVM compiler infastructure") + (description + "Dynamic symbolic execution engine built on top of +LLVM. Symbolic execution is an automated software testing technique, +KLEE leverage this technique to automatically generate test cases for +software compiled to LLVM IR.") + (home-page "https://klee.github.io/") + (license (list license:expat license:bsd-4))))