From cc5e41ffb029ed61711e14368e66083e22a6ba38 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 30 Jun 2020 23:42:03 -0400 Subject: docker-distribution: fix for GO cross compilation 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 | ^~~~~~~~~~~~~~~~~~ Signed-off-by: Bruce Ashfield --- .../docker-distribution/docker-distribution_git.bb | 1 + .../0001-build-use-to-use-cross-go-compiler.patch | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch diff --git a/recipes-containers/docker-distribution/docker-distribution_git.bb b/recipes-containers/docker-distribution/docker-distribution_git.bb index 4bf3c6e5..692438ec 100644 --- a/recipes-containers/docker-distribution/docker-distribution_git.bb +++ b/recipes-containers/docker-distribution/docker-distribution_git.bb @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314" SRCREV_distribution="2461543d988979529609e8cb6fca9ca190dc48da" SRC_URI = "git://github.com/docker/distribution.git;branch=release/2.7;name=distribution;destsuffix=git/src/github.com/docker/distribution \ file://docker-registry.service \ + file://0001-build-use-to-use-cross-go-compiler.patch \ " PACKAGES =+ "docker-registry" diff --git a/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch b/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch new file mode 100644 index 00000000..393b167f --- /dev/null +++ b/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch @@ -0,0 +1,29 @@ +From 9c27a12dc0bc62b95d7ecf003e7d241b36c3f2e6 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Tue, 30 Jun 2020 23:35:05 -0400 +Subject: [PATCH] build: use to use cross go compiler + +We shouldn't be invoking 'go' as the compiler, but instead use +${GO} which tracks our cross build go compiler for the architecture. + +Signed-off-by: Bruce Ashfield +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 4635c6ec..a95e860e 100644 +--- a/Makefile ++++ b/Makefile +@@ -88,7 +88,7 @@ FORCE: + # Build a binary from a cmd. + bin/%: cmd/% FORCE + @echo "$(WHALE) $@${BINARY_SUFFIX}" +- @go build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< ++ @${GO} build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< + + binaries: $(BINARIES) ## build binaries + @echo "$(WHALE) $@" +-- +2.19.1 + -- cgit v1.2.3-54-g00ecf