summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-10-17 19:57:10 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-26 15:59:14 +0100
commit137d141ee39c5345755e79705266c686c3341b10 (patch)
tree28413926ee8de522288017475f390da4f739455e
parentc9fc9b9444c3a7617cd63c60d2f8ae81a64568e4 (diff)
downloadpoky-137d141ee39c5345755e79705266c686c3341b10.tar.gz
openssl: use linux-generic64 target for Aarch64 (LE and BE)
Update configure-targets.patch: - drop linux-aarch64 configuration Update do_configure(): - add linux-aarch64* case to cover linux-aarch64 and linux-aarch64_be - use linux-generic64 target in above case Backport initial-aarch64-bits.patch: - first order optimizations for Aarch64 (From OE-Core rev: 3252110ee5c8272a1f09563f2a794cac545e29d5) Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch13
-rw-r--r--meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch111
-rw-r--r--meta/recipes-connectivity/openssl/openssl.inc3
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.0.1e.bb1
4 files changed, 120 insertions, 8 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch b/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch
index 8c638b4795..c1f3d0878e 100644
--- a/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch
+++ b/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch
@@ -4,14 +4,12 @@ The number of colons are important :)
4 4
5 5
6--- 6---
7 Configure | 17 +++++++++++++++++ 7 Configure | 16 ++++++++++++++++
8 1 file changed, 17 insertions(+) 8 1 file changed, 16 insertions(+)
9 9
10Index: openssl-1.0.1e/Configure 10--- a/Configure
11=================================================================== 11+++ b/Configure
12--- openssl-1.0.1e.orig/Configure 12@@ -403,6 +403,22 @@ my %table=(
13+++ openssl-1.0.1e/Configure
14@@ -403,6 +403,23 @@ my %table=(
15 "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", 13 "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
16 "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", 14 "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
17 15
@@ -22,7 +20,6 @@ Index: openssl-1.0.1e/Configure
22+"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 20+"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
23+"linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 21+"linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
24+"linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 22+"linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
25+"linux-aarch64","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS::-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)",
26+ 23+
27+"linux-avr32","$ENV{'CC'}:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).", 24+"linux-avr32","$ENV{'CC'}:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).",
28+ 25+
diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch
new file mode 100644
index 0000000000..703b8c125b
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch
@@ -0,0 +1,111 @@
1From: Andy Polyakov <appro@openssl.org>
2Date: Sun, 13 Oct 2013 17:15:15 +0000 (+0200)
3Subject: Initial aarch64 bits.
4X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=039081b80977e2a5de84e1f88f8b4d025b559956
5
6Initial aarch64 bits.
7---
8 crypto/bn/bn_lcl.h | 9 +++++++++
9 crypto/md32_common.h | 18 ++++++++++++++++++
10 crypto/modes/modes_lcl.h | 8 ++++++++
11 crypto/sha/sha512.c | 13 +++++++++++++
12 4 files changed, 48 insertions(+)
13
14--- a/crypto/bn/bn_lcl.h
15+++ b/crypto/bn/bn_lcl.h
16@@ -300,6 +300,15 @@ extern "C" {
17 : "r"(a), "r"(b));
18 # endif
19 # endif
20+# elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG)
21+# if defined(__GNUC__) && __GNUC__>=2
22+# define BN_UMULT_HIGH(a,b) ({ \
23+ register BN_ULONG ret; \
24+ asm ("umulh %0,%1,%2" \
25+ : "=r"(ret) \
26+ : "r"(a), "r"(b)); \
27+ ret; })
28+# endif
29 # endif /* cpu */
30 #endif /* OPENSSL_NO_ASM */
31
32--- a/crypto/md32_common.h
33+++ b/crypto/md32_common.h
34@@ -213,6 +213,24 @@
35 asm ("bswapl %0":"=r"(r):"0"(r)); \
36 *((unsigned int *)(c))=r; (c)+=4; r; })
37 # endif
38+# elif defined(__aarch64__)
39+# if defined(__BYTE_ORDER__)
40+# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
41+# define HOST_c2l(c,l) ({ unsigned int r; \
42+ asm ("rev %w0,%w1" \
43+ :"=r"(r) \
44+ :"r"(*((const unsigned int *)(c))));\
45+ (c)+=4; (l)=r; })
46+# define HOST_l2c(l,c) ({ unsigned int r; \
47+ asm ("rev %w0,%w1" \
48+ :"=r"(r) \
49+ :"r"((unsigned int)(l)));\
50+ *((unsigned int *)(c))=r; (c)+=4; r; })
51+# elif defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
52+# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l))
53+# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
54+# endif
55+# endif
56 # endif
57 # endif
58 #endif
59--- a/crypto/modes/modes_lcl.h
60+++ b/crypto/modes/modes_lcl.h
61@@ -29,6 +29,7 @@ typedef unsigned char u8;
62 #if defined(__i386) || defined(__i386__) || \
63 defined(__x86_64) || defined(__x86_64__) || \
64 defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
65+ defined(__aarch64__) || \
66 defined(__s390__) || defined(__s390x__) || \
67 ( (defined(__arm__) || defined(__arm)) && \
68 (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
69@@ -53,6 +54,13 @@ typedef unsigned char u8;
70 # define BSWAP4(x) ({ u32 ret=(x); \
71 asm ("bswapl %0" \
72 : "+r"(ret)); ret; })
73+# elif defined(__aarch64__)
74+# define BSWAP8(x) ({ u64 ret; \
75+ asm ("rev %0,%1" \
76+ : "=r"(ret) : "r"(x)); ret; })
77+# define BSWAP4(x) ({ u32 ret; \
78+ asm ("rev %w0,%w1" \
79+ : "=r"(ret) : "r"(x)); ret; })
80 # elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT)
81 # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
82 asm ("rev %0,%0; rev %1,%1" \
83--- a/crypto/sha/sha512.c
84+++ b/crypto/sha/sha512.c
85@@ -55,6 +55,7 @@ const char SHA512_version[]="SHA-512" OP
86 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
87 defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \
88 defined(__s390__) || defined(__s390x__) || \
89+ defined(__aarch64__) || \
90 defined(SHA512_ASM)
91 #define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
92 #endif
93@@ -340,6 +341,18 @@ static const SHA_LONG64 K512[80] = {
94 asm ("rotrdi %0,%1,%2" \
95 : "=r"(ret) \
96 : "r"(a),"K"(n)); ret; })
97+# elif defined(__aarch64__)
98+# define ROTR(a,n) ({ SHA_LONG64 ret; \
99+ asm ("ror %0,%1,%2" \
100+ : "=r"(ret) \
101+ : "r"(a),"I"(n)); ret; })
102+# if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
103+ __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
104+# define PULL64(x) ({ SHA_LONG64 ret; \
105+ asm ("rev %0,%1" \
106+ : "=r"(ret) \
107+ : "r"(*((const SHA_LONG64 *)(&(x))))); ret; })
108+# endif
109 # endif
110 # elif defined(_MSC_VER)
111 # if defined(_WIN64) /* applies to both IA-64 and AMD64 */
diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc
index 78ff7ae2f1..b208eb0998 100644
--- a/meta/recipes-connectivity/openssl/openssl.inc
+++ b/meta/recipes-connectivity/openssl/openssl.inc
@@ -66,6 +66,9 @@ do_configure () {
66 linux-armeb) 66 linux-armeb)
67 target=linux-elf-armeb 67 target=linux-elf-armeb
68 ;; 68 ;;
69 linux-aarch64*)
70 target=linux-generic64
71 ;;
69 linux-sh3) 72 linux-sh3)
70 target=debian-sh3 73 target=debian-sh3
71 ;; 74 ;;
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb b/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb
index ac27dba494..a574e81fb3 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb
@@ -33,6 +33,7 @@ SRC_URI += "file://configure-targets.patch \
33 file://fix-cipher-des-ede3-cfb1.patch \ 33 file://fix-cipher-des-ede3-cfb1.patch \
34 file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \ 34 file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
35 file://openssl-avoid-NULL-pointer-dereference-in-dh_pub_encode.patch \ 35 file://openssl-avoid-NULL-pointer-dereference-in-dh_pub_encode.patch \
36 file://initial-aarch64-bits.patch \
36 file://find.pl \ 37 file://find.pl \
37 " 38 "
38 39