GNU bug report logs - #64994
[PATCH] gnu: john-the-ripper-jumbo: Fix compilation with GCC 11+.

Previous Next

Package: guix-patches;

Reported by: Jakob Kirsch <jakob.kirsch <at> web.de>

Date: Tue, 1 Aug 2023 15:25:01 UTC

Severity: normal

Tags: patch

Done: Guillaume Le Vaillant <glv <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64994 in the body.
You can then email your comments to 64994 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#64994; Package guix-patches. (Tue, 01 Aug 2023 15:25:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakob Kirsch <jakob.kirsch <at> web.de>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 01 Aug 2023 15:25:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakob Kirsch <jakob.kirsch <at> web.de>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: john-the-ripper-jumbo: Fix compilation with GCC 11+.
Date: Tue, 1 Aug 2023 17:24:38 +0200
* 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

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
+++ 
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 <ferry.huberts <at> pelagic.nl>
+Date: Tue, 9 Mar 2021 22:04:46 +0100
+Subject: [PATCH] Fix alignment compile errors on GCC 11
+
+Signed-off-by: Ferry Huberts <ferry.huberts <at> pelagic.nl>
+---
+ 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

Reply sent to Guillaume Le Vaillant <glv <at> posteo.net>:
You have taken responsibility. (Wed, 02 Aug 2023 13:02:02 GMT) Full text and rfc822 format available.

Notification sent to Jakob Kirsch <jakob.kirsch <at> web.de>:
bug acknowledged by developer. (Wed, 02 Aug 2023 13:02:02 GMT) Full text and rfc822 format available.

Message #10 received at 64994-done <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Jakob Kirsch <jakob.kirsch <at> web.de>
Cc: 64994-done <at> debbugs.gnu.org
Subject: Re: [bug#64994] [PATCH] gnu: john-the-ripper-jumbo: Fix compilation
 with GCC 11+.
Date: Wed, 02 Aug 2023 12:55:07 +0000
[Message part 1 (text/plain, inline)]
Hi.
It looks like your e-mail client mangled your patch by cutting some
lines. If you can't set it not to do that, you could also sent a patch
as an attached file to the e-mail.
I was able to recover the main change of your patch, and I also added
the registration of the new patch file to 'local.mk'.
Applied as 6ccfa48d83b9c513b40835ae0c5896102b4dd915.
Thanks.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 31 Aug 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.