summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch b/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
new file mode 100644
index 0000000000..ab1434a0e7
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
@@ -0,0 +1,97 @@
1Upstream-Status: Pending
2
3Received from H J Liu @ Intel
4Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13
6
7ported the patch to the 1.0.0e version
8Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
9
10ported the patch to the 1.0.0m version
11Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> 2015/03/24
12Index: openssl-1.0.1e/Configure
13===================================================================
14--- openssl-1.0.1e.orig/Configure
15+++ openssl-1.0.1e/Configure
16@@ -402,6 +402,7 @@ my %table=(
17 "linux-ia64-ecc","ecc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
18 "linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
19 "linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -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",
20+"linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall -DMD32_REG_T=int::-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):::x32",
21 "linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
22 #### So called "highgprs" target for z/Architecture CPUs
23 # "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
24Index: openssl-1.0.1e/crypto/bn/asm/x86_64-gcc.c
25===================================================================
26--- openssl-1.0.1e.orig/crypto/bn/asm/x86_64-gcc.c
27+++ openssl-1.0.1e/crypto/bn/asm/x86_64-gcc.c
28@@ -55,7 +55,7 @@
29 * machine.
30 */
31
32-# ifdef _WIN64
33+# if defined _WIN64 || !defined __LP64__
34 # define BN_ULONG unsigned long long
35 # else
36 # define BN_ULONG unsigned long
37Index: openssl-1.0.1e/crypto/bn/bn.h
38===================================================================
39--- openssl-1.0.1e.orig/crypto/bn/bn.h
40+++ openssl-1.0.1e/crypto/bn/bn.h
41@@ -173,6 +173,13 @@ extern "C" {
42 # endif
43 # endif
44
45+/* Address type. */
46+# ifdef _WIN64
47+# define BN_ADDR unsigned long long
48+# else
49+# define BN_ADDR unsigned long
50+# endif
51+
52 /*
53 * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
54 * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
55Index: openssl-1.0.1e/crypto/bn/asm/x86_64-gcc.c
56===================================================================
57--- openssl-1.0.1m/crypto/bn/asm/x86_64-gcc.c 2015-03-19 13:37:10.000000000 +0000
58+++ openssl-1.0.1m-modif/crypto/bn/asm/x86_64-gcc.c 2015-04-14 17:09:11.876533194 +0100
59@@ -211,9 +211,9 @@
60
61 asm volatile (" subq %2,%2 \n"
62 ".p2align 4 \n"
63- "1: movq (%4,%2,8),%0 \n"
64- " adcq (%5,%2,8),%0 \n"
65- " movq %0,(%3,%2,8) \n"
66+ "1: movq (%q4,%2,8),%0 \n"
67+ " adcq (%q5,%2,8),%0 \n"
68+ " movq %0,(%q3,%2,8) \n"
69 " leaq 1(%2),%2 \n"
70 " loop 1b \n"
71 " sbbq %0,%0 \n":"=&a" (ret), "+c"(n),
72@@ -235,9 +235,9 @@
73
74 asm volatile (" subq %2,%2 \n"
75 ".p2align 4 \n"
76- "1: movq (%4,%2,8),%0 \n"
77- " sbbq (%5,%2,8),%0 \n"
78- " movq %0,(%3,%2,8) \n"
79+ "1: movq (%q4,%2,8),%0 \n"
80+ " sbbq (%q5,%2,8),%0 \n"
81+ " movq %0,(%q3,%2,8) \n"
82 " leaq 1(%2),%2 \n"
83 " loop 1b \n"
84 " sbbq %0,%0 \n":"=&a" (ret), "+c"(n)
85Index: openssl-1.0.1e/crypto/bn/bn_exp.c
86===================================================================
87--- openssl-1.0.1e.orig/crypto/bn/bn_exp.c
88+++ openssl-1.0.1e/crypto/bn/bn_exp.c
89@@ -572,7 +572,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
90 * multiple.
91 */
92 #define MOD_EXP_CTIME_ALIGN(x_) \
93- ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
94+ ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ADDR)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
95
96 /*
97 * This variant of BN_mod_exp_mont() uses fixed windows and the special