From fe96fdcdb0cada8724b6f41c6718c4d050d72d49 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 9 Feb 2014 21:04:44 -0800 Subject: [PATCH] john-jumbo: fix build with clang under superenv Fixes Homebrew/homebrew#26531. --- Formula/john-jumbo.rb | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Formula/john-jumbo.rb b/Formula/john-jumbo.rb index 9af025b233..58dbe4205c 100644 --- a/Formula/john-jumbo.rb +++ b/Formula/john-jumbo.rb @@ -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 @@ -19,11 +23,6 @@ class JohnJumbo < Formula 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' @@ -78,3 +77,17 @@ __END__ #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) + {