openssl: Backport upstreamed version of patch to fix build on mips64

Submitted by Khem Raj on May 28, 2015, 4:51 a.m. | Patch ID: 94321

Details

Message ID 1432788715-22140-1-git-send-email-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj May 28, 2015, 4:51 a.m.
Previous patch had a concern as well and this is a direct backport of
the patch fixing the problem.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ine-GCC_VERSION-macro-to-cover-upto-gcc-5.patch | 53 ----------------------
 ...lcl.h-fix-MIPS-specific-gcc-version-check.patch | 30 ++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2a.bb |  2 +-
 3 files changed, 31 insertions(+), 54 deletions(-)
 delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch
 create mode 100644 meta/recipes-connectivity/openssl/openssl/0001-bn-bn_lcl.h-fix-MIPS-specific-gcc-version-check.patch

Patch hide | download patch | download mbox

diff --git a/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch
deleted file mode 100644
index 46d1adf..0000000
--- a/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch
+++ /dev/null
@@ -1,53 +0,0 @@ 
-From 0aa68f7681a74f6ff80a80c5843bc35e5effffb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 22 May 2015 12:43:39 -0700
-Subject: [PATCH] Define GCC_VERSION macro to cover upto gcc-5
-
-Current check is limited to gcc 4 with minor versions
-but when we use gcc 5.1, then minor version check fails
-with current setup and we end up with build errors like
-
-| In file included from bn_div.c:62:0:
-| bn_div.c: In function 'BN_div':
-| bn_lcl.h:311:9: error: impossible constraint in 'asm'
-|          asm ("dmultu    %2,%3"          \
-|          ^
-| bn_div.c:402:13: note: in expansion of macro 'BN_UMULT_LOHI'
-|              BN_UMULT_LOHI(t2l, t2h, d1, q);
-|              ^
-| <builtin>: recipe for target 'bn_div.o' failed
-| make[2]: *** [bn_div.o] Error 1
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
-Upstream-Status: [Submitted]
- crypto/bn/bn_lcl.h | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h
-index 196df7e..e801ba7 100644
---- a/crypto/bn/bn_lcl.h
-+++ b/crypto/bn/bn_lcl.h
-@@ -118,6 +118,9 @@
- extern "C" {
- #endif
- 
-+#define GCC_VERSION (__GNUC__ * 10000 \
-+                     + __GNUC_MINOR__ * 100 \
-+                     + __GNUC_PATCHLEVEL__)
- /*-
-  * Bignum consistency macros
-  * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from
-@@ -443,7 +446,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
- #   endif
- #  elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
- #   if defined(__GNUC__) && __GNUC__>=2
--#    if __GNUC__>=4 && __GNUC_MINOR__>=4
-+#    if GCC_VERSION > 40400
-                                      /* "h" constraint is no more since 4.4 */
- #     define BN_UMULT_HIGH(a,b)          (((__uint128_t)(a)*(b))>>64)
- #     define BN_UMULT_LOHI(low,high,a,b) ({     \
--- 
-2.1.4
-
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-bn-bn_lcl.h-fix-MIPS-specific-gcc-version-check.patch b/meta/recipes-connectivity/openssl/openssl/0001-bn-bn_lcl.h-fix-MIPS-specific-gcc-version-check.patch
new file mode 100644
index 0000000..7308f8f
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/0001-bn-bn_lcl.h-fix-MIPS-specific-gcc-version-check.patch
@@ -0,0 +1,30 @@ 
+From 60c268b21ac81cc6b1af5c5470282a613b96f6fd Mon Sep 17 00:00:00 2001
+From: Andy Polyakov <appro@openssl.org>
+Date: Mon, 25 May 2015 10:17:14 +0200
+Subject: [PATCH] bn/bn_lcl.h: fix MIPS-specific gcc version check.
+
+RT#3859
+
+Reviewed-by: Tim Hudson <tjh@openssl.org>
+---
+Upstream-Status: Backport
+
+ crypto/bn/bn_lcl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h
+index 196df7e..b9d124a 100644
+--- a/crypto/bn/bn_lcl.h
++++ b/crypto/bn/bn_lcl.h
+@@ -443,7 +443,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
+ #   endif
+ #  elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
+ #   if defined(__GNUC__) && __GNUC__>=2
+-#    if __GNUC__>=4 && __GNUC_MINOR__>=4
++#    if __GNUC__>4 || (__GNUC__>=4 && __GNUC_MINOR__>=4)
+                                      /* "h" constraint is no more since 4.4 */
+ #     define BN_UMULT_HIGH(a,b)          (((__uint128_t)(a)*(b))>>64)
+ #     define BN_UMULT_LOHI(low,high,a,b) ({     \
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb
index 5e767c3..f4006f6 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb
@@ -36,7 +36,7 @@  SRC_URI += "file://configure-targets.patch \
             file://ptest-deps.patch \
             file://run-ptest \
             file://crypto_use_bigint_in_x86-64_perl.patch \
-            file://0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch \
+            file://0001-bn-bn_lcl.h-fix-MIPS-specific-gcc-version-check.patch \
            "
 
 SRC_URI[md5sum] = "a06c547dac9044161a477211049f60ef"