]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.10] cmd/link: do not pass -no-pie to host linker when -linkshared...
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 4 Apr 2018 22:07:41 +0000 (10:07 +1200)
committerAndrew Bonventre <andybons@golang.org>
Fri, 27 Apr 2018 20:12:25 +0000 (20:12 +0000)
commitabccc7a9b51372c67a0bc60159e8bf43ae77d102
tree16e4d0f68281fc0f07a5bef0a0834e95ad8df89d
parent8e1f12f001be4eefebb2930dd9f647a1a0a837ed
[release-branch.go1.10] cmd/link: do not pass -no-pie to host linker when -linkshared is passed

As the comment above the code I'm changing says, when building with
-buildmode=exe, the default compiler flags produce code incompatible with PIE.
But when -linkshared is passed, the default compiler flags are not used so this
does not apply. And now I've found a system (linux/arm64 with glibc 2.27) where
this combination of flags causes a problem, albeit for reasons I don't really
understand, so stop passing -no-pie when -linkshared is passed.

Fixes golang/go#24873

Change-Id: I412ec7941dc0cb89e6d1b171fc29288aadcb9f20
Reviewed-on: https://go-review.googlesource.com/104815
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 2d26a65f8f1a6fcb0948803589061d99b94fa993)
Reviewed-on: https://go-review.googlesource.com/110035
Run-TryBot: Andrew Bonventre <andybons@golang.org>
src/cmd/link/internal/ld/lib.go