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: invalid flag in #cgo LDFLAGS: -fopenmp #24858

Closed
beijinggao opened this issue Apr 14, 2018 · 10 comments
Closed

cmd/go: invalid flag in #cgo LDFLAGS: -fopenmp #24858

beijinggao opened this issue Apr 14, 2018 · 10 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@beijinggao
Copy link

Please answer these questions before submitting your issue. Thanks!

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

go version 1.10.1

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gaodong/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/data1/commonData/gaodong/gowork/ad-ctr-service"
GORACE=""
GOROOT="/data1/commonData/gaodong/gowork/go"
GOTMPDIR=""
GOTOOLDIR="/data1/commonData/gaodong/gowork/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build992507118=/tmp/go-build -gno-record-gcc-switches"

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.

What did you expect to see?

What did you see instead?

@agnivade
Copy link
Contributor

Please fill up the complete issue template. Thanks.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 14, 2018
@AlexRouSg
Copy link
Contributor

Based on the title, this is #23749 and he is asking for the flag to be added to the whitelist

@agnivade
Copy link
Contributor

Thanks. @gao8954 - If this is about -fopenmp to be added to the whitelist, I would request you to close this issue and add a comment on #23749.

@tklauser
Copy link
Member

FWIW, -fopenmp was whitelisted in https://golang.org/cl/93836 which was cherry-picked to the go1.10 release branch in https://golang.org/cl/94676 which means it should be part of Go 1.10 as well as Go 1.10.1

@gao8954 please describe the steps you performed before seeing the error. Please also make sure you are really using Go 1.10.1 to compile.

@beijinggao
Copy link
Author

@agnivade yes but how -fopenmp to be added to the whitelist ,i am try it still does not work

@beijinggao
Copy link
Author

@tklauser i am use // #cgo LDFLAGS: -L../lib -lstdc++ -lz -lrt -lm -lpthread -fopenmp ,and use GO version 1.10.1 it is still invalid flag,Is my method wrong?

@AlexRouSg
Copy link
Contributor

@tklauser -fopenmp is only whitelisted as a cflag not a ldflag.

@odeke-em odeke-em changed the title invalid flag in #cgo LDFLAGS: -fopenmp cmd/cgo: invalid flag in #cgo LDFLAGS: -fopenmp Apr 17, 2018
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Apr 18, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Apr 18, 2018
@ianlancetaylor ianlancetaylor changed the title cmd/cgo: invalid flag in #cgo LDFLAGS: -fopenmp cmd/go: invalid flag in #cgo LDFLAGS: -fopenmp Apr 18, 2018
@gopherbot
Copy link

Change https://golang.org/cl/115415 mentions this issue: cmd/go: accept more safe CFLAGS/LDFLAGS

@gopherbot
Copy link

Change https://golang.org/cl/115435 mentions this issue: [release-branch.go1.10] cmd/go: accept more safe CFLAGS/LDFLAGS

@gopherbot
Copy link

Change https://golang.org/cl/115436 mentions this issue: [release-branch.go1.9] cmd/go: accept more safe CFLAGS/LDFLAGS

gopherbot pushed a commit that referenced this issue May 31, 2018
Fixes #23749
Fixes #24703
Fixes #24858

Change-Id: Ib32d8efee294004c70fdd602087df2da0867f099
Reviewed-on: https://go-review.googlesource.com/115415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 886d5601a63bef0271e705cfa6b6ac6f5134ee60)
Reviewed-on: https://go-review.googlesource.com/115435
Reviewed-by: Andrew Bonventre <andybons@golang.org>
gopherbot pushed a commit that referenced this issue May 31, 2018
Fixes #23749
Fixes #24703
Fixes #24858

Change-Id: Ib32d8efee294004c70fdd602087df2da0867f099
Reviewed-on: https://go-review.googlesource.com/115415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit cc6e568)
Reviewed-on: https://go-review.googlesource.com/115436
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@golang golang locked and limited conversation to collaborators May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants