Skip to content

Commit

Permalink
Patch libgcrypt to compile with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNielsen committed Apr 19, 2012
1 parent 4f690fb commit 1753f5f
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/libgcrypt.py
Expand Up @@ -11,5 +11,11 @@ def __init__ (self):
self.version = '1.4.6'

self.sources = ['ftp://ftp.gnupg.org/gcrypt/%{name}/%{name}-%{version}.tar.bz2']

self.sources.extend (['patches/libgcrypt-asm.patch'])

def prep (self):
Package.prep (self)
if Package.profile.name == 'darwin':
for p in range (1, len (self.sources)):
self.sh ('patch -p0 < "%{sources[' + str (p) + ']}"')
LibgcryptPackage ()
93 changes: 93 additions & 0 deletions packages/patches/libgcrypt-asm.patch
@@ -0,0 +1,93 @@
--- cipher/rijndael.c.orig 2011-08-19 09:16:14.000000000 -0700
+++ cipher/rijndael.c 2011-08-19 09:19:01.000000000 -0700
@@ -730,13 +730,13 @@
"movdqa 0x90(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xa0(%%esi), %%xmm1\n\t"
- "cmp $10, %[rounds]\n\t"
+ "cmpl $10, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xb0(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xc0(%%esi), %%xmm1\n\t"
- "cmp $12, %[rounds]\n\t"
+ "cmpl $12, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xd0(%%esi), %%xmm1\n\t"
@@ -785,13 +785,13 @@
"movdqa 0x90(%%esi), %%xmm1\n\t"
aesdec_xmm1_xmm0
"movdqa 0xa0(%%esi), %%xmm1\n\t"
- "cmp $10, %[rounds]\n\t"
+ "cmpl $10, %[rounds]\n\t"
"jz .Ldeclast%=\n\t"
aesdec_xmm1_xmm0
"movdqa 0xb0(%%esi), %%xmm1\n\t"
aesdec_xmm1_xmm0
"movdqa 0xc0(%%esi), %%xmm1\n\t"
- "cmp $12, %[rounds]\n\t"
+ "cmpl $12, %[rounds]\n\t"
"jz .Ldeclast%=\n\t"
aesdec_xmm1_xmm0
"movdqa 0xd0(%%esi), %%xmm1\n\t"
@@ -844,13 +844,13 @@
"movdqa 0x90(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xa0(%%esi), %%xmm1\n\t"
- "cmp $10, %[rounds]\n\t"
+ "cmpl $10, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xb0(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xc0(%%esi), %%xmm1\n\t"
- "cmp $12, %[rounds]\n\t"
+ "cmpl $12, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xd0(%%esi), %%xmm1\n\t"
@@ -862,7 +862,7 @@
"movdqu %[src], %%xmm1\n\t" /* Save input. */
"pxor %%xmm1, %%xmm0\n\t" /* xmm0 = input ^ IV */

- "cmp $1, %[decrypt]\n\t"
+ "cmpl $1, %[decrypt]\n\t"
"jz .Ldecrypt_%=\n\t"
"movdqa %%xmm0, %[iv]\n\t" /* [encrypt] Store IV. */
"jmp .Lleave_%=\n"
@@ -923,13 +923,13 @@
"movdqa 0x90(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xa0(%%esi), %%xmm1\n\t"
- "cmp $10, %[rounds]\n\t"
+ "cmpl $10, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xb0(%%esi), %%xmm1\n\t"
aesenc_xmm1_xmm0
"movdqa 0xc0(%%esi), %%xmm1\n\t"
- "cmp $12, %[rounds]\n\t"
+ "cmpl $12, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
"movdqa 0xd0(%%esi), %%xmm1\n\t"
@@ -1050,7 +1050,7 @@
aesenc_xmm1_xmm3
aesenc_xmm1_xmm4
"movdqa 0xa0(%%esi), %%xmm1\n\t"
- "cmp $10, %[rounds]\n\t"
+ "cmpl $10, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
aesenc_xmm1_xmm2
@@ -1062,7 +1062,7 @@
aesenc_xmm1_xmm3
aesenc_xmm1_xmm4
"movdqa 0xc0(%%esi), %%xmm1\n\t"
- "cmp $12, %[rounds]\n\t"
+ "cmpl $12, %[rounds]\n\t"
"jz .Lenclast%=\n\t"
aesenc_xmm1_xmm0
aesenc_xmm1_xmm2

0 comments on commit 1753f5f

Please sign in to comment.