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

Comments

@pebbe
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2018

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.
Projects
None yet
4 participants
You can’t perform that action at this time.