summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2018-04-19 16:49:41 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-04-20 10:03:50 -0400
commitfcc09c8c3639ca5c529d4f28db9b1d090331739f (patch)
treeb7bb1e0b27ef1b600508c4dfb9080269c173e84c
parent7d2ee2dfa266f339d57823a72560ca2fcf01bd49 (diff)
downloadmeta-virtualization-fcc09c8c3639ca5c529d4f28db9b1d090331739f.tar.gz
runc/containerd: fix build with go 1.9.x
go 1.9.x was triggering linkage errors on some build hosts due to missing symbols. | tmp/work/core2-64-poky-linux/runc-docker/1.0.0-rc5+gitAUTOINC+4fc53a81fb-r0/recipe-sysroot/usr/lib/../lib/libc.a(dl-reloc-static-pie.o): In function `elf_mac: | /usr/src/debug/glibc/2.27-r0/git/sysdeps/x86_64/dl-machine.h:59: undefined reference to `_DYNAMIC' | tmp/work/core2-64-poky-linux/runc-docker/1.0.0-rc5+gitAUTOINC+4fc53a81fb-r0/recipe-sysroot/usr/lib/../lib/libc.a(dl-reloc-static-pie.o): In function `elf_get: | /usr/src/debug/glibc/2.27-r0/git/elf/get-dynamic-info.h:48: undefined reference to `_DYNAMIC' By ensuring that our sysroot provided go binary and build flags make it into the build enviroment we can build properly with 1.9 and 1.10 Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/containerd/containerd-opencontainers_git.bb2
-rw-r--r--recipes-containers/containerd/containerd.inc2
-rw-r--r--recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch (renamed from recipes-containers/containerd/files/0001-containerd-shim-build-with-CGO.patch)10
-rw-r--r--recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch23
-rw-r--r--recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch27
-rw-r--r--recipes-containers/runc/runc-docker_git.bb2
-rw-r--r--recipes-containers/runc/runc.inc2
7 files changed, 37 insertions, 31 deletions
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb
index 316eea74..c6b4f5e4 100644
--- a/recipes-containers/containerd/containerd-opencontainers_git.bb
+++ b/recipes-containers/containerd/containerd-opencontainers_git.bb
@@ -1,6 +1,6 @@
1SRCREV = "cfd04396dc68220d1cecbe686a6cc3aa5ce3667c" 1SRCREV = "cfd04396dc68220d1cecbe686a6cc3aa5ce3667c"
2SRC_URI = "git://github.com/containerd/containerd;nobranch=1 \ 2SRC_URI = "git://github.com/containerd/containerd;nobranch=1 \
3 file://0001-containerd-shim-build-with-CGO.patch \ 3 file://0001-build-use-oe-provided-GO-and-flags.patch \
4 " 4 "
5 5
6include containerd.inc 6include containerd.inc
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc
index 9f66e46e..eb47cc9e 100644
--- a/recipes-containers/containerd/containerd.inc
+++ b/recipes-containers/containerd/containerd.inc
@@ -53,6 +53,8 @@ do_compile() {
53 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" 53 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
54 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" 54 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
55 export BUILDTAGS="no_btrfs static_build netgo" 55 export BUILDTAGS="no_btrfs static_build netgo"
56 export CFLAGS="${CFLAGS}"
57 export LDFLAGS="${LDFLAGS}"
56 58
57 cd ${S}/src/import 59 cd ${S}/src/import
58 oe_runmake binaries 60 oe_runmake binaries
diff --git a/recipes-containers/containerd/files/0001-containerd-shim-build-with-CGO.patch b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch
index 3b890834..75a984be 100644
--- a/recipes-containers/containerd/files/0001-containerd-shim-build-with-CGO.patch
+++ b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch
@@ -1,7 +1,7 @@
1From a1d2db9037b1302c4ce4cfc170a4fa443f68e594 Mon Sep 17 00:00:00 2001 1From e31acef290181434efaf47e70db7ad0d92dbe300 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com> 2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Thu, 29 Mar 2018 15:48:41 -0400 3Date: Thu, 19 Apr 2018 17:09:51 -0400
4Subject: [PATCH] containerd-shim: build with CGO 4Subject: [PATCH] build: use oe provided GO and flags
5 5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> 6Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
7--- 7---
@@ -9,7 +9,7 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
9 1 file changed, 1 insertion(+), 1 deletion(-) 9 1 file changed, 1 insertion(+), 1 deletion(-)
10 10
11diff --git a/src/import/Makefile b/src/import/Makefile 11diff --git a/src/import/Makefile b/src/import/Makefile
12index 9d8cf8a18fbc..1dff4e3c2043 100644 12index 9d8cf8a18fbc..492d033fe2a7 100644
13--- a/src/import/Makefile 13--- a/src/import/Makefile
14+++ b/src/import/Makefile 14+++ b/src/import/Makefile
15@@ -134,7 +134,7 @@ bin/%: cmd/% FORCE 15@@ -134,7 +134,7 @@ bin/%: cmd/% FORCE
@@ -17,7 +17,7 @@ index 9d8cf8a18fbc..1dff4e3c2043 100644
17 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 17 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
18 @echo "$(WHALE) bin/containerd-shim" 18 @echo "$(WHALE) bin/containerd-shim"
19- @CGO_ENABLED=0 go build -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim 19- @CGO_ENABLED=0 go build -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
20+ @go build -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim 20+ @$(GO) build -o bin/containerd-shim ${SHIM_GO_LDFLAGS} $(GOBUILDFLAGS) ${GO_TAGS} ./cmd/containerd-shim
21 21
22 binaries: $(BINARIES) ## build binaries 22 binaries: $(BINARIES) ## build binaries
23 @echo "$(WHALE) $@" 23 @echo "$(WHALE) $@"
diff --git a/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch b/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch
deleted file mode 100644
index 8de1b170..00000000
--- a/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1From aa2fc7b0eacba61175f083cc8d8adc233bcd0575 Mon Sep 17 00:00:00 2001
2From: Paul Barker <pbarker@toganlabs.com>
3Date: Thu, 12 Oct 2017 11:34:24 +0000
4Subject: [PATCH] Disable building recvtty
5
6Signed-off-by: Paul Barker <pbarker@toganlabs.com>
7Upstream-status: Inappropriate
8---
9 Makefile | 1 -
10 1 file changed, 1 deletion(-)
11
12Index: git/src/import/Makefile
13===================================================================
14--- git.orig/src/import/Makefile
15+++ git/src/import/Makefile
16@@ -40,7 +40,6 @@
17
18 static: $(SOURCES)
19 CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
20- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
21
22 release:
23 script/release.sh -r release/$(VERSION) -v $(VERSION)
diff --git a/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch b/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch
new file mode 100644
index 00000000..f885aaf7
--- /dev/null
+++ b/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch
@@ -0,0 +1,27 @@
1From a9a2b9e72027d0b2357f6dfe8b154762aaa8dd02 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Thu, 19 Apr 2018 16:39:41 -0400
4Subject: [PATCH] build: drop recvtty and use GOBUILDFLAGS
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
7---
8 Makefile | 3 +--
9 1 file changed, 1 insertion(+), 2 deletions(-)
10
11diff --git a/src/import/Makefile b/src/import/Makefile
12index c6de11d..0e9bddb 100644
13--- a/src/import/Makefile
14+++ b/src/import/Makefile
15@@ -39,8 +39,7 @@ contrib/cmd/recvtty/recvtty: $(SOURCES)
16 $(GO) build -buildmode=pie $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
17
18 static: $(SOURCES)
19- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
20- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
21+ CGO_ENABLED=1 $(GO) build -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" $(GOBUILDFLAGS) -o runc .
22
23 release:
24 script/release.sh -r release/$(VERSION) -v $(VERSION)
25--
262.7.4
27
diff --git a/recipes-containers/runc/runc-docker_git.bb b/recipes-containers/runc/runc-docker_git.bb
index 9acfbae4..81e5a5d4 100644
--- a/recipes-containers/runc/runc-docker_git.bb
+++ b/recipes-containers/runc/runc-docker_git.bb
@@ -5,7 +5,7 @@ include runc.inc
5SRCREV_runc-docker = "4fc53a81fb7c994640722ac585fa9ca548971871" 5SRCREV_runc-docker = "4fc53a81fb7c994640722ac585fa9ca548971871"
6SRC_URI = "git://github.com/opencontainers/runc;nobranch=1;name=runc-docker \ 6SRC_URI = "git://github.com/opencontainers/runc;nobranch=1;name=runc-docker \
7 file://0001-runc-Add-console-socket-dev-null.patch \ 7 file://0001-runc-Add-console-socket-dev-null.patch \
8 file://0001-Disable-building-recvtty.patch \ 8 file://0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch \
9 file://0001-runc-docker-SIGUSR1-daemonize.patch \ 9 file://0001-runc-docker-SIGUSR1-daemonize.patch \
10 " 10 "
11 11
diff --git a/recipes-containers/runc/runc.inc b/recipes-containers/runc/runc.inc
index ec017225..9199cef9 100644
--- a/recipes-containers/runc/runc.inc
+++ b/recipes-containers/runc/runc.inc
@@ -51,7 +51,7 @@ do_compile() {
51 export CFLAGS="" 51 export CFLAGS=""
52 export LDFLAGS="" 52 export LDFLAGS=""
53 53
54 oe_runmake static 54 oe_runmake static
55} 55}
56 56
57do_install() { 57do_install() {