Skip to content

Commit 693e40a

Browse files
authored
build: attempt at reproducible builds (#30321)
This PR implements the conclusions from #28987 (comment), that is: Building with `--strip-all` as a ld-flag to the cgo linker, to remove symbols. Without that, some spurious reference to a temporary file is included into the kzg-related library. Building with `--build-id=none`, to avoid putting a `build id` into the file.
1 parent fc88cea commit 693e40a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build/ci.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (
249249
if runtime.GOOS == "linux" {
250250
// Enforce the stacksize to 8M, which is the case on most platforms apart from
251251
// alpine Linux.
252-
extld := []string{"-Wl,-z,stack-size=0x800000"}
252+
// See https://sourceware.org/binutils/docs-2.23.1/ld/Options.html#Options
253+
// regarding the options --build-id=none and --strip-all. It is needed for
254+
// reproducible builds; removing references to temporary files in C-land, and
255+
// making build-id reproducably absent.
256+
extld := []string{"-Wl,-z,stack-size=0x800000,--build-id=none,--strip-all"}
253257
if staticLinking {
254258
extld = append(extld, "-static")
255259
// Under static linking, use of certain glibc features must be

0 commit comments

Comments
 (0)