Closed axelniedenhoff closed 6 years ago
Hello,
Same.
OS: Win 7 x64
Golang 1.9.3 OK :+1:
Golang 1.9.4 NOK
C:/tools/go/bin/go.exe build -i [C:/Users/Gugas/.wks_go/src/wxTest1] go build github.com/dontpanic92/wxGo/wx: invalid flag in #cgo CXXFLAGS: -fpermissive Error: process exited with code 1.
Golang 1.10.0 NOK
C:/tools/go/bin/go.exe build -i [C:/Users/Gugas/.wks_go/src/wxTest1] go build github.com/dontpanic92/wxGo/wx: invalid flag in #cgo LDFLAGS: -Wl,--subsystem,windows Error: process exited with code 1.
Regards
It seems this is the expected behavior after a security vulnerability in Go was fixed. See this article for background and a workaround: https://github.com/golang/go/wiki/InvalidFlag So, in my case, this works: CGO_LDFLAGS_ALLOW=-s go get -u -v github.com/dontpanic92/wxGo/wx
As has been suggested elsewhere, try this quick and dirty "fix";
export CGO_CXXFLAGS_ALLOW=".*"
export CGO_LDFLAGS_ALLOW=".*"
export CGO_CFLAGS_ALLOW=".*"
@guilhas did you find a fix for golang 1.10.0 issue?
Hi all, a little update about this issue:
-s
option. Now on Linux it should build-mwindows
, -Wl,--subsystem,windows
, -Wl,--allow-multiple-definitions
and -stdlib=libc++
. They are considered to be added into the whitelist (see golang/go#23937), so I didn't remove them.I think the workaround way suggested by @ernstvanzyl should work, but I haven't test it.
@dontpanic92 I am fairly new to Go and don't understand completely how to do what he suggested. I am using windows so I think I have to use "set" instead of "export" but after doing these three commands
set CGO_CXXFLAGS_ALLOW=".*" set CGO_LDFLAGS_ALLOW=".*" set CGO_CFLAGS_ALLOW=".*"
and running go get github.com/dontpanic92/wxGo/wx
I still have the same error. What am I doing wrong?
@alanbaumgartner don't include the "
on Windows, i.e. set CGO_LDFLAGS_ALLOW=.*
I just downgraded Go
@dontpanic92, could you please add a note in the README.md file. It took me a long time to find this issue that solves the installation problem with GO 1.10. Also a more exact content of the flags instead of the "catch all" would be fine.
Also a more exact content of the flags instead of the "catch all" would be fine.
On Windows, I use this:
set "CGO_LDFLAGS_ALLOW=-Wl,--subsystem,windows|-mwindows"
(Using GCC 7.3.0 on MSYS2, which doesn't require -Wl,--allow-multiple-definitions
.)
From my point of view, this issue has been fixed for go 1.10.1. For use cases that still show the problem, workarounds have been documented, so I am closing the issue.
I was just updating my wxGo by doing
go get -u -v github.com/dontpanic92/wxGo/wx
Then I got this:
github.com/dontpanic92/wxGo (download) github.com/dontpanic92/wxGo/wx go build github.com/dontpanic92/wxGo/wx: invalid flag in #cgo LDFLAGS: -s
I have Go version 1.9.4 on Ubuntu Linux 17.10.
Any idea?