summarylogtreecommitdiffstats
path: root/openssl-1.0.1-x32.patch
blob: cfdeccdca3622792963a6111808fbb556d1486dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=51bfed2e26fc13a66e8b5710aa2ce1d7a04af721

UpstreamStatus: Pending

Received from H J Liu @ Intel
Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13

ported the patch to the 1.0.0e version
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
Index: openssl-1.0.2a/Configure
===================================================================
--- openssl-1.0.2a.orig/Configure
+++ openssl-1.0.2a/Configure
@@ -217,6 +217,7 @@ my %table=(
 "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
+"linux-x32",	"gcc:-DL_ENDIAN 	-DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "dist",		"cc:-O::(unknown)::::::",
 
 # Basic configs that should work on any (32 and less bit) box
Index: openssl-1.0.2a/crypto/bn/asm/x86_64-gcc.c
===================================================================
--- openssl-1.0.2a.orig/crypto/bn/asm/x86_64-gcc.c
+++ openssl-1.0.2a/crypto/bn/asm/x86_64-gcc.c
@@ -212,9 +212,9 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con
     asm volatile ("       subq    %0,%0           \n" /* clear carry */
                   "       jmp     1f              \n"
                   ".p2align 4                     \n"
-                  "1:     movq    (%4,%2,8),%0    \n"
-                  "       adcq    (%5,%2,8),%0    \n"
-                  "       movq    %0,(%3,%2,8)    \n"
+                  "1:     movq    (%q4,%2,8),%0   \n"
+                  "       adcq    (%q5,%2,8),%0   \n"
+                  "       movq    %0,(%q3,%2,8)   \n"
                   "       lea     1(%2),%2        \n"
                   "       loop    1b              \n"
                   "       sbbq    %0,%0           \n":"=&r" (ret), "+c"(n),
@@ -238,9 +238,9 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con
     asm volatile ("       subq    %0,%0           \n" /* clear borrow */
                   "       jmp     1f              \n"
                   ".p2align 4                     \n"
-                  "1:     movq    (%4,%2,8),%0    \n"
-                  "       sbbq    (%5,%2,8),%0    \n"
-                  "       movq    %0,(%3,%2,8)    \n"
+                  "1:     movq    (%q4,%2,8),%0   \n"
+                  "       sbbq    (%q5,%2,8),%0   \n"
+                  "       movq    %0,(%q3,%2,8)   \n"
                   "       lea     1(%2),%2        \n"
                   "       loop    1b              \n"
                   "       sbbq    %0,%0           \n":"=&r" (ret), "+c"(n),
Index: openssl-1.0.2a/crypto/bn/bn.h
===================================================================
--- openssl-1.0.2a.orig/crypto/bn/bn.h
+++ openssl-1.0.2a/crypto/bn/bn.h
@@ -173,6 +173,13 @@ extern "C" {
 #  endif
 # endif
 
+/* Address type.  */
+#ifdef _WIN64
+#define BN_ADDR unsigned long long
+#else
+#define BN_ADDR unsigned long
+#endif
+
 /*
  * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
  * 64 bits :-(, don't define BN_LLONG for the DEC Alpha