File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 2323GO_BUILD := $(GO ) build -trimpath $(GO_BUILDMODE ) $(EXTRA_FLAGS ) -tags "$(BUILDTAGS ) " \
2424 -ldflags "-X main.gitCommit=$(COMMIT ) -X main.version=$(VERSION ) $(EXTRA_LDFLAGS ) "
2525GO_BUILD_STATIC := CGO_ENABLED=1 $(GO ) build -trimpath $(EXTRA_FLAGS ) -tags "$(BUILDTAGS ) netgo osusergo" \
26- -ldflags "-w - extldflags -static -X main.gitCommit=$(COMMIT ) -X main.version=$(VERSION ) $(EXTRA_LDFLAGS ) "
26+ -ldflags "-extldflags -static -X main.gitCommit=$(COMMIT ) -X main.version=$(VERSION ) $(EXTRA_LDFLAGS ) "
2727
2828.DEFAULT : runc
2929
Original file line number Diff line number Diff line change @@ -43,11 +43,17 @@ function build_project() {
4343 )
4444 mv " $tarball " {,.asc} " $builddir "
4545
46+ # For reproducible builds, add these to EXTRA_LDFLAGS:
47+ # -w to disable DWARF generation;
48+ # -s to disable symbol table;
49+ # -buildid= to remove variable build id.
50+ local ldflags=" -w -s -buildid="
4651 # Add -a to go build flags to make sure it links against
4752 # the provided libseccomp, not the system one (otherwise
4853 # it can reuse cached pkg-config results).
49- make -C " $root " PKG_CONFIG_PATH=" ${prefix} /lib/pkgconfig" COMMIT_NO= EXTRA_FLAGS=" -a" static
54+ make -C " $root " PKG_CONFIG_PATH=" ${prefix} /lib/pkgconfig" COMMIT_NO= EXTRA_FLAGS=" -a" EXTRA_LDFLAGS= " ${ldflags} " static
5055 rm -rf " $prefix "
56+ strip " $root /$project "
5157 mv " $root /$project " " $1 "
5258}
5359
You can’t perform that action at this time.
0 commit comments