-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: error out of linking package main if cgo is required but not …
…enabled Fixes golang#46330. Fixes golang#62123. Updates golang#31544. Change-Id: I023aa2bdb5a24e126a0de5192a077e8cf1a0a67c Reviewed-on: https://go-review.googlesource.com/c/go/+/522239 Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information
Showing
4 changed files
with
57 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
env GOOS=android GOARCH=amd64 CGO_ENABLED=0 | ||
|
||
! go build -o $devnull cmd/buildid | ||
stderr 'android/amd64 requires external \(cgo\) linking, but cgo is not enabled' | ||
! stderr 'cannot find runtime/cgo' | ||
|
||
! go test -c -o $devnull os | ||
stderr '# os\nandroid/amd64 requires external \(cgo\) linking, but cgo is not enabled' | ||
! stderr 'cannot find runtime/cgo' | ||
|
||
env GOOS=ios GOARCH=arm64 CGO_ENABLED=0 | ||
|
||
! go build -o $devnull cmd/buildid | ||
stderr 'ios/arm64 requires external \(cgo\) linking, but cgo is not enabled' | ||
! stderr 'cannot find runtime/cgo' | ||
|
||
! go test -c -o $devnull os | ||
stderr '# os\nios/arm64 requires external \(cgo\) linking, but cgo is not enabled' | ||
! stderr 'cannot find runtime/cgo' |