[PATCH] gnu: john-the-ripper-jumbo: Fix compilation with GCC 11+.

  • Done
  • quality assurance status badge
Details
2 participants
  • Guillaume Le Vaillant
  • Jakob Kirsch
Owner
unassigned
Submitted by
Jakob Kirsch
Severity
normal

Debbugs page

Jakob Kirsch wrote 2 years ago
(address . guix-patches@gnu.org)
abd28e94-8aa8-eb99-c97e-af17ea759503@web.de
* 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
Toggle diff (316 lines)
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@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@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
Guillaume Le Vaillant wrote 2 years ago
(name . Jakob Kirsch)(address . jakob.kirsch@web.de)(address . 64994-done@debbugs.gnu.org)
874jlh4mza.fsf@kitej
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.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCZMpTqQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8BzAD/UXx5JfI1ASIjEFncO/BqymTXme79qtLGoq7x
UxjUOYsA/28OQFdgnTb2KvvXNfJ3LwjomaDgX5fsfYcMSVYi7mmM
=iLhg
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 64994@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64994
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help