[pkg-golang-devel] Bug#821454: [pkg-go] Bug#821454: dh-golang: Position-independent executables (PIE)

Peter Colberg peter at colberg.org
Tue Apr 26 16:53:21 UTC 2016


Hi Michael,

On Tue, Apr 26, 2016 at 10:29:51PM +1200, Michael Hudson-Doyle wrote:
>  override_dh_auto_build:
> - dh_auto_build -O--buildsystem=golang -- -ldflags "$(GO_LDFLAGS)"
> + dh_auto_build -O--buildsystem=golang -- -buildmode=pie
> -pkgdir=$$(mktemp -d -p $(CURDIR)) -ldflags "$(GO_LDFLAGS)"

I am wondering if dh-golang could set -pkgdir by default. Does it have
to be a random path? dh-golang could set a fixed path that is cleaned
up with dh_auto_clean.

> (we could probably make dh-golang do something like this by default...)

Ideally dh-golang would support dpkg hardening flags such as

  export DEB_BUILD_MAINT_OPTIONS = hardening=+all

  export DEB_BUILD_MAINT_OPTIONS = hardening=+pie

Another issue is that when using -buildmode=pie as above, the standard
library is rebuilt, which increases compile time if enabled for every
package. golang-go should provide the -buildmode=pie variant of the
standard and runtime libraries out of the box.

https://github.com/golang/go/issues/15433#issuecomment-214529771

Peter



More information about the pkg-golang-devel mailing list