summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
blob: 80b86908e5c11d1b8cdd376db45e4bab96e79939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From c8eadfcdfbc1d5a4799e9a264b0f859cb5954c05 Mon Sep 17 00:00:00 2001
From: Christopher Larson <chris_larson@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@mentor.com>

Upstream-Status: Pending
---
 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