From patchwork Mon Jan 8 08:19:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 58666 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 14B0E27BBE2; Mon, 8 Jan 2024 08:20:23 +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=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no 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 0C67B27BBE2 for ; Mon, 8 Jan 2024 08:20:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMkrZ-0002qw-U1; Mon, 08 Jan 2024 03:20:01 -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 1rMkrX-0002qH-VI for guix-patches@gnu.org; Mon, 08 Jan 2024 03:20:00 -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 1rMkrX-00013u-Mk for guix-patches@gnu.org; Mon, 08 Jan 2024 03:19:59 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMkrZ-0002df-Kl; Mon, 08 Jan 2024 03:20:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62666] [PATCH v3] gnu: Add aflplusplus. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: GNUtoo@cyberdimension.org, hako@ultrarare.space, guix-patches@gnu.org Resent-Date: Mon, 08 Jan 2024 08:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62666 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62666@debbugs.gnu.org Cc: Hilton Chain , Denis 'GNUtoo' Carikli , Denis 'GNUtoo' Carikli , Hilton Chain X-Debbugs-Original-Xcc: Denis 'GNUtoo' Carikli , Hilton Chain Received: via spool by 62666-submit@debbugs.gnu.org id=B62666.170470197910104 (code B ref 62666); Mon, 08 Jan 2024 08:20:01 +0000 Received: (at 62666) by debbugs.gnu.org; 8 Jan 2024 08:19:39 +0000 Received: from localhost ([127.0.0.1]:35089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkrC-0002ct-W3 for submit@debbugs.gnu.org; Mon, 08 Jan 2024 03:19:39 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:34194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkrA-0002ch-0b for 62666@debbugs.gnu.org; Mon, 08 Jan 2024 03:19:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1704701963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4Uj4ZoeBz4Ax+pxlUxDHQAelUG3mZZ2NFKkCu5dO+g=; b=izjGLy9fKIvHbbZbAv+fOh9f+m9LTlo1wDeRbYTSHwvYSX7Hq1VzbP0ajH5nlkbPQFwQMj gNCffgZjWUMvbXgHY3jDjEjT0a++hsxFSYFKrXTriX7+bf8lKJwkFhN5j+SgJQkeZBCBFL 5i+s6+yaUAD4zI66DGpFsC7OHDcpIP1P2p9KfnzgzeQuyM6TTOVE5AjEHo3x5f3X5SszR7 +nygyzvA5UqkmfEdmQOXek88cJozSITZjXf1E38e0oLZHktonqFiwbAqtjgwC5MLp6p7bA /eCeSWwzXTYoJ7r6BkAkaBJQJY2gQ0ceoJoGntqkdOcdVZp+jUx6PwySTGY8KA== Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space Date: Mon, 8 Jan 2024 16:19:00 +0800 Message-ID: In-Reply-To: <20230404174449.5297-1-GNUtoo@cyberdimension.org> References: <20230404174449.5297-1-GNUtoo@cyberdimension.org> MIME-Version: 1.0 X-Spamd-Bar: + 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: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain 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: Denis 'GNUtoo' Carikli * gnu/packages/debug.scm (aflplusplus): New variable. Change-Id: Ibda36187e839d5f533d461444db25a7ba5567f0f Modified-by: Hilton Chain --- Hi Denis, Aplogies for the long delay... I have adjusted the phases for proper cross-compilation support and updated the package to the latest version. I'm sending out v3 mainly for QA purpose, I'll push it if there's no further issue. Thanks gnu/packages/debug.scm | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) base-commit: 3de361d9c9d320aefbd43710124d7b07af891de1 -- 2.41.0 diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index 5a528c7a28..6d4567acc4 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -50,6 +50,7 @@ (define-module (gnu packages debug) #:use-module (gnu packages code) #:use-module (gnu packages compression) #:use-module (gnu packages flex) + #:use-module (gnu packages gcc) #:use-module (gnu packages gdb) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) @@ -59,6 +60,7 @@ (define-module (gnu packages debug) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) + #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages ninja) #:use-module (gnu packages perl) @@ -459,6 +461,59 @@ (define-public qemu-for-american-fuzzy-lop ;; Several tests fail on MIPS. (supported-systems (delete "mips64el-linux" %supported-systems)))))) +(define-public aflplusplus + (package + (inherit american-fuzzy-lop) + (name "aflplusplus") + (version "4.09c") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AFLplusplus/AFLplusplus") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "12bplpd8cifla6m9l130fd22ggzkhd1w5s1aifw1idpy3njhj129")))) + (arguments + (substitute-keyword-arguments (package-arguments american-fuzzy-lop) + ((#:make-flags _ ''()) + #~(list (string-append "PREFIX=" #$output) + (string-append "DOC_PATH=" #$output "/share/doc/" + #$(package-name this-package) "-" + #$(package-version this-package)) + (string-append "CC=" #$(cc-for-target)))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + ;; For GCC plugins. + (add-after 'unpack 'patch-gcc-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/afl-cc.c" + (("alt_cc = \"gcc\";") + (format #f "alt_cc = \"~a\";" + (search-input-file inputs "bin/gcc"))) + (("alt_cxx = \"g\\+\\+\";") + (format #f "alt_cxx = \"~a\";" + (search-input-file inputs "bin/g++")))))))))) + ;; According to the Dockerfile, GCC 12 is producing compile errors for some + ;; targets, so explicitly use GCC 11 here. + (inputs (list gcc-11 gmp python qemu)) + (native-inputs (list gcc-11)) + (home-page "https://aflplus.plus/") + (description + "AFLplusplus is a security-oriented fuzzer that employs a novel type of +compile-time instrumentation and genetic algorithms to automatically discover +clean, interesting test cases that trigger new internal states in the targeted +binary. This substantially improves the functional coverage for the fuzzed +code. The compact synthesized corpora produced by the tool are also useful for +seeding other, more labor- or resource-intensive testing regimes down the road. +It is a fork of American Fuzzy Lop fuzzer and features: +@itemize +@item A more recent qemu version. +@item More algorithms like collision-free coverage, enhanced laf-intel & +redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, etc. +@end itemize"))) + (define-public stress-make (let ((commit "97815bed8060de33952475b3498767c91f59ffd9") (revision "2")) ;No official source distribution