Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 702598 - dev-lang/go should build PIE by default
Summary: dev-lang/go should build PIE by default
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL: https://github.com/golang/go/issues/3...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-12-12 13:16 UTC by Doppler
Modified: 2020-01-01 19:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doppler 2019-12-12 13:16:09 UTC
While looking through the binaries on my system, I found a small handful of non-PIE binaries, and a majority of them were Go-based. So I looked around and found this patch which appears to enable building binaries with PIE support by default (on all platforms):
https://git.archlinux.org/svntogit/community.git/tree/trunk/default-buildmode-pie.patch?h=packages/go

Would there be any interest in this on Gentoo? I imagine this would be simple to implement as a patch which is applied if a newly introduced "pie" USE flag is set on dev-lang/go

There are a couple of caveats, of course:
1) Go is designed to be memory safe, so unless the unsafe package is used, PIE might not be too important
2) I'm no expert on Go, but there's a non-zero chance that flipping something like this in the toolchain could potentially break *something* down the line in a subtle way