Skip to content

Commit

Permalink
MGMT-15235: Compile with CGO_ENABLED=1 for amd64 (#699)
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/MGMT-15235
To be FIPS-compliant, CGO_ENABLED=1 flag must be
specified for go code.
This flag along with the base image used doesn't
work for architectures other than amd64.
See previous revert PR for more information
#693
  • Loading branch information
CrystalChun committed Aug 10, 2023
1 parent 5d9dce9 commit fd3e8f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ GINKGO_FLAGS = -ginkgo.focus="$(FOCUS)" -ginkgo.v -ginkgo.skip="$(SKIP)" -ginkgo

# Multiarch support. Transform argument passed from docker buidx tool to go build arguments to support cross compiling
GO_BUILD_ARCHITECTURE_VARS := $(if ${TARGETPLATFORM},$(shell echo ${TARGETPLATFORM} | awk -F / '{printf("GOOS=%s GOARCH=%s", $$1, $$2)}'),)
GO_BUILD_VARS := CGO_ENABLED=0 $(GO_BUILD_ARCHITECTURE_VARS)
GO_BUILD_VARS =
ifeq ($(TARGETPLATFORM),linux/amd64)
GO_BUILD_VARS = CGO_ENABLED=1 $(GO_BUILD_ARCHITECTURE_VARS)
else
GO_BUILD_VARS = CGO_ENABLED=0 $(GO_BUILD_ARCHITECTURE_VARS)
endif


all: lint format-check build-images unit-test

Expand Down

0 comments on commit fd3e8f3

Please sign in to comment.