diff options
author | Vishal Tak <vtak@gitlab.com> | 2022-03-28 09:22:05 +0300 |
---|---|---|
committer | Vishal Tak <vtak@gitlab.com> | 2022-03-28 09:22:05 +0300 |
commit | 2e4b84b6ac95087b96e346916b3ced662269b15d (patch) | |
tree | 5edbc6a6c7d540fce04b226b1d537474fe1a03e4 /Makefile.build.mk | |
parent | 65bf4a6024e01fae8b4c88d6e577e3ad145d87d7 (diff) |
Add FIPS support
Changelog: added
Diffstat (limited to 'Makefile.build.mk')
-rw-r--r-- | Makefile.build.mk | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile.build.mk b/Makefile.build.mk index 88d74dbf..806d21db 100644 --- a/Makefile.build.mk +++ b/Makefile.build.mk @@ -1,5 +1,9 @@ BINDIR := $(CURDIR)/bin GO_BUILD_TAGS := continuous_profiler_stackdriver +GO_BUILD_TAGS_FIPS := boringcrypto +ifneq ($(GO_BUILD_TAGS),) + GO_BUILD_TAGS_FIPS := $(GO_BUILD_TAGS),$(GO_BUILD_TAGS_FIPS) +endif # To compute a unique and deterministic value for GNU build-id, we build the Go binary a second time. # From the first build, we extract its unique and deterministic Go build-id, and use that to derive @@ -40,3 +44,14 @@ clean: gitlab-pages: build $Q cp -f $(BINDIR)/gitlab-pages . + +build-fips: .GOPATH/.ok + $Q GOBIN=$(BINDIR) CGO_ENABLED=1 go install $(if $V,-v) -ldflags="$(VERSION_FLAGS)" -tags "${GO_BUILD_TAGS_FIPS}" -buildmode exe $(IMPORT_PATH) +ifndef WITHOUT_BUILD_ID + GO_BUILD_ID=$$( go tool buildid $(BINDIR)/gitlab-pages ) && \ + GNU_BUILD_ID=$$( echo $$GO_BUILD_ID | sha1sum | cut -d' ' -f1 ) && \ + $Q GOBIN=$(BINDIR) CGO_ENABLED=1 go install $(if $V,-v) -ldflags="$(VERSION_FLAGS) -B 0x$$GNU_BUILD_ID" -tags "${GO_BUILD_TAGS_FIPS}" -buildmode exe $(IMPORT_PATH) +endif + +gitlab-pages-fips: build-fips + $Q cp -f $(BINDIR)/gitlab-pages . |