From patchwork Tue Aug 1 15:24:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakob Kirsch X-Patchwork-Id: 52451 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 3F91F27BBEA; Tue, 1 Aug 2023 16:25:38 +0100 (BST) 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,FREEMAIL_FROM,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 860E227BBE2 for ; Tue, 1 Aug 2023 16:25:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQrFA-0008TA-62; Tue, 01 Aug 2023 11:25:04 -0400 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 1qQrF8-0008Ss-OB for guix-patches@gnu.org; Tue, 01 Aug 2023 11:25:02 -0400 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 1qQrF8-0004xX-BI for guix-patches@gnu.org; Tue, 01 Aug 2023 11:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQrF7-0007c0-Rc for guix-patches@gnu.org; Tue, 01 Aug 2023 11:25:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64994] [PATCH] gnu: john-the-ripper-jumbo: Fix compilation with GCC 11+. Resent-From: Jakob Kirsch Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Aug 2023 15:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64994 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64994@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169090349329240 (code B ref -1); Tue, 01 Aug 2023 15:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Aug 2023 15:24:53 +0000 Received: from localhost ([127.0.0.1]:48182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQrEy-0007bX-L0 for submit@debbugs.gnu.org; Tue, 01 Aug 2023 11:24:53 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQrEw-0007bH-2C for submit@debbugs.gnu.org; Tue, 01 Aug 2023 11:24:51 -0400 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 1qQrEq-0008Ri-I5 for guix-patches@gnu.org; Tue, 01 Aug 2023 11:24:44 -0400 Received: from mout.web.de ([212.227.15.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQrEn-0004vK-Oj for guix-patches@gnu.org; Tue, 01 Aug 2023 11:24:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1690903479; x=1691508279; i=jakob.kirsch@web.de; bh=TNj+BPBXy12dTwSgcn4EQoONR99MyjacykLLNytClaA=; h=X-UI-Sender-Class:Date:To:From:Subject; b=FkBzXzzc74Un0UtdrIVEzzUK2527vMCfVRwzfnZEbgA7QUiN8oN9K42pnkOjdEJXPW9xdpJ rIh4IA5kW/l3h9j2RX3dJZJxPF2Qs+y+vj/OsT5ABIbjGo9eQgK2ASzOFC15Ga6MyPQD6Rp5L Enz7tBOcTcaDF2ng1rq8TZRftGFKwUhR0O6YSxBqFIIMlyVDCBVlZ+ThVYxN5dQJtrsczSxci SO2BqYgm+YJqAKyjrgMIJrYBF61v3xBgjbdMwmULNIC/08j555f1FVeFBzfda8w3bJO5G3Ge9 i7sQn05uQQ4QSpWvVZV/JSvrbMWwWYido3fSCk0IaY3ywm2fDZvA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.69.73] ([134.19.25.85]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MqZMK-1q4yjm3VcO-00mukl for ; Tue, 01 Aug 2023 17:24:38 +0200 Message-ID: Date: Tue, 1 Aug 2023 17:24:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US From: Jakob Kirsch X-Provags-ID: V03:K1:EHWQVbTEYvOs7HuJT+pmkeFRv5Ax7U7ZJFoL/JNp4utYoQJm1Ai fl/m2OHq2olVP37tQLyd2vuk1N74Q2MdIA5HToCm1iilixmY1yZMkD2CW3+PpelY2vZ3jOc tTG5XEHmdGv+WD6oE/x7W9lwvVjn+BSa9zJtDO9hz7vq5P063aSdAVo1pUr6u9pLdeNXu5r i97QbShcOWhdfnJ1MeH8Q== UI-OutboundReport: notjunk:1;M01:P0:QnLSj6/3Q8M=;qzHM2Hh0nrMR2gc2kCxKn6iQ8jv w5XqwImdpweXG3Tb5YPO1sEu+LczAC7Znn9osqZtWb3Ms8Ed8QvqxUviA17l3NIlUhUUmrj+K j5QnXfYCsuHey+avdvKH2qg/sVqK6F4o8MLSWAoMbfqKSGYwo8qVhpU8jbEsGCiH9+5rERQAE J4vosnNVG47hNVlVRlTG+0zkI0CgweDAaZFM/iJkbyRGy1VOQWWwPltttze/UD5TDL2/tLbHm kfFGXKpOGoHa47aDzBhAtHamD0EC5LWyOf6WdLq8iXqePtl2dMIWnJL22PAl7k7wjn1C5mqSX qQ8NpvhCH6uWnr/fDwHnielCC0hDg/x33scPk4yZmOsuaE4Ib74SH8uWXAA14ZqHUS2YVLmtQ fk7IYJUQ1IuB/eiEaqDoYutGPavjRlkGHUqAhk8iC38q8aKPh4y6pjbiNA+FCHLZP27cDX444 n79zVNbiB5EagwM7zs4q+jDBxaA+E3LbYf9fu7P5IrO3wrv4Lv4aJEccqwM89rqDoytKYSVor HthSaDkYLjaAfgPhG5WSVqnxZjQ435H3sl+MVkW+IUo1Pua9lpWFlFidumX2dZ/vzvAMqmZPe sCSM2rtQaZYH0r0g4mly8iBccKOyEM/6+AKV6p+kHOduawDPI9Y5mpEcBz+kuoo6MbGW3OidZ bxU8kUAGnJQz2NigBWNHi663N/6EHl6foAspmlfr17iePdTDaeiZuoBO6X6Dka1eVdsLkuzkX vuBhbE6cIa5pizreA/dLe+0V+ViIRkhdTZYaoESez3OoER8xhsPNumjdP+CNYmQwDtDcuUFDn MkvwhgPO2xm4QPjyh+o5XY8b/cGURGs9ZYwIeon0/8EVxgJH1T5XMsziOhI728v8hS5Abj1ps quB2VsyNS8Hkf9FQYEDhezOOtruxdH+q0pfvg1vkXNQr/dZoT1ftbonuKyjz3GSQuqgei6fhl EmEjfWqRoAuYlAKhZ00c696QlPU= Received-SPF: pass client-ip=212.227.15.4; envelope-from=jakob.kirsch@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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/password-utils.scm (john-the-ripper-jumbo): Add patch to   fix compilation with GCC 11 and higher. ---  gnu/packages/password-utils.scm               | 198 ++++++++++--------  ...11-struct-allignment-incompatibility.patch |  50 +++++  2 files changed, 163 insertions(+), 85 deletions(-)  create mode 100644 gnu/packages/patches/john-the-ripper-jumbo-fix-gcc-11-struct-allignment-incompatibility.patch +++ b/gnu/packages/patches/john-the-ripper-jumbo-fix-gcc-11-struct-allignment-incompatibility.patch @@ -0,0 +1,50 @@ +From 154ee1156d62dd207aff0052b04c61796a1fde3b Mon Sep 17 00:00:00 2001 +From: Ferry Huberts +Date: Tue, 9 Mar 2021 22:04:46 +0100 +Subject: [PATCH] Fix alignment compile errors on GCC 11 + +Signed-off-by: Ferry Huberts +--- + src/blake2.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/blake2.h b/src/blake2.h +index b05208117e..b4398f9e13 100644 +--- a/src/blake2.h ++++ b/src/blake2.h +@@ -57,7 +57,7 @@ extern "C" { +     uint8_t  personal[BLAKE2S_PERSONALBYTES];  // 32 +   } blake2s_param; + +-  JTR_ALIGN( 64 ) typedef struct __blake2s_state ++  typedef struct JTR_ALIGN( 64 ) __blake2s_state +   { +     uint32_t h[8]; +     uint32_t t[2]; +@@ -82,7 +82,7 @@ extern "C" { +     uint8_t  personal[BLAKE2B_PERSONALBYTES];  // 64 +   } blake2b_param; + +-  JTR_ALIGN( 64 ) typedef struct __blake2b_state ++  typedef struct JTR_ALIGN( 64 ) __blake2b_state +   { +     uint64_t h[8]; +     uint64_t t[2]; +@@ -94,7 +94,7 @@ extern "C" { + #if defined(JOHN_NO_SIMD) || (!defined(__SSE2__) && !defined(__SSE4_1__) && !defined(__XOP__)) +   typedef struct __blake2sp_state + #else +-  JTR_ALIGN( 64 ) typedef struct __blake2sp_state ++  typedef struct JTR_ALIGN( 64 ) __blake2sp_state + #endif +   { +     blake2s_state S[8][1]; +@@ -106,7 +106,7 @@ extern "C" { + #if defined(JOHN_NO_SIMD) || (!defined(__SSE2__) && !defined(__SSE4_1__) && !defined(__XOP__)) +   typedef struct __blake2bp_state + #else +-  JTR_ALIGN( 64 ) typedef struct __blake2bp_state ++  typedef struct JTR_ALIGN( 64 ) __blake2bp_state + #endif +   { +     blake2b_state S[4][1]; base-commit: 5a293d0830aa9369e388d37fe767d5bf98af01b7 -- 2.41.0 diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index f4f172d159..d16af605d7 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -1173,95 +1173,123 @@ (define-public john-the-ripper-jumbo      (package        (name "john-the-ripper-jumbo")        (version (string-append official-version "-" jumbo-version)) -      (source -       (origin -         (method url-fetch) -         (uri (string-append "http://www.openwall.com/john/j/john-" -                             official-version "-jumbo-" jumbo-version ".tar.xz")) -         (sha256 -          (base32 - "0fvz3v41hnaiv1ggpxanfykyfjq79cwp9qcqqn63vic357w27lgm")))) +      (source (origin +                (method url-fetch) +                (uri (string-append "http://www.openwall.com/john/j/john-" +                                    official-version "-jumbo-" jumbo-version +                                    ".tar.xz")) +                (sha256 +                 (base32 + "0fvz3v41hnaiv1ggpxanfykyfjq79cwp9qcqqn63vic357w27lgm")) +                (patches (search-patches + "john-the-ripper-jumbo-fix-gcc-11-struct-allignment-incompatibility.patch"))))        (build-system gnu-build-system) -      (native-inputs -       (list perl)) -      (inputs -       (list gmp -             libpcap -             nss -             openssl -             python-wrapper -             ruby                       ; For genincstats.rb -             zlib)) +      (native-inputs (list perl)) +      (inputs (list gmp +                    libpcap +                    nss +                    openssl +                    python-wrapper +                    ruby ;For genincstats.rb +                    zlib))        (arguments -       `(#:configure-flags -         (list "--with-systemwide" -               ;; Do not test for instruction set in configure, and do not -               ;; pass '-march=native' to gcc: -               "--disable-native-tests" -               "--disable-native-march" -               ,(string-append -                 "--enable-simd=" -                 (let ((system (or (%current-target-system) -                                   (%current-system)))) -                   (cond -                    ((or (string-prefix? "x86_64" system) -                         (string-prefix? "i686" system)) "sse2") -                    ((string-prefix? "aarch" system) "neon") -                    (else "no"))))) -         #:phases -         (modify-phases %standard-phases -           (add-before 'configure 'chdir-src -             (lambda _ (chdir "src") #t)) -           (replace 'install -             (lambda _ -               (let ((bindir (string-append %output "/bin")) -                     (docdir (string-append %output "/share/doc/john")) -                     (execdir (string-append %output "/libexec/john")) -                     (datadir (string-append %output "/share/john")) -                     (install-file-to (lambda (dir) -                                        (lambda (f) (install-file f dir)))) -                     (symlink? (lambda (_ s) (eq? (stat:type s) 'symlink)))) -                 (with-directory-excursion "../run" -                   (for-each (install-file-to bindir) -                             (cons* -                              "john" "makechr" "cprepair" "SIPdump" "tgtsnarf" -                              "genmkvpwd" "mkvcalcproba" "calc_stat" "raw2dyna" -                              (find-files "." "(to|2)?john(-[^.]*)?$"))) -                   (for-each (lambda (f) ; Install symlinked aliases -                               (let ((tgt (string-append bindir "/" (basename f)))) -                                 ;; The use of install-file above dereferences -                                 ;; symlinks.  We'd rather have the symlinks -                                 ;; for clarity, so remove tgt before linking. -                                 (when (file-exists? tgt) (delete-file tgt)) -                                 (symlink "john" tgt))) -                             (find-files "." symlink?)) -                   (for-each (install-file-to execdir) -                             (cons* "mailer" "benchmark-unify" "relbench" -                                    (find-files "." ".*\\.js"))) -                   (for-each (lambda (f) -                               (let* ((base (basename f)) -                                      (name (substring base 0 (string-index base #\.))) -                                      (link (string-append bindir "/" name))) -                                 (install-file f execdir) -                                 (when (and (executable-file? f) -                                            (not (file-exists? link))) -                                   (symlink (string-append execdir "/" base) link)))) -                             (find-files "." ".*\\.(pl|py|rb|lua)")) -                   (for-each (install-file-to datadir) -                             (append (find-files "." "(stats|dictionary.*)") -                                     (find-files "." "(.*\\.chr|.*\\.lst)") -                                     (find-files "." ".*\\.conf"))) -                   (copy-recursively "rules" (string-append datadir "/rules"))) -                 (copy-recursively "../doc" docdir)))) -           (delete 'check) ; Tests need installed .conf files; move after install -           (add-after 'install 'check -             (lambda args -               (setenv "HOME" "/tmp")   ; Some tests need to write to ~/.john -               (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count))) -               (apply (assoc-ref %standard-phases 'check) args)))))) +       `(#:configure-flags (list "--with-systemwide" +                                 ;; Do not test for instruction set in configure, and do not +                                 ;; pass '-march=native' to gcc: +                                 "--disable-native-tests" +                                 "--disable-native-march" +                                 ,(string-append "--enable-simd=" +                                                 (let ((system (or (%current-target-system) + (%current-system)))) +                                                   (cond +                                                     ((or (string-prefix? +                                                           "x86_64" system) + (string-prefix? +                                                           "i686" system)) +                                                      "sse2") + ((string-prefix? "aarch" + system) +                                                      "neon") +                                                     (else "no"))))) +         #:phases (modify-phases %standard-phases +                    (add-before 'configure 'chdir-src +                      (lambda _ +                        (chdir "src") #t)) +                    (replace 'install +                      (lambda _ +                        (let ((bindir (string-append %output "/bin")) +                              (docdir (string-append %output "/share/doc/john")) +                              (execdir (string-append %output "/libexec/john")) +                              (datadir (string-append %output "/share/john")) +                              (install-file-to (lambda (dir) +                                                 (lambda (f) +                                                   (install-file f dir)))) +                              (symlink? (lambda (_ s) +                                          (eq? (stat:type s) +                                               'symlink)))) +                          (with-directory-excursion "../run" +                            (for-each (install-file-to bindir) +                                      (cons* "john" +                                             "makechr" +                                             "cprepair" +                                             "SIPdump" +                                             "tgtsnarf" +                                             "genmkvpwd" +                                             "mkvcalcproba" +                                             "calc_stat" +                                             "raw2dyna" +                                             (find-files "." + "(to|2)?john(-[^.]*)?$"))) +                            (for-each (lambda (f) +                                         ;Install symlinked aliases +                                        (let ((tgt (string-append bindir "/" + (basename f)))) +                                          ;; The use of install-file above dereferences +                                          ;; symlinks.  We'd rather have the symlinks +                                          ;; for clarity, so remove tgt before linking. +                                          (when (file-exists? tgt) +                                            (delete-file tgt)) +                                          (symlink "john" tgt))) +                                      (find-files "." symlink?)) +                            (for-each (install-file-to execdir) +                                      (cons* "mailer" "benchmark-unify" +                                             "relbench" +                                             (find-files "." ".*\\.js"))) +                            (for-each (lambda (f) +                                        (let* ((base (basename f)) +                                               (name (substring base 0 + (string-index + base #\.))) +                                               (link (string-append bindir "/" + name))) +                                          (install-file f execdir) +                                          (when (and (executable-file? f) +                                                     (not (file-exists? link))) +                                            (symlink (string-append execdir + "/" base) +                                                     link)))) +                                      (find-files "." ".*\\.(pl|py|rb|lua)")) +                            (for-each (install-file-to datadir) +                                      (append (find-files "." + "(stats|dictionary.*)") +                                              (find-files "." + "(.*\\.chr|.*\\.lst)") +                                              (find-files "." ".*\\.conf"))) +                            (copy-recursively "rules" +                                              (string-append datadir "/rules"))) +                          (copy-recursively "../doc" docdir)))) +                    (delete 'check) ;Tests need installed .conf files; move after install +                    (add-after 'install 'check +                      (lambda args +                        (setenv "HOME" "/tmp") ;Some tests need to write to ~/.john +                        (setenv "OMP_NUM_THREADS" +                                (number->string (parallel-job-count))) +                        (apply (assoc-ref %standard-phases +                                          'check) args))))))        (home-page "http://www.openwall.com/john/")        (synopsis "Password cracker") -      (description "John the Ripper is a fast password cracker. Its primary +      (description +       "John the Ripper is a fast password cracker.  Its primary  purpose is to detect weak Unix passwords.  Besides several @code{crypt}  password hash types most commonly found on various Unix systems, supported out  of the box are Windows LM hashes, plus lots of other hashes and ciphers.  This diff --git a/gnu/packages/patches/john-the-ripper-jumbo-fix-gcc-11-struct-allignment-incompatibility.patch b/gnu/packages/patches/john-the-ripper-jumbo-fix-gcc-11-struct-allignment-incompatibility.patch new file mode 100644 index 0000000000..58bff27d31 --- /dev/null