[Buildroot] [PATCH v1 1/1] package/pkg-golang: enable trimpath option for reproducible builds

Christian Stewart christian at paral.in
Sat Dec 7 19:51:52 UTC 2019


The -trimpath option removes absolute build paths from the target binary. This
results in more consistent / reproducible builds across different systems with
varying paths to Buildroot.

Signed-off-by: Christian Stewart <christian at paral.in>
---
 package/pkg-golang.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index e47de17aba..98f903604c 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -61,6 +61,7 @@ $(2)_WORKSPACE ?= _gopath
 $(2)_BUILD_OPTS += \
 	-ldflags "$$($(2)_LDFLAGS)" \
 	-tags "$$($(2)_TAGS)" \
+  -trimpath \
 	-p $(PARALLEL_JOBS)
 
 # Target packages need the Go compiler on the host.
-- 
2.24.0



More information about the buildroot mailing list