go-target: Pass -trimpath to go linker

This is for improving reproducibility to trim absolute paths as these
recipes do not inherit go bbclass where it would be set automatically

(From OE-Core rev: 365dae4e47b956b39fb62d9c6dcb917a11b37cba)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2022-03-29 16:39:53 -07:00
committed by Richard Purdie
parent 4e0d6af832
commit 4eeb2afd0e

View File

@@ -14,9 +14,9 @@ export CGO_LDFLAGS = "${@ ' '.join(filter(lambda f: not f.startswith('-fdebug-pr
export GOCACHE = "${B}/.cache"
GO_LDFLAGS = ""
GO_LDFLAGS:class-nativesdk = "-linkmode external"
GO_LDFLAGS:class-nativesdk = " -linkmode external"
export GO_LDFLAGS
export GOBUILDFLAGS = "-gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -trimpath"
CC:append:class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
do_configure[noexec] = "1"