Skip to content

Commit

Permalink
john-jumbo: fix build with clang under superenv
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Feb 10, 2014
1 parent 488a96e commit fe96fdc
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions Formula/john-jumbo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class JohnJumbo < Formula

def patches
[
DATA, # Taken from MacPorts, tells john where to find runtime files
"http://www.openwall.com/john/g/john-1.7.9-jumbo-7.diff.gz" # Jumbo
"http://www.openwall.com/john/g/john-1.7.9-jumbo-7.diff.gz", # Jumbo
# First patch taken from MacPorts, tells john where to find runtime files
# Second patch protects against a redefinition of _mm_testz_si128 which
# tanked the build in clang;
# see https://github.com/Homebrew/homebrew/issues/26531
DATA
]
end

Expand All @@ -19,11 +23,6 @@ def patches
cause "Don't remember, but adding this to whitelist 2336."
end

fails_with :clang do
build 425
cause "rawSHA1_ng_fmt.c:535:19: error: redefinition of '_mm_testz_si128'"
end

def install
ENV.deparallelize
arch = MacOS.prefer_64_bit? ? '64' : 'sse2'
Expand Down Expand Up @@ -78,3 +77,17 @@ def install
#endif
#define JOHN_PRIVATE_HOME "~/.john"
#endif

diff --git a/src/rawSHA1_ng_fmt.c b/src/rawSHA1_ng_fmt.c
index 5f89cda..6cbd550 100644
--- a/src/rawSHA1_ng_fmt.c
+++ b/src/rawSHA1_ng_fmt.c
@@ -530,7 +530,7 @@ static void sha1_fmt_crypt_all(int count)

#if defined(__SSE4_1__)

-# if !defined(__INTEL_COMPILER)
+# if !defined(__INTEL_COMPILER) && !defined(__clang__)
// This intrinsic is not always available in GCC, so define it here.
static inline int _mm_testz_si128 (__m128i __M, __m128i __V)
{

0 comments on commit fe96fdc

Please sign in to comment.