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/go: cgo whitelist is missing -include #39988

Open
dpifke opened this issue Jul 2, 2020 · 1 comment
Open

cmd/go: cgo whitelist is missing -include #39988

dpifke opened this issue Jul 2, 2020 · 1 comment
Labels
Milestone

Comments

@dpifke
Copy link

@dpifke dpifke commented Jul 2, 2020

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

$ go version
go version devel +a4ba411b1 Wed Jul 1 15:29:29 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dave/.cache/go-build"
GOENV="/home/dave/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/dave/Source/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/dave/Source/Go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/home/dave/Source/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/home/dave/Source/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/dave/Source/golang/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build827569325=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package foo

// #cgo pkg-config: mozjs-68
include "C"

func main() {}
$ pkg-config --cflags mozjs-68
-include /usr/include/mozjs-68/js/RequiredDefines.h -isystem /usr/include/mozjs-68

What did you expect to see?

I expected it to compile.

What did you see instead?

invalid flag in pkg-config --cflags: -include

It appears validCompilerFlagsWithNextArg in src/cmd/go/internal/work/security.go is missing -include.

@dpifke dpifke changed the title cmd/go: cgo whitelist is missing long options -include and -isystem cmd/go: cgo whitelist is missing -include Jul 2, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 2, 2020

Change https://golang.org/cl/240739 mentions this issue: cmd/go: Add -include to cgo whitelist

@jayconrod jayconrod added this to the Go1.16 milestone Jul 6, 2020
@jayconrod jayconrod added the NeedsFix label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.