From d50441a8aabb1cb8b8da86ebc3e2d5da92ed7bd3 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 19 Aug 2024 11:21:38 +0200 Subject: [PATCH] build: attempt at reproducible builds --- build/ci.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/ci.go b/build/ci.go index 009d69e6e4..d4022c27fb 100644 --- a/build/ci.go +++ b/build/ci.go @@ -251,7 +251,11 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) ( if runtime.GOOS == "linux" { // Enforce the stacksize to 8M, which is the case on most platforms apart from // alpine Linux. - extld := []string{"-Wl,-z,stack-size=0x800000"} + // See https://sourceware.org/binutils/docs-2.23.1/ld/Options.html#Options + // regarding the options --build-id=none and --strip-all. It is needed for + // reproducible builds; removing references to temporary files in C-land, and + // making build-id reproducably absent. + extld := []string{"-Wl,-z,stack-size=0x800000,--build-id=none,--strip-all"} if staticLinking { extld = append(extld, "-static") // Under static linking, use of certain glibc features must be