aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-06-06 19:28:02 +0200
committerJakob Unterwurzacher2021-06-06 19:28:02 +0200
commite44d4fcb96cc437c7839cc997d44390c91328e8c (patch)
tree16464358e36c5fee9f557c15af5b1a4d28813d2d
parent17f859d3c409bf2730a47d56979c0700171006b7 (diff)
crossbuild.bash: disable CGO
build-without-openssl.bash also disables CGO, so this makes it more real-world-y. But the real reason is that disabling CGO hopefully fixes this travis ci build failure: +GOOS=darwin +GOARCH=arm64 +go build -tags without_openssl /home/travis/.gimme/versions/go1.13.15.linux.amd64/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/ld: unrecognized option '-pagezero_size' /usr/bin/ld: use the --help option for usage information collect2: error: ld returned 1 exit status The command "./crossbuild.bash" exited with 2.
-rwxr-xr-xcrossbuild.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/crossbuild.bash b/crossbuild.bash
index 0f3963f..2510bb0 100755
--- a/crossbuild.bash
+++ b/crossbuild.bash
@@ -1,4 +1,6 @@
#!/bin/bash -eu
+#
+# Build on all supported architectures & operating systems
cd "$(dirname "$0")"
@@ -7,6 +9,10 @@ B="go build -tags without_openssl"
set -x
+export CGO_ENABLED=0
+
+GOOS=linux GOARCH=amd64 $B
+
# See https://github.com/golang/go/wiki/GoArm
GOOS=linux GOARCH=arm GOARM=7 $B
GOOS=linux GOARCH=arm64 $B