diff mbox series

[2/2] go.bbclass: set buildid to empty string to improve reproducibility

Message ID 20251208091148.368769-2-changqing.li@windriver.com
State New
Headers show
Series [1/2] go.bbclass: change GOTMPDIR to improve reproducibility | expand

Commit Message

Changqing Li Dec. 8, 2025, 9:11 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

Seems there are other things making Go BuildID not reproducible, set
buildid to empty string to improve reproducibility, open a new issue
[1], and refer an old issue [2].

Refer:
[1] https://github.com/golang/go/issues/76743
[2] https://github.com/golang/go/issues/34186

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/classes-recipe/go.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass
index ed986ff5d4..2593368af7 100644
--- a/meta/classes-recipe/go.bbclass
+++ b/meta/classes-recipe/go.bbclass
@@ -50,7 +50,7 @@  GO_RPATH:class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE
 GO_RPATH_LINK:class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}"
 GO_LINKMODE ?= ""
-GO_EXTRA_LDFLAGS ?= ""
+GO_EXTRA_LDFLAGS ?= "-buildid="
 GO_LINUXLOADER ?= "-I ${@get_linuxloader(d)}"
 # Use system loader. If uninative is used, the uninative loader will be patched automatically
 GO_LINUXLOADER:class-native = ""