From cdcb58c6cadec8967e86a977a1c953e03d0ac0d6 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 17 Oct 2016 12:04:09 -0700 Subject: [PATCH] poly1305: fix NaCl build. The ARM assembly doesn't work for NaCl on ARM because it doesn't meet the required rules. This change disables it on ARM and also fixes the issue that the build constraints in sum_arm.s would be ignored because they came after the #include. Change-Id: I6cb3815ec62ac4686a6e72f405af104293586bb6 Reviewed-on: https://go-review.googlesource.com/31264 Run-TryBot: Adam Langley TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- poly1305/sum_arm.s | 4 ++-- poly1305/sum_ref.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poly1305/sum_arm.s b/poly1305/sum_arm.s index c09f182..6742dfb 100644 --- a/poly1305/sum_arm.s +++ b/poly1305/sum_arm.s @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build arm,!gccgo,!appengine,!nacl + #include "textflag.h" // This code was translated into a form compatible with 5a from the public // domain source by Andrew Moon: github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305. -// +build arm,!gccgo,!appengine,!nacl - DATA poly1305_init_constants_armv6<>+0x00(SB)/4, $0x3ffffff DATA poly1305_init_constants_armv6<>+0x04(SB)/4, $0x3ffff03 DATA poly1305_init_constants_armv6<>+0x08(SB)/4, $0x3ffc0ff diff --git a/poly1305/sum_ref.go b/poly1305/sum_ref.go index 5d25a56..908aae0 100644 --- a/poly1305/sum_ref.go +++ b/poly1305/sum_ref.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !amd64,!arm gccgo appengine !go1.7 +// +build !amd64,!arm gccgo appengine nacl !go1.7 package poly1305