]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
go-target: Pass -trimpath to go linker
authorKhem Raj <raj.khem@gmail.com>
Tue, 29 Mar 2022 23:39:53 +0000 (16:39 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Apr 2022 13:14:14 +0000 (14:14 +0100)
This is for improving reproducibility to trim absolute paths as these
recipes do not inherit go bbclass where it would be set automatically

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>
meta/recipes-devtools/go/go-target.inc

index d085643036a146b6b824b49a54884c3841b8317b..ed09cfe8061f99ba2b8690f33d69a1a6f8503c72 100644 (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"