openssl-1.0.1-x32.patch (3273B)
1 http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=51bfed2e26fc13a66e8b5710aa2ce1d7a04af721 2 3 UpstreamStatus: Pending 4 5 Received from H J Liu @ Intel 6 Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors. 7 Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13 8 9 ported the patch to the 1.0.0e version 10 Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01 11 Index: openssl-1.0.0e/Configure 12 =================================================================== 13 --- openssl-1.0.0e.orig/Configure 14 +++ openssl-1.0.0e/Configure 15 @@ -393,6 +393,7 @@ my %table=( 16 "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -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)", 17 "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)", 18 "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -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", 19 +"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)", 20 "dist", "cc:-O::(unknown)::::::", 21 22 # Basic configs that should work on any (32 and less bit) box 23 Index: openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c 24 =================================================================== 25 --- openssl-1.0.0e.orig/crypto/bn/asm/x86_64-gcc.c 26 +++ openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c 27 @@ -55,7 +55,7 @@ 28 * machine. 29 */ 30 31 -#ifdef _WIN64 32 +#if defined _WIN64 || !defined __LP64__ 33 #define BN_ULONG unsigned long long 34 #else 35 #define BN_ULONG unsigned long 36 @@ -192,9 +192,9 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con 37 asm ( 38 " subq %2,%2 \n" 39 ".p2align 4 \n" 40 - "1: movq (%4,%2,8),%0 \n" 41 - " adcq (%5,%2,8),%0 \n" 42 - " movq %0,(%3,%2,8) \n" 43 + "1: movq (%q4,%2,8),%0 \n" 44 + " adcq (%q5,%2,8),%0 \n" 45 + " movq %0,(%q3,%2,8) \n" 46 " leaq 1(%2),%2 \n" 47 " loop 1b \n" 48 " sbbq %0,%0 \n" 49 @@ -215,9 +215,9 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con 50 asm ( 51 " subq %2,%2 \n" 52 ".p2align 4 \n" 53 - "1: movq (%4,%2,8),%0 \n" 54 - " sbbq (%5,%2,8),%0 \n" 55 - " movq %0,(%3,%2,8) \n" 56 + "1: movq (%q4,%2,8),%0 \n" 57 + " sbbq (%q5,%2,8),%0 \n" 58 + " movq %0,(%q3,%2,8) \n" 59 " leaq 1(%2),%2 \n" 60 " loop 1b \n" 61 " sbbq %0,%0 \n" 62 Index: openssl-1.0.0e/crypto/bn/bn.h 63 =================================================================== 64 --- openssl-1.0.0e.orig/crypto/bn/bn.h 65 +++ openssl-1.0.0e/crypto/bn/bn.h 66 @@ -172,6 +172,13 @@ extern "C" { 67 # endif 68 #endif 69 70 +/* Address type. */ 71 +#ifdef _WIN64 72 +#define BN_ADDR unsigned long long 73 +#else 74 +#define BN_ADDR unsigned long 75 +#endif 76 + 77 /* assuming long is 64bit - this is the DEC Alpha 78 * unsigned long long is only 64 bits :-(, don't define 79 * BN_LLONG for the DEC Alpha */