From 9b0736fc5850271ed89880202eed797692976a49 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 14 Feb 2014 11:36:52 -0800 Subject: [PATCH] cmd/go: remove cross compiling restriction on cgo A previous CL added support for cross compiling with cgo, but missed the GOOS check in cmd/go. Remove it. Update #4714 LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/57210046 --- src/cmd/go/build.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 5ffb9d9f3e..824351b7e6 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -2068,10 +2068,6 @@ var ( ) func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles, gxxfiles, mfiles []string) (outGo, outObj []string, err error) { - if goos != toolGOOS { - return nil, nil, errors.New("cannot use cgo when compiling for a different operating system") - } - cgoCPPFLAGS := stringList(envList("CGO_CPPFLAGS"), p.CgoCPPFLAGS) cgoCFLAGS := stringList(envList("CGO_CFLAGS"), p.CgoCFLAGS) cgoCXXFLAGS := stringList(envList("CGO_CXXFLAGS"), p.CgoCXXFLAGS) -- 2.48.1