Skip to content

Commit

Permalink
Merge pull request #75 from caseydavenport/casey-use-cgo
Browse files Browse the repository at this point in the history
Use CGO to enable boringssl
  • Loading branch information
caseydavenport authored Oct 12, 2021
2 parents fa9ba6f + f4e7bc7 commit ebb83b8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME?=github.com/projectcalico/pod2daemon
GO_BUILD_VER?=v0.53
GO_BUILD_VER?=v0.58

ORGANIZATION=projectcalico
SEMAPHORE_PROJECT_ID?=$(SEMAPHORE_POD2DAEMON_PROJECT_ID)
Expand Down Expand Up @@ -39,6 +39,13 @@ include Makefile.common

###############################################################################

# We need CGO to leverage Boring SSL. However, the cross-compile doesn't support CGO yet.
ifeq ($(ARCH), $(filter $(ARCH),amd64))
CGO_ENABLED=1
else
CGO_ENABLED=0
endif

SRC_FILES=$(shell find -name '*.go')

.PHONY: clean
Expand Down Expand Up @@ -72,7 +79,7 @@ bin/flexvol-armv7: ARCH=armv7
bin/flexvol-ppc64le: ARCH=ppc64le
bin/flexvol-s390x: ARCH=s390x
bin/flexvol-%: $(SRC_FILES)
$(DOCKER_RUN) $(CALICO_BUILD) go build -v -o bin/flexvol-$(ARCH) flexvol/flexvoldriver.go
$(DOCKER_RUN) -e CGO_ENABLED=$(CGO_ENABLED) $(CALICO_BUILD) go build -v -o bin/flexvol-$(ARCH) flexvol/flexvoldriver.go

###############################################################################
# Building the image
Expand Down

0 comments on commit ebb83b8

Please sign in to comment.