diff options
| author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2011-12-02 12:20:01 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-05 22:47:06 +0000 |
| commit | 51bfed2e26fc13a66e8b5710aa2ce1d7a04af721 (patch) | |
| tree | 367b464b50cb25036b39e59891eda6be6467a83e | |
| parent | 4eaa9ffa3f934615dc18580640c74b3e51f93e17 (diff) | |
| download | poky-51bfed2e26fc13a66e8b5710aa2ce1d7a04af721.tar.gz | |
openssl-1.0.0e: fix to wotk with x32 toolchain
Add BN_ADDR for address type instead of using BN_ULONG or unsigned long:
1. For W64, address type is unsigned long long, not unsigned long.
2. For x32, address type is unsigned long , not BN_ULONG.
Added a new targetlinux-x32 in the config file
The do_install() code to move lib/* to lib64 is not needed now with the
enhanced multilib support.
Make the x86-64 assembly syntax compatible with x32 compiler.
(From OE-Core rev: 340c14ac49afa1559c12f8848bef9b6ecf24ef35)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 98 insertions, 10 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.0e/openssl_fix_for_x32.patch b/meta/recipes-connectivity/openssl/openssl-1.0.0e/openssl_fix_for_x32.patch new file mode 100644 index 0000000000..10de9868dd --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl-1.0.0e/openssl_fix_for_x32.patch | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | UpstreamStatus: Pending | ||
| 2 | |||
| 3 | Received from H J Liu @ Intel | ||
| 4 | Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors. | ||
| 5 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13 | ||
| 6 | |||
| 7 | ported the patch to the 1.0.0e version | ||
| 8 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01 | ||
| 9 | Index: openssl-1.0.0e/Configure | ||
| 10 | =================================================================== | ||
| 11 | --- openssl-1.0.0e.orig/Configure | ||
| 12 | +++ openssl-1.0.0e/Configure | ||
| 13 | @@ -393,6 +393,7 @@ my %table=( | ||
| 14 | "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -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)", | ||
| 15 | "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -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)", | ||
| 16 | "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-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", | ||
| 17 | +"linux-x32", "gcc:-DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS::-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)", | ||
| 18 | "linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | ||
| 19 | #### SPARC Linux setups | ||
| 20 | # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently | ||
| 21 | Index: openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c | ||
| 22 | =================================================================== | ||
| 23 | --- openssl-1.0.0e.orig/crypto/bn/asm/x86_64-gcc.c | ||
| 24 | +++ openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c | ||
| 25 | @@ -55,7 +55,7 @@ | ||
| 26 | * machine. | ||
| 27 | */ | ||
| 28 | |||
| 29 | -#ifdef _WIN64 | ||
| 30 | +#if defined _WIN64 || !defined __LP64__ | ||
| 31 | #define BN_ULONG unsigned long long | ||
| 32 | #else | ||
| 33 | #define BN_ULONG unsigned long | ||
| 34 | @@ -192,9 +192,9 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con | ||
| 35 | asm ( | ||
| 36 | " subq %2,%2 \n" | ||
| 37 | ".p2align 4 \n" | ||
| 38 | - "1: movq (%4,%2,8),%0 \n" | ||
| 39 | - " adcq (%5,%2,8),%0 \n" | ||
| 40 | - " movq %0,(%3,%2,8) \n" | ||
| 41 | + "1: movq (%q4,%2,8),%0 \n" | ||
| 42 | + " adcq (%q5,%2,8),%0 \n" | ||
| 43 | + " movq %0,(%q3,%2,8) \n" | ||
| 44 | " leaq 1(%2),%2 \n" | ||
| 45 | " loop 1b \n" | ||
| 46 | " sbbq %0,%0 \n" | ||
| 47 | @@ -215,9 +215,9 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con | ||
| 48 | asm ( | ||
| 49 | " subq %2,%2 \n" | ||
| 50 | ".p2align 4 \n" | ||
| 51 | - "1: movq (%4,%2,8),%0 \n" | ||
| 52 | - " sbbq (%5,%2,8),%0 \n" | ||
| 53 | - " movq %0,(%3,%2,8) \n" | ||
| 54 | + "1: movq (%q4,%2,8),%0 \n" | ||
| 55 | + " sbbq (%q5,%2,8),%0 \n" | ||
| 56 | + " movq %0,(%q3,%2,8) \n" | ||
| 57 | " leaq 1(%2),%2 \n" | ||
| 58 | " loop 1b \n" | ||
| 59 | " sbbq %0,%0 \n" | ||
| 60 | Index: openssl-1.0.0e/crypto/bn/bn.h | ||
| 61 | =================================================================== | ||
| 62 | --- openssl-1.0.0e.orig/crypto/bn/bn.h | ||
| 63 | +++ openssl-1.0.0e/crypto/bn/bn.h | ||
| 64 | @@ -172,6 +172,13 @@ extern "C" { | ||
| 65 | # endif | ||
| 66 | #endif | ||
| 67 | |||
| 68 | +/* Address type. */ | ||
| 69 | +#ifdef _WIN64 | ||
| 70 | +#define BN_ADDR unsigned long long | ||
| 71 | +#else | ||
| 72 | +#define BN_ADDR unsigned long | ||
| 73 | +#endif | ||
| 74 | + | ||
| 75 | /* assuming long is 64bit - this is the DEC Alpha | ||
| 76 | * unsigned long long is only 64 bits :-(, don't define | ||
| 77 | * BN_LLONG for the DEC Alpha */ | ||
| 78 | Index: openssl-1.0.0e/crypto/bn/bn_exp.c | ||
| 79 | =================================================================== | ||
| 80 | --- openssl-1.0.0e.orig/crypto/bn/bn_exp.c | ||
| 81 | +++ openssl-1.0.0e/crypto/bn/bn_exp.c | ||
| 82 | @@ -561,7 +561,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU | ||
| 83 | |||
| 84 | /* Given a pointer value, compute the next address that is a cache line multiple. */ | ||
| 85 | #define MOD_EXP_CTIME_ALIGN(x_) \ | ||
| 86 | - ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ULONG)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) | ||
| 87 | + ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ADDR)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) | ||
| 88 | |||
| 89 | /* This variant of BN_mod_exp_mont() uses fixed windows and the special | ||
| 90 | * precomputation memory layout to limit data-dependency to a minimum | ||
diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc index c717fee514..771f146af9 100644 --- a/meta/recipes-connectivity/openssl/openssl.inc +++ b/meta/recipes-connectivity/openssl/openssl.inc | |||
| @@ -82,6 +82,12 @@ do_configure () { | |||
| 82 | linux-i686) | 82 | linux-i686) |
| 83 | target=debian-i386-i686/cmov | 83 | target=debian-i386-i686/cmov |
| 84 | ;; | 84 | ;; |
| 85 | linux-gnux32-x86_64) | ||
| 86 | target=linux-x32 | ||
| 87 | ;; | ||
| 88 | linux-gnu64-x86_64) | ||
| 89 | target=linux-x86_64 | ||
| 90 | ;; | ||
| 85 | linux-mips) | 91 | linux-mips) |
| 86 | target=debian-mips | 92 | target=debian-mips |
| 87 | ;; | 93 | ;; |
| @@ -123,15 +129,6 @@ do_compile () { | |||
| 123 | do_install () { | 129 | do_install () { |
| 124 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install | 130 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install |
| 125 | 131 | ||
| 126 | # On x86_64, move lib/* to lib64 | ||
| 127 | if [ "${libdir}" != "${prefix}/lib" ] | ||
| 128 | then | ||
| 129 | install -m 0755 ${D}${libdir} ${D}${libdir}/pkgconfig | ||
| 130 | mv ${D}${prefix}/lib/lib* ${D}${libdir} | ||
| 131 | mv ${D}${prefix}/lib/pkgconfig/*.pc ${D}${libdir}/pkgconfig | ||
| 132 | chmod 644 ${D}${libdir}/pkgconfig/openssl.pc | ||
| 133 | fi | ||
| 134 | |||
| 135 | oe_libinstall -so libcrypto ${D}${libdir} | 132 | oe_libinstall -so libcrypto ${D}${libdir} |
| 136 | oe_libinstall -so libssl ${D}${libdir} | 133 | oe_libinstall -so libssl ${D}${libdir} |
| 137 | 134 | ||
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.0e.bb b/meta/recipes-connectivity/openssl/openssl_1.0.0e.bb index 38f38e3477..e29740b14e 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.0e.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.0e.bb | |||
| @@ -6,7 +6,7 @@ DEPENDS += "ocf-linux" | |||
| 6 | 6 | ||
| 7 | CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" | 7 | CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" |
| 8 | 8 | ||
| 9 | PR = "${INC_PR}.0" | 9 | PR = "${INC_PR}.2" |
| 10 | 10 | ||
| 11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" | 11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" |
| 12 | 12 | ||
| @@ -29,6 +29,7 @@ SRC_URI += "file://configure-targets.patch \ | |||
| 29 | file://debian/pkg-config.patch \ | 29 | file://debian/pkg-config.patch \ |
| 30 | file://debian/no-symbolic.patch \ | 30 | file://debian/no-symbolic.patch \ |
| 31 | file://debian/debian-targets.patch \ | 31 | file://debian/debian-targets.patch \ |
| 32 | file://openssl_fix_for_x32.patch \ | ||
| 32 | " | 33 | " |
| 33 | 34 | ||
| 34 | SRC_URI[md5sum] = "7040b89c4c58c7a1016c0dfa6e821c86" | 35 | SRC_URI[md5sum] = "7040b89c4c58c7a1016c0dfa6e821c86" |
