Pass `-linkmode=external` to `ldflags`
This workaround was proposed in a GitHub issue on the Go repo to
workaround a similar issue that cropped up on Windows. Here we borrow
this solution to workaround our build issues on Linux.
@@ -4,5 +4,7 @@ ln -s "${GOPATH}/src/github.com/gdrive-org" \
"${GOPATH}/src/github.com/prasmussen"
# Build and install
+# Use linkmode external to workaround a possible Go compiler bug.
+# xref: https://github.com/golang/go/issues/23649#issuecomment-493248154
cd "${GOPATH}/src/github.com/gdrive-org/${PKG_NAME}"
-go build -v -o $GOBIN/gdrive .
+go build -v -ldflags="-linkmode=external" -o $GOBIN/gdrive .
