-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: Windows -buildmode=pie fails to execute program that has CGo bindings compiled without PIE #41329
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
Comments
@gopherbot add OS-Windows |
@schollz thank you for submitting the issue. Unfortunately I don't have time to debug your issue. It could be C code you use, or gcc flags you use, or could be old / buggy gcc. -buildmode=pie passes these flags to gcc https://go-review.googlesource.com/c/go/+/214397/7/src/cmd/link/internal/ld/lib.go Maybe you can work out why it crashes for you. It is find to use -buildmode=exe to build your executable, if you don't care for ASLR. Alex |
Thanks @alexbrainman I'll tinker with those |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
@ianlancetaylor can you reopen this issue? |
Also raised in #42233 |
It is mentioned in #35192 that people might be interested in weird bugs that pop up using
-buildmode=pie
by default so I submitted this.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, because
-buildmode=pie
is default for Windows in go1.15. The issue does not present if-buildmode=exe
is used.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
First I installed portmidi for Windows with these instructions. Then I cloned and ran a test with go1.15.2:
What did you expect to see?
I expected to see that the default
go test
works without any extra build flags, as it did in go1.14.9:What did you see instead?
Instead I got this runtime error when using go1.15.2
The error can be eliminated only when I include the
-buildmode=exe
flag now:The text was updated successfully, but these errors were encountered: