[OE-core] [PATCH 13/16] nss: fix for x32

Christopher Larson kergoth at gmail.com
Thu Jan 5 19:46:25 UTC 2017


From: Christopher Larson <chris_larson at mentor.com>

This was casting to a pointer, and the pointer sizes are 32-bit on X32, not
64-bit. Adjust as appropriate.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 .../nss/nss/Fix-compilation-for-X32.patch          | 31 ++++++++++++++++++++++
 meta/recipes-support/nss/nss_3.27.1.bb             |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch

diff --git a/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch b/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
new file mode 100644
index 0000000..f7f2c21
--- /dev/null
+++ b/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
@@ -0,0 +1,31 @@
+From c8eadfcdfbc1d5a4799e9a264b0f859cb5954c05 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson at mentor.com>
+Date: Tue, 13 Dec 2016 11:40:47 -0700
+Subject: [PATCH 7/7] Fix compilation for X32
+
+X32 uses 32-bit pointers, not 64-bit.
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+---
+ nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+index 2a3301e..d4ade41 100644
+--- a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
++++ b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+@@ -87,7 +87,11 @@ static poly1305_state_internal INLINE
+     *
+     poly1305_aligned_state(poly1305_state *state)
+ {
++#ifdef __ILP32__
++    return (poly1305_state_internal *)(((uint32_t)state + 63) & ~63);
++#else
+     return (poly1305_state_internal *)(((uint64_t)state + 63) & ~63);
++#endif
+ }
+ 
+ /* copy 0-63 bytes */
+-- 
+2.8.0
+
diff --git a/meta/recipes-support/nss/nss_3.27.1.bb b/meta/recipes-support/nss/nss_3.27.1.bb
index 0917938..0b4b5f9 100644
--- a/meta/recipes-support/nss/nss_3.27.1.bb
+++ b/meta/recipes-support/nss/nss_3.27.1.bb
@@ -22,6 +22,7 @@ SRC_URI = "\
     file://nss-fix-nsinstall-build.patch \
     file://disable-Wvarargs-with-clang.patch \
     file://pqg.c-ULL_addend.patch \
+    file://Fix-compilation-for-X32.patch \
     file://nss.pc.in \
     file://signlibs.sh \
 "
-- 
2.8.0




More information about the Openembedded-core mailing list