Closed zamsyt closed 2 months ago
If I try to build via make, again I get
CGO_LDFLAGS_ALLOW=-Wl,-Bsymbolic-functions go build
github.com/rthornton128/goncurses: invalid flag in pkg-config --libs: -Wl,--push-state,--as-needed
make: *** [Makefile:4: build] Error 1
@zamsyt Try again and add CGO_CFLAGS_ALLOW="-Wl,--push-state,--as-needed"
to your environment.
Try again and add
CGO_CFLAGS_ALLOW="-Wl,--push-state,--as-needed"
to your environment.
@servusdei2018 Is that meant to fix something that export CGO_CFLAGS_ALLOW=".*" && export CGO_LDFLAGS_ALLOW=".*"
didn't? Anyway, if this is what you meant, changes nothing:
$ go build
github.com/rthornton128/goncurses: invalid flag in pkg-config --libs: -Wl,--push-state,--as-needed
$ export CGO_CFLAGS_ALLOW="-Wl,--push-state,--as-needed"
$ go build
github.com/rthornton128/goncurses: invalid flag in pkg-config --libs: -Wl,--push-state,--as-needed
Idk what it means, but the same for LDFLAGS at least gives something slightly different:
$ export CGO_LDFLAGS_ALLOW="-Wl,--push-state,--as-needed"
$ go build
github.com/rthornton128/goncurses: invalid flag in pkg-config --libs: -Wl,--pop-state
Try again and add
CGO_CFLAGS_ALLOW="-Wl,--push-state,--as-needed"
to your environment.@servusdei2018 Is that meant to fix something that
export CGO_CFLAGS_ALLOW=".*" && export CGO_LDFLAGS_ALLOW=".*"
didn't?
Yes, those are part of a set of environment variables that are an allowlist/blocklist for flags passed during the CGO compilation process. Generally its better to allow specific flags rather than any/all, as that may result in arbitrary code execution.
It's more of a tangent on my part, but going back to the problem I'm guessing that somehow ESCDELAY
is undefined which is why it's not an lvalue. I'm not sure why that would be the case, unless pkg-config is somehow messing up with ncurses but there would probably be a lot more errors if that were the case.
Closing this as a stale or resolved issue. This seems to be a very isolated issue but if it becomes more prevalent, a new issue can be opened to address it.
I was getting
invalid flag in pkg-config --libs: -Wl,--push-state,--as-needed
, and that was fixed withexport CGO_CFLAGS_ALLOW=".*" && export CGO_LDFLAGS_ALLOW=".*"
. But now I'm getting this when runninggo build
:I'm on openSUSE (Tumbleweed), go1.20.2