From a1085de5319d1ad5a5227c7f1cb44cef2a6bb085 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Thu, 5 Oct 2017 13:38:18 +0000 Subject: runc: Use correct go cross-compiler The makefiles for both providers of runc need to be patched in similar ways to ensure that we use the binaries from go-cross and not go-native. Signed-off-by: Paul Barker Signed-off-by: Bruce Ashfield --- .../0001-Use-correct-go-cross-compiler.patch | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch (limited to 'recipes-containers/runc/runc-docker') diff --git a/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch b/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch new file mode 100644 index 00000000..8f5171ab --- /dev/null +++ b/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch @@ -0,0 +1,85 @@ +From 037c20b3b3ef5e9ead0282aa64f9b88c0c18934d Mon Sep 17 00:00:00 2001 +From: Paul Barker +Date: Thu, 5 Oct 2017 13:14:40 +0000 +Subject: [PATCH] Use correct go cross-compiler + +We need to use '${GO}' as set by OpenEmbedded instead of just 'go'. Just using +'go' will invoke go-native. + +Signed-off-by: Paul Barker +Upstream-status: Inappropriate +--- + Makefile | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Makefile b/Makefile +index 8117892..0fcf508 100644 +--- a/src/import/Makefile ++++ b/src/import/Makefile +@@ -27,18 +27,18 @@ SHELL := $(shell command -v bash 2>/dev/null) + .DEFAULT: runc + + runc: $(SOURCES) +- go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . ++ $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . + + all: runc recvtty + + recvtty: contrib/cmd/recvtty/recvtty + + contrib/cmd/recvtty/recvtty: $(SOURCES) +- go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty ++ $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty + + static: $(SOURCES) +- CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . +- CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty ++ CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . ++ CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty + + release: + @flag_list=(seccomp selinux apparmor static); \ +@@ -62,15 +62,15 @@ release: + CGO_ENABLED=1; \ + }; \ + echo "Building target: $$output"; \ +- go build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ ++ $(GO) build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ + done + + dbuild: runcimage + docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all + + lint: +- go vet $(allpackages) +- go fmt $(allpackages) ++ $(GO) vet $(allpackages) ++ $(GO) fmt $(allpackages) + + man: + man/md2man-all.sh +@@ -88,7 +88,7 @@ unittest: runcimage + docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest + + localunittest: all +- go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) ++ $(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) + + integration: runcimage + docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration +@@ -134,10 +134,10 @@ clean: + validate: + script/validate-gofmt + script/validate-shfmt +- go vet $(allpackages) ++ $(GO) vet $(allpackages) + + ci: validate localtest + + # memoize allpackages, so that it's executed only once and only if used +-_allpackages = $(shell go list ./... | grep -v vendor) ++_allpackages = $(shell $(GO) list ./... | grep -v vendor) + allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages) +-- +2.7.4 + -- cgit v1.2.3-54-g00ecf