summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2020-10-15 10:52:22 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-10-15 10:52:22 -0400
commit80d83eacda410377e36d6e90db4f07d71888adbb (patch)
treec7a28c11ce083fc1337b572d9e1b4db79b9e11da
parentf59d55ec570f50db5d3d14e9bb0736c6eb56a049 (diff)
downloadmeta-virtualization-80d83eacda410377e36d6e90db4f07d71888adbb.tar.gz
containerd: fix x86-64 build
Since our oe-core go infrastructure insists on both -pie and static builds (for the most part), and that is not recommended by many packages, we end up with errors like: containerd-opencontainers/v1.4.1+gitAUTOINC+e44e8ebeaa-r0/git/src/import/cmd/containerd-shim cannot find package runtime/cgo (using -importcfg) containerd-opencontainers/v1.4.1+gitAUTOINC+e44e8ebeaa-r0/recipe-sysroot-native/usr/lib/x86_64-overc-linux/go/pkg/tool/linux_amd64/link: cannot open file : open : no such file or directory In a similar manner to: https://www.yoctoproject.org/pipermail/meta-virtualization/2019-March/004084.html We introduce '-a -pkgdir dontusecurrentpkgs' to mask/fix the problem, and continue to work towards non-static builds. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/containerd/containerd.inc2
-rw-r--r--recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch6
2 files changed, 4 insertions, 4 deletions
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc
index 1f8ce47a..319e1981 100644
--- a/recipes-containers/containerd/containerd.inc
+++ b/recipes-containers/containerd/containerd.inc
@@ -64,7 +64,7 @@ do_compile() {
64 export BUILDTAGS="no_btrfs static_build netgo" 64 export BUILDTAGS="no_btrfs static_build netgo"
65 export CFLAGS="${CFLAGS}" 65 export CFLAGS="${CFLAGS}"
66 export LDFLAGS="${LDFLAGS}" 66 export LDFLAGS="${LDFLAGS}"
67 export SHIM_CGO_ENABLED=${CGO_ENABLED} 67 export SHIM_CGO_ENABLED="${CGO_ENABLED}"
68 68
69 cd ${S}/src/import 69 cd ${S}/src/import
70 oe_runmake binaries 70 oe_runmake binaries
diff --git a/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch
index a709d125..a58feed1 100644
--- a/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch
+++ b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch
@@ -54,17 +54,17 @@ Index: git/src/import/Makefile
54 bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 54 bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
55 @echo "$(WHALE) bin/containerd-shim" 55 @echo "$(WHALE) bin/containerd-shim"
56- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim 56- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
57+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim 57+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build -a -pkgdir dontusecurrentpkgs ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
58 58
59 bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 59 bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
60 @echo "$(WHALE) bin/containerd-shim-runc-v1" 60 @echo "$(WHALE) bin/containerd-shim-runc-v1"
61- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 61- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
62+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 62+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build -a -pkgdir dontusecurrentpkgs ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
63 63
64 bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 64 bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
65 @echo "$(WHALE) bin/containerd-shim-runc-v2" 65 @echo "$(WHALE) bin/containerd-shim-runc-v2"
66- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2 66- @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
67+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2 67+ @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build -a -pkgdir dontusecurrentpkgs ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
68 68
69 binaries: $(BINARIES) ## build binaries 69 binaries: $(BINARIES) ## build binaries
70 @echo "$(WHALE) $@" 70 @echo "$(WHALE) $@"