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
pukapy opened this issue Apr 5, 2018 · 9 comments

Comments

@pukapy
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2018

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

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2018

@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

This comment has been minimized.

Copy link
Member

commented Apr 6, 2018

(See also #23749.)

@bcmills bcmills added this to the Go1.11 milestone Apr 6, 2018

@pukapy

This comment has been minimized.

Copy link
Author

commented Apr 8, 2018

solved, thanks!

@pukapy pukapy closed this Apr 8, 2018

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2018

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

@pukapy pukapy reopened this Apr 8, 2018

@rsc rsc added the NeedsFix label Apr 9, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2018

no-plt is ok

@gopherbot

This comment has been minimized.

Copy link

commented May 30, 2018

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

@gopherbot gopherbot closed this in cc6e568 May 30, 2018

@gopherbot

This comment has been minimized.

Copy link

commented May 30, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented May 30, 2018

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
[release-branch.go1.10] cmd/go: accept more safe CFLAGS/LDFLAGS
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
[release-branch.go1.9] cmd/go: accept more safe CFLAGS/LDFLAGS
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.
Projects
None yet
6 participants
You can’t perform that action at this time.