Running go build gives error: invalid flag in #cgo LDFLAGS: -Wl,-no_pie #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I run the command below and it fails with the error given. Any ideas?
go build -buildmode=c-shared -o "example.node" cmd/main.go
I also tried running the simplified version below and it still gives the same error. So it must be flags coming from napi-go? I'm on go 1.20.1.
go build cmd/main.go
Had to run
CGO_LDFLAGS_ALLOW=-Wl,-no_pie go build -buildmode=c-shared -o "example.node" ./cmd
and it works