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: -fno-plt #24703

Closed
elf64 opened this issue Apr 5, 2018 · 9 comments
Closed

cmd/cgo: invalid flag in #cgo CFLAGS: -fno-plt #24703

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

Comments

@elf64
Copy link

elf64 commented Apr 5, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.10

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/puka/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/puka/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/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-build840200638=/tmp/go-build -gno-record-gcc-switches"

What did you do?

i installed qt and the bindings for go and i tried to run an example from github but i got this error.

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

Code for the code i was trying to run:
https://pastebin.com/RWK3aeEw

What did you expect to see?

My qt application

What did you see instead?

go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -fno-plt

@minaevmike
Copy link
Contributor

seems CGO_CFLAGS_ALLOW enviroment variable (https://github.com/golang/go/blob/master/src/cmd/go/alldocs.go#L1038) can help.

@AlexRouSg
Copy link
Contributor

cc @ianlancetaylor

@ALTree ALTree changed the title invalid flag in #cgo CFLAGS: -fno-plt cmd/cgo: invalid flag in #cgo CFLAGS: -fno-plt Apr 5, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 6, 2018

(See also #23749.)

@bcmills bcmills added this to the Go1.11 milestone Apr 6, 2018
@bcmills bcmills added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 6, 2018
@elf64
Copy link
Author

elf64 commented Apr 8, 2018

solved, thanks!

@elf64 elf64 closed this as completed Apr 8, 2018
@AlexRouSg
Copy link
Contributor

You can leave this open if you want it to be added to the list so you don't have to use CGO_CFLAGS_ALLOW

@elf64 elf64 reopened this Apr 8, 2018
@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 9, 2018
@rsc
Copy link
Contributor

rsc commented Apr 9, 2018

no-plt is ok

@gopherbot gopherbot removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 9, 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