Skip to content

Commit

Permalink
build: attempt at reproducible builds (#30321)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
holiman authored Aug 20, 2024
1 parent fc88cea commit 693e40a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,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
Expand Down

0 comments on commit 693e40a

Please sign in to comment.