From patchwork Thu Nov 23 14:52:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 56753 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 DB33A27BBE9; Thu, 23 Nov 2023 14:54:26 +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.9 required=5.0 tests=BAYES_00,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 6B17F27BBE2 for ; Thu, 23 Nov 2023 14:54:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6B5g-0006bm-H2; Thu, 23 Nov 2023 09:54:04 -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 1r6B5e-0006aZ-Nb for guix-patches@gnu.org; Thu, 23 Nov 2023 09:54:02 -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 1r6B5e-0001dw-FY for guix-patches@gnu.org; Thu, 23 Nov 2023 09:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6B5h-0007Bg-AZ for guix-patches@gnu.org; Thu, 23 Nov 2023 09:54:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67399] [PATCH v2 3/3] gnu: aflplusplus: Build afl-gcc/g++-fast Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Thu, 23 Nov 2023 14:54:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67399 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67399@debbugs.gnu.org Cc: Denis 'GNUtoo' Carikli , ( , Christopher Baines , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart X-Debbugs-Original-Xcc: ( , Christopher Baines , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart Received: via spool by 67399-submit@debbugs.gnu.org id=B67399.170075122127553 (code B ref 67399); Thu, 23 Nov 2023 14:54:05 +0000 Received: (at 67399) by debbugs.gnu.org; 23 Nov 2023 14:53:41 +0000 Received: from localhost ([127.0.0.1]:33026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6B5J-0007AG-Bw for submit@debbugs.gnu.org; Thu, 23 Nov 2023 09:53:41 -0500 Received: from [2001:910:1314:ffff::1] (port=49176 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6B5E-00078m-2V for 67399@debbugs.gnu.org; Thu, 23 Nov 2023 09:53:37 -0500 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id e7a37a2d; Thu, 23 Nov 2023 14:53:28 +0000 (UTC) Received: from localhost.localdomain (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 139e7658; Thu, 23 Nov 2023 14:53:27 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Thu, 23 Nov 2023 15:52:52 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <08dda007d354a5857a348d8d001c06216c940893.1694747596.git.GNUtoo@cyberdimension.org> References: <08dda007d354a5857a348d8d001c06216c940893.1694747596.git.GNUtoo@cyberdimension.org> 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 * gnu/packages/debug.scm (aflplusplus): [inputs]: Add gcc, gmp. --- gnu/packages/debug.scm | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index 04458d0220..c9fdca8c8b 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) @@ -473,7 +475,35 @@ (define-public aflplusplus (sha256 (base32 "01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg")))) - (inputs (list python qemu)) + (arguments + (substitute-keyword-arguments (package-arguments american-fuzzy-lop) + ((#:phases phases) + `(modify-phases ,phases + ;; TODO: Enable to cross compile aflplusplus by also enabling qemu + ;; to be cross compiled and by fixing the use-build-gcc phase below. + (add-before 'build 'use-build-gcc + (lambda _ + ;; We need to patch it to select the build-time gcc else we get + ;; something like that: + ;; $ afl-gcc-fast main.c + ;; afl-cc++4.08c by [...] - mode: GCC_PLUGIN-DEFAULT + ;; cc1: error: cannot load plugin + ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so: + ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so: + ;; undefined symbol: + ;; _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE + (substitute* "src/afl-cc.c" + (("alt_cc = \"gcc\";") + (string-append "alt_cc = \"" + (which "gcc") "\";")) + (("alt_cxx = \"g\\+\\+\";") + (string-append "alt_cxx = \"" + (which "g++") "\";"))))))))) + ;; afl-gcc and g++-fast require gcc and gmp. The gcc-11 input is used + ;; instead of gcc because in the Dockerfile inside aflplusplus source code + ;; has the following comment: "GCC 12 is producing compile errors for some + ;; targets so we stay at GCC 11". + (inputs (list gcc-11 gmp python qemu)) (home-page "https://aflplus.plus") (description "AFLplusplus is a security-oriented fuzzer that employs a novel type of