From e2201689cfd5709a7202f662fed9e0d917121068 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 2 Jun 2020 11:27:16 +0100 Subject: [PATCH] build: add ARMv7 to the supported builds - fixes #748 --- bin/cross-compile.go | 17 ++++++++++++++++- docs/content/downloads.md | 6 ++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/bin/cross-compile.go b/bin/cross-compile.go index b8f874c53..dca54556b 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -40,6 +40,8 @@ var ( ) // GOOS/GOARCH pairs we build for +// +// If the GOARCH contains a - it is a synthetic arch with more parameters var osarches = []string{ "windows/386", "windows/amd64", @@ -48,15 +50,18 @@ var osarches = []string{ "linux/386", "linux/amd64", "linux/arm", + "linux/arm-v7", "linux/arm64", "linux/mips", "linux/mipsle", "freebsd/386", "freebsd/amd64", "freebsd/arm", + "freebsd/arm-v7", "netbsd/386", "netbsd/amd64", "netbsd/arm", + "netbsd/arm-v7", "openbsd/386", "openbsd/amd64", "plan9/386", @@ -69,6 +74,7 @@ var archFlags = map[string][]string{ "386": {"GO386=387"}, "mips": {"GOMIPS=softfloat"}, "mipsle": {"GOMIPS=softfloat"}, + "arm-v7": {"GOARM=7"}, } // runEnv - run a shell command with env @@ -263,6 +269,15 @@ func cleanupResourceSyso(sysoFilePath string) { } } +// Trip a version suffix off the arch if present +func stripVersion(goarch string) string { + i := strings.Index(goarch, "-") + if i < 0 { + return goarch + } + return goarch[:i] +} + // build the binary in dir returning success or failure func compileArch(version, goos, goarch, dir string) bool { log.Printf("Compiling %s/%s", goos, goarch) @@ -290,7 +305,7 @@ func compileArch(version, goos, goarch, dir string) bool { } env := []string{ "GOOS=" + goos, - "GOARCH=" + goarch, + "GOARCH=" + stripVersion(goarch), } if !*cgo { env = append(env, "CGO_ENABLED=0") diff --git a/docs/content/downloads.md b/docs/content/downloads.md index 008d8b0fd..942863615 100644 --- a/docs/content/downloads.md +++ b/docs/content/downloads.md @@ -11,7 +11,8 @@ Rclone Download {{< version >}} |:-------:|:-------:|:-----:|:-----:|:----:|:----:|:-------:|:------:|:-------:|:-----:|:-------:| | Intel/AMD - 64 Bit | {{< download windows amd64 >}} | {{< download osx amd64 >}} | {{< download linux amd64 >}} | {{< download linux amd64 deb >}} | {{< download linux amd64 rpm >}} | {{< download freebsd amd64 >}} | {{< download netbsd amd64 >}} | {{< download openbsd amd64 >}} | {{< download plan9 amd64 >}} | {{< download solaris amd64 >}} | | Intel/AMD - 32 Bit | {{< download windows 386 >}} | {{< download osx 386 >}} | {{< download linux 386 >}} | {{< download linux 386 deb >}} | {{< download linux 386 rpm >}} | {{< download freebsd 386 >}} | {{< download netbsd 386 >}} | {{< download openbsd 386 >}} | {{< download plan9 386 >}} | - | -| ARM - 32 Bit | - | - | {{< download linux arm >}} | {{< download linux arm deb >}} | {{< download linux arm rpm >}} | {{< download freebsd arm >}} | {{< download netbsd arm >}} | - | - | - | +| ARMv6 - 32 Bit | - | - | {{< download linux arm >}} | {{< download linux arm deb >}} | {{< download linux arm rpm >}} | {{< download freebsd arm >}} | {{< download netbsd arm >}} | - | - | - | +| ARMv7 - 32 Bit | - | - | {{< download linux arm-v7 >}} | {{< download linux arm-v7 deb >}} | {{< download linux arm-v7 rpm >}} | {{< download freebsd arm-v7 >}} | {{< download netbsd arm-v7 >}} | - | - | - | | ARM - 64 Bit | - | - | {{< download linux arm64 >}} | {{< download linux arm64 deb >}} | {{< download linux arm64 rpm >}} | - | - | - | - | - | | MIPS - Big Endian | - | - | {{< download linux mips >}} | {{< download linux mips deb >}} | {{< download linux mips rpm >}} | - | - | - | - | - | | MIPS - Little Endian | - | - | {{< download linux mipsle >}} | {{< download linux mipsle deb >}} | {{< download linux mipsle rpm >}} | - | - | - | - | - | @@ -70,7 +71,8 @@ script) from a URL which doesn't change then you can use these links. |:-------:|:-------:|:-----:|:-----:|:----:|:----:|:-------:|:------:|:-------:|:-----:|:-------:| | Intel/AMD - 64 Bit | {{< cdownload windows amd64 >}} | {{< cdownload osx amd64 >}} | {{< cdownload linux amd64 >}} | {{< cdownload linux amd64 deb >}} | {{< cdownload linux amd64 rpm >}} | {{< cdownload freebsd amd64 >}} | {{< cdownload netbsd amd64 >}} | {{< cdownload openbsd amd64 >}} | {{< cdownload plan9 amd64 >}} | {{< cdownload solaris amd64 >}} | | Intel/AMD - 32 Bit | {{< cdownload windows 386 >}} | {{< cdownload osx 386 >}} | {{< cdownload linux 386 >}} | {{< cdownload linux 386 deb >}} | {{< cdownload linux 386 rpm >}} | {{< cdownload freebsd 386 >}} | {{< cdownload netbsd 386 >}} | {{< cdownload openbsd 386 >}} | {{< cdownload plan9 386 >}} | - | -| ARM - 32 Bit | - | - | {{< cdownload linux arm >}} | {{< cdownload linux arm deb >}} | {{< cdownload linux arm rpm >}} | {{< cdownload freebsd arm >}} | {{< cdownload netbsd arm >}} | - | - | - | +| ARMv6 - 32 Bit | - | - | {{< cdownload linux arm >}} | {{< cdownload linux arm deb >}} | {{< cdownload linux arm rpm >}} | {{< cdownload freebsd arm >}} | {{< cdownload netbsd arm >}} | - | - | - | +| ARMv7 - 32 Bit | - | - | {{< cdownload linux arm-v7 >}} | {{< cdownload linux arm-v7 deb >}} | {{< cdownload linux arm-v7 rpm >}} | {{< cdownload freebsd arm-v7 >}} | {{< cdownload netbsd arm-v7 >}} | - | - | - | | ARM - 64 Bit | - | - | {{< cdownload linux arm64 >}} | {{< cdownload linux arm64 deb >}} | {{< cdownload linux arm64 rpm >}} | - | - | - | - | - | | MIPS - Big Endian | - | - | {{< cdownload linux mips >}} | {{< cdownload linux mips deb >}} | {{< cdownload linux mips rpm >}} | - | - | - | - | - | | MIPS - Little Endian | - | - | {{< cdownload linux mipsle >}} | {{< cdownload linux mipsle deb >}} | {{< cdownload linux mipsle rpm >}} | - | - | - | - | - |