WireGuard Archive on lore.kernel.org
 help / color / 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 --]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Attempting to build Wireguard on a Raspberry Pi will result in an
      assembly error <br>
    </p>
    <p>    Error: immediate expression requires a # prefix -- `moveq
      r5,1'</p>
    <p>(the full build error log can be found here:
      <a class="moz-txt-link-freetext" href="https://pastebin.com/CKTXwGyG">https://pastebin.com/CKTXwGyG</a>)<br>
    </p>
    <p>Appending # to the values and telling ARM to treat them as
      literals solves the issue.</p>
    <p>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.</p>
    <p>justw and revel assisted in providing the fix via the Wireguard
      irc channel.<br>
    </p>
    <p><br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">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</pre>
  </body>
</html>

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

* Re: [PATCH ARM] Compile on Raspberry Pi
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2018-08-29  4:05 UTC (permalink / raw)
  To: boothf; +Cc: WireGuard mailing list

Thanks! Fixed with:
https://git.zx2c4.com/WireGuard/commit/?id=4a5ef87efbc73d21107cb64cbaac3112bafd5288

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

* Re: [PATCH ARM] Compile on Raspberry Pi
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Emeka @ 2018-08-29  7:07 UTC (permalink / raw)
  To: Francis Booth; +Cc: wireguard

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

I was able to build on rpi b3 (board 2710 ) some months ago... and I didn't
encounter this . Can I see the  steps you followed?

Regards, Janus

On Wed, Aug 29, 2018, 5:05 AM Francis Booth <boothf@boothlabs.me> wrote:

> 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
>
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard
>

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

<div dir="auto">I was able to build on rpi b3 (board 2710 ) some months ago... and I didn&#39;t encounter this . Can I see the  steps you followed?<div dir="auto"><br></div><div dir="auto">Regards, Janus </div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 29, 2018, 5:05 AM Francis Booth &lt;<a href="mailto:boothf@boothlabs.me">boothf@boothlabs.me</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Attempting to build Wireguard on a Raspberry Pi will result in an
      assembly error <br>
    </p>
    <p>    Error: immediate expression requires a # prefix -- `moveq
      r5,1&#39;</p>
    <p>(the full build error log can be found here:
      <a class="m_777972590414573895moz-txt-link-freetext" href="https://pastebin.com/CKTXwGyG" target="_blank" rel="noreferrer">https://pastebin.com/CKTXwGyG</a>)<br>
    </p>
    <p>Appending # to the values and telling ARM to treat them as
      literals solves the issue.</p>
    <p>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.</p>
    <p>justw and revel assisted in providing the fix via the Wireguard
      irc channel.<br>
    </p>
    <p><br>
    </p>
    <pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">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</pre>
  </div>

_______________________________________________<br>
WireGuard mailing list<br>
<a href="mailto:WireGuard@lists.zx2c4.com" target="_blank" rel="noreferrer">WireGuard@lists.zx2c4.com</a><br>
<a href="https://lists.zx2c4.com/mailman/listinfo/wireguard" rel="noreferrer noreferrer" target="_blank">https://lists.zx2c4.com/mailman/listinfo/wireguard</a><br>
</blockquote></div>

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

* Re: [PATCH ARM] Compile on Raspberry Pi
  2018-08-29  7:07 ` Emeka
@ 2018-08-29 10:34   ` logcabin
  0 siblings, 0 replies; 4+ messages in thread
From: logcabin @ 2018-08-29 10:34 UTC (permalink / raw)
  To: wireguard

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

I've been building wg on an rpi b3 for quite some time and have never
seen this error. This is with Raspbian Stretch. Maybe compiler related?

On Wed, Aug 29, 2018, at 3:07 AM, Emeka wrote:
> I was able to build on rpi b3 (board 2710 ) some months ago... and I
> didn't encounter this . Can I see the  steps you followed?> 
> Regards, Janus 
> 
> On Wed, Aug 29, 2018, 5:05 AM Francis Booth
> <boothf@boothlabs.me> wrote:>> 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>> _______________________________________________
>>  WireGuard mailing list
>> WireGuard@lists.zx2c4.com
>> https://lists.zx2c4.com/mailman/listinfo/wireguard
> _________________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard


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

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div style="font-family:Arial;">I've been building wg on an rpi b3 for quite some time and have never seen this error. This is with Raspbian Stretch. Maybe compiler related?<br></div>
<div><br></div>
<div><br></div>
<div>On Wed, Aug 29, 2018, at 3:07 AM, Emeka wrote:<br></div>
<blockquote type="cite"><div><div style="font-family:Arial;">I was able to build on rpi b3 (board 2710 ) some months ago... and I didn't encounter this . Can I see the&nbsp; steps you followed?<br></div>
<div><br></div>
<div>Regards, Janus&nbsp;<br></div>
</div>
<div style="font-family:Arial;"><br></div>
<div defang_data-gmailquote="yes"><div dir="ltr">On Wed, Aug 29, 2018, 5:05 AM Francis Booth &lt;<a href="mailto:boothf@boothlabs.me">boothf@boothlabs.me</a>&gt; wrote:<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div bgcolor="#FFFFFF"><p>Attempting to build Wireguard on a Raspberry Pi will result in an
      assembly error <br></p><p>&nbsp;&nbsp;&nbsp; Error: immediate expression requires a # prefix -- `moveq
      r5,1'<br></p><p>(the full build error log can be found here: <a href="https://pastebin.com/CKTXwGyG">https://pastebin.com/CKTXwGyG</a>)<br></p><p>Appending # to the values and telling ARM to treat them as
      literals solves the issue.<br></p><p>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.<br></p><p>justw and revel assisted in providing the fix via the Wireguard
      irc channel.<br></p><p><br></p><pre style="color:rgb(0, 0, 0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;">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<br></pre></div>
<div style="font-family:Arial;">_______________________________________________<br></div>
<div style="font-family:Arial;"> WireGuard mailing list<br></div>
<div style="font-family:Arial;"> <a href="mailto:WireGuard@lists.zx2c4.com">WireGuard@lists.zx2c4.com</a><br></div>
<div style="font-family:Arial;"> <a href="https://lists.zx2c4.com/mailman/listinfo/wireguard">https://lists.zx2c4.com/mailman/listinfo/wireguard</a><br></div>
</blockquote></div>
<div><u>_______________________________________________</u><br></div>
<div>WireGuard mailing list<br></div>
<div><a href="mailto:WireGuard@lists.zx2c4.com">WireGuard@lists.zx2c4.com</a><br></div>
<div><a href="https://lists.zx2c4.com/mailman/listinfo/wireguard">https://lists.zx2c4.com/mailman/listinfo/wireguard</a><br></div>
</blockquote><div style="font-family:Arial;"><br></div>
</body>
</html>

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

end of thread, back to index

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

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox