Skip to content

Commit

Permalink
crossbuild.bash: disable CGO
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rfjakob committed Jun 6, 2021
1 parent 17f859d commit e44d4fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crossbuild.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -eu
#
# Build on all supported architectures & operating systems

cd "$(dirname "$0")"

Expand All @@ -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
Expand Down

0 comments on commit e44d4fc

Please sign in to comment.