From 929372946aeb85953d1ca6acc428d73fbac52a56 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 30 Jun 2020 23:21:42 -0400 Subject: docker-ce/docker-moby: fixup GO compiler calls With oe-core commit c23f9e80492e4b [tcmode-default: use go-binary-native by default], we must explictly call the proper cross go binary, versus just the go-native variant. These builds were working by luck, since the go compiler was capable of building the target binaries previously (in its build-from-source creation). We fixup the calls and we no longer see fpu build issues: fatal error: gnu/stubs-soft.h: No such file or directory 7 | # include | ^~~~~~~~~~~~~~~~~~ This commit also moves the docker-ce patches from "files" to a named directory to reduce confusion. Signed-off-by: Bruce Ashfield --- .../0001-cli-use-go-cross-compiler.patch | 25 +++++++++ .../0001-dynbinary-use-go-cross-compiler.patch | 26 ++++++++++ .../0001-libnetwork-use-GO-instead-of-go.patch | 59 ++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 recipes-containers/docker/docker-moby/0001-cli-use-go-cross-compiler.patch create mode 100644 recipes-containers/docker/docker-moby/0001-dynbinary-use-go-cross-compiler.patch create mode 100644 recipes-containers/docker/docker-moby/0001-libnetwork-use-GO-instead-of-go.patch (limited to 'recipes-containers/docker/docker-moby') diff --git a/recipes-containers/docker/docker-moby/0001-cli-use-go-cross-compiler.patch b/recipes-containers/docker/docker-moby/0001-cli-use-go-cross-compiler.patch new file mode 100644 index 00000000..9419d547 --- /dev/null +++ b/recipes-containers/docker/docker-moby/0001-cli-use-go-cross-compiler.patch @@ -0,0 +1,25 @@ +From ae6f4a1e685394fb7b9539f134b66ca84ddc91c2 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Tue, 30 Jun 2020 22:19:56 -0400 +Subject: [PATCH] cli: use go cross compiler + +Signed-off-by: Bruce Ashfield +--- + git/cli/scripts/build/dynbinary | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git git/cli/scripts/build/dynbinary git/cli/scripts/build/dynbinary +index 4feb7e71d8..f990d0e040 100755 +--- git/cli/scripts/build/dynbinary ++++ git/cli/scripts/build/dynbinary +@@ -9,6 +9,6 @@ source ./scripts/build/.variables + + echo "Building dynamically linked $TARGET" + export CGO_ENABLED=1 +-go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}" ++${GO} build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}" + + ln -sf "$(basename "${TARGET}")" build/docker +-- +2.19.1 + diff --git a/recipes-containers/docker/docker-moby/0001-dynbinary-use-go-cross-compiler.patch b/recipes-containers/docker/docker-moby/0001-dynbinary-use-go-cross-compiler.patch new file mode 100644 index 00000000..d9cdfb01 --- /dev/null +++ b/recipes-containers/docker/docker-moby/0001-dynbinary-use-go-cross-compiler.patch @@ -0,0 +1,26 @@ +From bbf600cc4d46c3f7ec0c1b486790a2402d41f550 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Tue, 30 Jun 2020 22:23:33 -0400 +Subject: [PATCH] dynbinary: use go cross compiler + +Signed-off-by: Bruce Ashfield +--- + hack/make/.binary | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/import/hack/make/.binary b/src/import/hack/make/.binary +index 53de6749e5..47ab2a754f 100644 +--- a/src/import/hack/make/.binary ++++ b/src/import/hack/make/.binary +@@ -81,7 +81,7 @@ esac + + echo "Building: $DEST/$BINARY_FULLNAME" + echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\"" +-go build \ ++${GO} build \ + -o "$DEST/$BINARY_FULLNAME" \ + "${BUILDFLAGS[@]}" \ + -ldflags " +-- +2.19.1 + diff --git a/recipes-containers/docker/docker-moby/0001-libnetwork-use-GO-instead-of-go.patch b/recipes-containers/docker/docker-moby/0001-libnetwork-use-GO-instead-of-go.patch new file mode 100644 index 00000000..c623b260 --- /dev/null +++ b/recipes-containers/docker/docker-moby/0001-libnetwork-use-GO-instead-of-go.patch @@ -0,0 +1,59 @@ +From 04c07804930faad708218a3134c81de06a9c742a Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Fri, 6 Apr 2018 23:58:22 -0400 +Subject: [PATCH] libnetwork: use $(GO) instead of go + +Ensure that the libnetwork makefile uses the go cross flags and +utilities. + +Signed-off-by: Bruce Ashfield +--- + Makefile | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +Index: git/libnetwork/Makefile +=================================================================== +--- git.orig/libnetwork/Makefile ++++ git/libnetwork/Makefile +@@ -45,9 +45,9 @@ + build-local: + @echo "🐳 $@" + @mkdir -p "bin" +- go build -tags experimental -o "bin/dnet" ./cmd/dnet +- go build -o "bin/docker-proxy" ./cmd/proxy +- CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic ++ $(GO) build -tags experimental -o "bin/dnet" ./cmd/dnet ++ $(GO) build -o "bin/proxy" ./cmd/proxy ++ CGO_ENABLED=0 $(GO) build -o "bin/diagnosticClient" ./cmd/diagnostic + CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go + + build-images: +@@ -82,8 +82,8 @@ + + cross-local: + @echo "🐳 $@" +- go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet +- go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy ++ @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy ++ @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet + + # Rebuild protocol buffers. + # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt. +@@ -130,7 +130,7 @@ + if ls $$dir/*.go &> /dev/null; then \ + pushd . &> /dev/null ; \ + cd $$dir ; \ +- go test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \ ++ $(GO) test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \ + ret=$$? ;\ + if [ $$ret -ne 0 ]; then exit $$ret; fi ;\ + popd &> /dev/null; \ +@@ -145,7 +145,7 @@ + # Depends on binaries because vet will silently fail if it can not load compiled imports + vet: ## run go vet + @echo "🐳 $@" +- @test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)" ++ @test -z "$$($(GO) vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)" + + misspell: + @echo "🐳 $@" -- cgit v1.2.3-54-g00ecf