]> Cypherpunks repositories - gostls13.git/commit
cmd/link: suppress PIE whenever externally linking with a sanitizer
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 31 May 2016 07:24:30 +0000 (19:24 +1200)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 31 May 2016 20:57:57 +0000 (20:57 +0000)
commit2c1791b13b27dfc69adf2d19ecf9a180d089cd22
treed49cbac5ae99adb7471837af0dc9ea3cf68da430
parent2a6544b604b61898d666ffbe456ccde720c04577
cmd/link: suppress PIE whenever externally linking with a sanitizer

golang.org/issue/15443 complained that a race-enabled PIE binary crashed at
startup, but other ways of linking in tsan (or other sanitizers) such as

 #cgo CFLAGS: -fsanitize=thread
 #cgo LDFLAGS: -fsanitize=thread

have the same problem. Pass -no-pie to the host linker (if supported) if any
-fsanitizer=foo cgo LDFLAG is seen when linking.

Fixes #15887

Change-Id: Id799770f8d045f6f40fa8c463563937a5748d1a8
Reviewed-on: https://go-review.googlesource.com/23535
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go