From 5e90c3c84a47fa74774b084019758d7c3a8d10c5 Mon Sep 17 00:00:00 2001 From: Jagannathan Raman Date: Fri, 11 Oct 2024 00:43:21 -0400 Subject: [PATCH] build: enable cgo cgo allows the use of C libraries in GoLang. Some packages like sqlite3 depend on this feature. We could allow this, barring any security issues (e.g., we can't confirm the hash of a C library before linking it). Signed-off-by: Jagannathan Raman --- mk/cmd.mk | 2 +- mk/plugin.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/cmd.mk b/mk/cmd.mk index 865d9988..12b3ba03 100644 --- a/mk/cmd.mk +++ b/mk/cmd.mk @@ -36,7 +36,7 @@ _check_scheme_loader: fi $(CMD): $(SRCS) $(CMD_DEPS) _check_scheme_loader _check_version - go build -o $(CMD) -ldflags \ + CGO_ENABLED=1 go build -o $(CMD) -ldflags \ "-X 'github.com/veraison/services/config.Version=$(VERSION_FROM_GIT)' \ -X 'github.com/veraison/services/config.SchemeLoader=$(SCHEME_LOADER)'" diff --git a/mk/plugin.mk b/mk/plugin.mk index 3402eb73..12480bcd 100644 --- a/mk/plugin.mk +++ b/mk/plugin.mk @@ -22,7 +22,7 @@ else DFLAGS := endif -$(PLUGIN): $(SRCS) ; go build $(DFLAGS) -o $(PLUGIN) +$(PLUGIN): $(SRCS) ; CGO_ENABLED=1 go build $(DFLAGS) -o $(PLUGIN) .PHONY: all all: all-hook-pre realall