nerdctl: fix do_compile failed

Using latest poky + meta-virtualization + meta-openembedded, build multlib failed

...local.conf...
MACHINE = "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "x86"

$ bitbake lib32-nerdctl
...
-buildmode=pie requires external (cgo) linking, but cgo is not enabled
make: *** [Makefile:63: nerdctl] Error 1
...

Get back the patch to allow external specification of build settings and rebase to v2.0.2

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
hongxu 2025-02-10 15:46:58 +08:00 committed by Bruce Ashfield
parent c0fac810d9
commit 2b0e119d5c
2 changed files with 19 additions and 12 deletions

View File

@ -6,20 +6,26 @@ Subject: [PATCH] Makefile: allow external specification of build settings
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: nerdctl-v2.0.0-beta.1/src/import/Makefile
===================================================================
--- nerdctl-v2.0.0-beta.1.orig/src/import/Makefile
+++ nerdctl-v2.0.0-beta.1/src/import/Makefile
@@ -38,7 +38,7 @@
Rebase to v2.0.2
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
src/import/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/import/Makefile b/src/import/Makefile
index ae4e18c..eb22f9f 100644
--- a/src/import/Makefile
+++ b/src/import/Makefile
@@ -45,7 +45,7 @@ endif
GO_BUILD_LDFLAGS ?= -s -w
GO_BUILD_FLAGS ?=
-export GO_BUILD=GO111MODULE=on CGO_ENABLED=0 GOOS=$(GOOS) $(GO) build -ldflags "$(GO_BUILD_LDFLAGS) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
+export GO_BUILD=$(GO) build -ldflags "$(GO_BUILD_LDFLAGS) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
-export GO_BUILD=CGO_ENABLED=0 GOOS=$(GOOS) $(GO) -C $(MAKEFILE_DIR) build -ldflags "$(GO_BUILD_LDFLAGS) $(VERBOSE_FLAG) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
+export GO_BUILD=GOOS=$(GOOS) $(GO) -C $(MAKEFILE_DIR) build -ldflags "$(GO_BUILD_LDFLAGS) $(VERBOSE_FLAG) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
ifdef VERBOSE
VERBOSE_FLAG := -v
recursive_wildcard=$(wildcard $1$2) $(foreach e,$(wildcard $1*),$(call recursive_wildcard,$e/,$2))
--
2.34.1

View File

@ -19,6 +19,7 @@ include src_uri.inc
# patches and config
SRC_URI += " \
file://0001-Makefile-allow-external-specification-of-build-setti.patch \
file://modules.txt \
"