Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 #23744

Closed
pebbe opened this issue Feb 8, 2018 · 3 comments
Closed

cmd/cgo: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 #23744

pebbe opened this issue Feb 8, 2018 · 3 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.

Comments

@pebbe
Copy link
Contributor

pebbe commented Feb 8, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.4 linux/amd64

This problem is absent in go1.9.3

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/peter/go"
GORACE=""
GOROOT="/my/opt/go"
GOTOOLDIR="/my/opt/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build425907123=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

go get github.com/pebbe/tokenize

What did you expect to see?

No output

What did you see instead?

go build github.com/pebbe/tokenize: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8
@pebbe
Copy link
Contributor Author

pebbe commented Feb 8, 2018

There are more, similar errors with other packages:

go build github.com/andlabs/ui: invalid flag in #cgo CFLAGS: --std=c99

go build gopkg.in/qml.v1: invalid flag in #cgo CXXFLAGS: -pedantic-errors

@andybons andybons changed the title Go 1.9.4: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 cgo: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 Feb 8, 2018
@andybons andybons added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 8, 2018
@andybons
Copy link
Member

andybons commented Feb 8, 2018

@ianlancetaylor @rsc

https://go.googlesource.com/go/+/master/src/cmd/go/internal/work/security.go#61 should handle the first case, but it may be that we're not allowing two slashes in flags.

-pedantic-errors seems to simply be absent from the whitelist.

Adding needsdecision label to determine which release this should go in.

@ianlancetaylor
Copy link
Contributor

Closing in favor of a general issue to cover all whitelist options in #23749.

@mikioh mikioh changed the title cgo: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 cmd/cgo: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8 Feb 21, 2018
@golang golang locked and limited conversation to collaborators Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants