fix build for all architectures (#47)
* support all architectures automatically
* fix arm64 linux support
* ci: bump to 1.12.x
1.11 lists an invalid architecture
* ci: fix go vet invocation
* fix architecture test
Co-Authored-By: Jakub Sztandera <kubuxu@protonmail.ch>
Steven Allen authored 4 years ago
Frank Wessels committed 4 years ago
6 | 6 |
|
7 | 7 |
go:
|
8 | 8 |
- tip
|
9 | |
- 1.11.x
|
|
9 |
- 1.12.x
|
10 | 10 |
|
11 | 11 |
env:
|
12 | 12 |
- ARCH=x86_64
|
|
20 | 20 |
script:
|
21 | 21 |
- diff -au <(gofmt -d .) <(printf "")
|
22 | 22 |
- go test -race -v ./...
|
23 | |
- go tool vet -asmdecl .
|
|
23 |
- go vet -asmdecl .
|
|
24 |
- ./test-architectures.sh
|
12 | 12 |
// limitations under the License.
|
13 | 13 |
//
|
14 | 14 |
|
15 | |
// +build ppc64 ppc64le mips mipsle mips64 mips64le s390x wasm
|
|
15 |
// +build !386,!amd64,!arm,!arm64 arm64,!linux
|
16 | 16 |
|
17 | 17 |
package sha256
|
18 | 18 |
|
0 | |
// +build arm64,!linux
|
1 | |
|
2 | |
// Minio Cloud Storage, (C) 2016 Minio, Inc.
|
3 | |
//
|
4 | |
// Licensed under the Apache License, Version 2.0 (the "License");
|
5 | |
// you may not use this file except in compliance with the License.
|
6 | |
// You may obtain a copy of the License at
|
7 | |
//
|
8 | |
// http://www.apache.org/licenses/LICENSE-2.0
|
9 | |
//
|
10 | |
// Unless required by applicable law or agreed to in writing, software
|
11 | |
// distributed under the License is distributed on an "AS IS" BASIS,
|
12 | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 | |
// See the License for the specific language governing permissions and
|
14 | |
// limitations under the License.
|
15 | |
//
|
16 | |
|
17 | |
package sha256
|
18 | |
|
19 | |
func cpuid(op uint32) (eax, ebx, ecx, edx uint32) {
|
20 | |
return 0, 0, 0, 0
|
21 | |
}
|
22 | |
|
23 | |
func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) {
|
24 | |
return 0, 0, 0, 0
|
25 | |
}
|
26 | |
|
27 | |
func xgetbv(index uint32) (eax, edx uint32) {
|
28 | |
return 0, 0
|
29 | |
}
|
30 | |
|
31 | |
// Check for sha2 instruction flag.
|
32 | |
func haveArmSha() bool {
|
33 | |
return false
|
34 | |
}
|
0 | 0 |
module github.com/minio/sha256-simd
|
|
1 |
|
|
2 |
go 1.12
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2017 Minio, Inc.
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2017 Minio, Inc.
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
package sha256
|
3 | 3 |
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
package sha256
|
3 | 3 |
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
0 | |
//+build !noasm
|
1 | |
|
2 | |
/*
|
3 | |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
4 | |
*
|
5 | |
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 | |
* you may not use this file except in compliance with the License.
|
7 | |
* You may obtain a copy of the License at
|
8 | |
*
|
9 | |
* http://www.apache.org/licenses/LICENSE-2.0
|
10 | |
*
|
11 | |
* Unless required by applicable law or agreed to in writing, software
|
12 | |
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 | |
* See the License for the specific language governing permissions and
|
15 | |
* limitations under the License.
|
16 | |
*/
|
17 | |
|
18 | |
package sha256
|
19 | |
|
20 | |
func blockArmGo(dig *digest, p []byte) {}
|
21 | |
func blockAvx2Go(dig *digest, p []byte) {}
|
22 | |
func blockAvxGo(dig *digest, p []byte) {}
|
23 | |
func blockSsseGo(dig *digest, p []byte) {}
|
24 | |
func blockShaGo(dig *digest, p []byte) {}
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
0 | |
//+build !noasm
|
1 | |
|
2 | |
/*
|
3 | |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
4 | |
*
|
5 | |
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 | |
* you may not use this file except in compliance with the License.
|
7 | |
* You may obtain a copy of the License at
|
8 | |
*
|
9 | |
* http://www.apache.org/licenses/LICENSE-2.0
|
10 | |
*
|
11 | |
* Unless required by applicable law or agreed to in writing, software
|
12 | |
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 | |
* See the License for the specific language governing permissions and
|
15 | |
* limitations under the License.
|
16 | |
*/
|
17 | |
|
18 | |
package sha256
|
19 | |
|
20 | |
func blockAvx2Go(dig *digest, p []byte) {}
|
21 | |
func blockAvxGo(dig *digest, p []byte) {}
|
22 | |
func blockSsseGo(dig *digest, p []byte) {}
|
23 | |
func blockShaGo(dig *digest, p []byte) {}
|
24 | |
func blockArmGo(dig *digest, p []byte) {}
|
0 | |
//+build !noasm
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
0 | |
//+build !noasm !appengine
|
|
0 |
//+build !noasm,!appengine
|
1 | 1 |
|
2 | 2 |
// ARM64 version of SHA256
|
3 | 3 |
|
|
27 | 27 |
TEXT ·blockArm(SB), 7, $0
|
28 | 28 |
MOVD h+0(FP), R0
|
29 | 29 |
MOVD message+24(FP), R1
|
30 | |
MOVD lenmessage+32(FP), R2 // length of message
|
|
30 |
MOVD message_len+32(FP), R2 // length of message
|
31 | 31 |
SUBS $64, R2
|
32 | 32 |
BMI complete
|
33 | 33 |
|
0 | |
//+build noasm appengine ppc64 ppc64le mips mipsle mips64 mips64le s390x wasm
|
|
0 |
//+build appengine noasm !amd64,!arm64
|
1 | 1 |
|
2 | 2 |
/*
|
3 | 3 |
* Minio Cloud Storage, (C) 2019 Minio, Inc.
|
|
0 |
#!/bin/sh
|
|
1 |
|
|
2 |
set -e
|
|
3 |
|
|
4 |
go tool dist list | while IFS=/ read os arch; do
|
|
5 |
echo "Checking $os/$arch..."
|
|
6 |
echo " normal"
|
|
7 |
GOARCH=$arch GOOS=$os go build -o /dev/null ./...
|
|
8 |
echo " noasm"
|
|
9 |
GOARCH=$arch GOOS=$os go build -tags noasm -o /dev/null ./...
|
|
10 |
echo " appengine"
|
|
11 |
GOARCH=$arch GOOS=$os go build -tags appengine -o /dev/null ./...
|
|
12 |
echo " noasm,appengine"
|
|
13 |
GOARCH=$arch GOOS=$os go build -tags 'appengine noasm' -o /dev/null ./...
|
|
14 |
done
|