[v2,4/4] go-target: Pass -trimpath to go linker

Message ID 20220328180707.3565916-4-raj.khem@gmail.com
State Accepted, archived
Commit 365dae4e47b956b39fb62d9c6dcb917a11b37cba
Headers show
Series [v2,1/4] go: Upgrade to 1.18 | expand

Commit Message

Khem Raj March 28, 2022, 6:07 p.m. UTC
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>
---
 meta/recipes-devtools/go/go-target.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index d085643036a..aaaaa125f79 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -13,8 +13,8 @@  export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${@ ' '.join(filter(lambda f: not f.startswith('-fdebug-prefix-map'), d.getVar('LDFLAGS').split())) }"
 
 export GOCACHE = "${B}/.cache"
-GO_LDFLAGS = ""
-GO_LDFLAGS:class-nativesdk = "-linkmode external"
+GO_LDFLAGS = "-trimpath"
+GO_LDFLAGS:append:class-nativesdk = " -linkmode external"
 export GO_LDFLAGS
 
 CC:append:class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"