You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. "go install -x test" with http://play.golang.org/p/LrE1XbZQxu
2. Notice that -lblah *is not* on the gcc command.
3. "go install -x test" with http://play.golang.org/p/noe6YfG2AO
4. Notice that -lblah *is* on the gcc command and that you get the (correct) error.
What is the expected output?
You should receive the following error compiling both programs:
# test
/usr/bin/ld: cannot find -lblah
collect2: ld returned 1 exit status
What do you see instead?
You do not get the above error. Even though the CGO docs at:
http://golang.org/cmd/cgo/
Specifically say you can use pseudo #cgo directives prefixed by "$GOOS, $GOARCH, or
$GOOS/$GOARCH", but $GOOS/$GOARCH does not actually get matched at all.
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
linux/amd64
Which version are you using? (run 'go version')
tip
go version devel +62e67a664a03 Fri Sep 20 17:27:56 2013 -0700 linux/amd64
Please provide any additional information below.
It seems cgo does not support OR operators in the form of $GOOS/$GOARCH like it says in
the docs. AND operators are supported using spaces, for example:
#cgo windows amd64 LDFLAGS: -lblah
works on any windows or amd64 platform. But OR operators do not work:
#cgo linux/amd64 LDFLAGS: -lblah
Does not match on any platform at all (even linux/amd64).
The text was updated successfully, but these errors were encountered:
note: the comma form works because the way it's implemented (actually shares code
with the normal build tag parsing), but I think we should fix the behaviour for Go 1.2
so I'm not entirely sure whether the comma form will continue to work or not.
The text was updated successfully, but these errors were encountered: