wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* [PATCH ARM] Compile on Raspberry Pi
@ 2018-08-28 22:22 Francis Booth
  2018-08-29  4:05 ` Jason A. Donenfeld
  2018-08-29  7:07 ` Emeka
  0 siblings, 2 replies; 4+ messages in thread
From: Francis Booth @ 2018-08-28 22:22 UTC (permalink / raw)
  To: wireguard

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

Attempting to build Wireguard on a Raspberry Pi will result in an
assembly error

    Error: immediate expression requires a # prefix -- `moveq r5,1'

(the full build error log can be found here: https://pastebin.com/CKTXwGyG)

Appending # to the values and telling ARM to treat them as literals
solves the issue.

I was able to test this patch out on my own Raspberry Pi 3B+ and can
confirm the resulting build is successfully able to build, create the
wg0 interface, generate a private key, connect to a peer, and send
encrypted messages back and forth.

justw and revel assisted in providing the fix via the Wireguard irc channel.


curve25519: arm: Compile on Raspi

diff --git a/src/crypto/curve25519-arm.S b/src/crypto/curve25519-arm.S
index cb40c24..f9d50e9 100644
--- a/src/crypto/curve25519-arm.S
+++ b/src/crypto/curve25519-arm.S
@@ -1554,35 +1554,35 @@ ENTRY(curve25519_neon)
 	movw		r4, 0
 	movw		r5, 2
 	cmp		r1, #1
-	moveq		r5, 1
+	moveq		r5, #1
 	addeq		r2, r3, #336
 	addeq		r4, r3, #48
 	cmp		r1, #2
-	moveq		r5, 1
+	moveq		r5, #1
 	addeq		r2, r3, #48
 	cmp		r1, #3
-	moveq		r5, 5
+	moveq		r5, #5
 	addeq		r4, r3, #336
 	cmp		r1, #4
-	moveq		r5, 10
+	moveq		r5, #10
 	cmp		r1, #5
-	moveq		r5, 20
+	moveq		r5, #20
 	cmp		r1, #6
-	moveq		r5, 10
+	moveq		r5, #10
 	addeq		r2, r3, #336
 	addeq		r4, r3, #336
 	cmp		r1, #7
-	moveq		r5, 50
+	moveq		r5, #50
 	cmp		r1, #8
-	moveq		r5, 100
+	moveq		r5, #100
 	cmp		r1, #9
-	moveq		r5, 50
+	moveq		r5, #50
 	addeq		r2, r3, #336
 	cmp		r1, #10
-	moveq		r5, 5
+	moveq		r5, #5
 	addeq		r2, r3, #48
 	cmp		r1, #11
-	moveq		r5, 0
+	moveq		r5, #0
 	addeq		r2, r3, #96
 	add		r6, r3, #144
 	add		r7, r3, #288


[-- Attachment #2: Type: text/html, Size: 2414 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-29 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 22:22 [PATCH ARM] Compile on Raspberry Pi Francis Booth
2018-08-29  4:05 ` Jason A. Donenfeld
2018-08-29  7:07 ` Emeka
2018-08-29 10:34   ` logcabin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).