diff mbox series

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

Message ID abd28e94-8aa8-eb99-c97e-af17ea759503@web.de
State New
Headers show
Series [bug#64994] gnu: john-the-ripper-jumbo: Fix compilation with GCC 11+. | expand

Commit Message

Jakob Kirsch Aug. 1, 2023, 3:24 p.m. UTC
* 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 <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

Comments

Guillaume Le Vaillant Aug. 2, 2023, 12:55 p.m. UTC | #1
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.
diff mbox series

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