-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
What version of Go are you using (go version)?
$ go version go1.20.1 openbsd/amd64
Does this issue reproduce with the latest release?
Yes, I think so.
What operating system and processor architecture are you using (go env)?
OpenBSD 7.3 on amd64
What did you do?
I tried to build a PIE binary with -buildmode=pie
What did you expect to see?
I was expecting to build a binary with PIE enabled.
What did you see instead?
-buildmode=pie not supported on openbsd/amd64
Is there any particular reason that buildmode=pie is not supported on openbsd? Building with that buildmode returns that the buildmode=pie is not supported.
clang on OpenBSD/amd64 defaults and produces PIE static/dynamic binaries without issue. But even external linking in Go suppresses PIE with LDFlags -Wl,-nopie. You can append -Wl,-pie through -extldflags option, the result will be expectedly an invalid function entry symbol table or a segmentation fault.
I could not find an open issue that works on this or explains the situation for the missing support. There are some that are years old and closed or some old mailing list entries. I get that openbsd is a secondary port, but why is there not even an issue that addresses the state/progress and situation?
I'm just genuinely interested to see progress at this.
Thank you.