summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch42
-rw-r--r--recipes-containers/containerd/containerd-opencontainers_git.bb3
2 files changed, 45 insertions, 0 deletions
diff --git a/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch b/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch
new file mode 100644
index 00000000..05c4f153
--- /dev/null
+++ b/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch
@@ -0,0 +1,42 @@
1From 84874e47aa2025b8e73df0286c44f3b8a1d9fdb2 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 2 Sep 2019 16:20:07 +0800
4Subject: [PATCH] Add build option "GODEBUG=1"
5
6Make will generate GDB friendly binary with this build option.
7
8Signed-off-by: Hui Zhu <teawater@hyper.sh>
9
10Upstream-Status: Backport [c5a0c7f491b435e4eb45972903b00e2d8ed46495]
11
12Partly backport and refresh to v1.2.7
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14---
15 src/import/Makefile | 8 ++++++--
16 1 file changed, 6 insertions(+), 2 deletions(-)
17
18diff --git a/src/import/Makefile b/src/import/Makefile
19index 4355395..4fb5d3b 100644
20--- a/src/import/Makefile
21+++ b/src/import/Makefile
22@@ -75,11 +75,15 @@ TEST_REQUIRES_ROOT_PACKAGES=$(filter \
23 COMMANDS=ctr containerd containerd-stress
24 MANPAGES=ctr.1 containerd.1 containerd-config.1 containerd-config.toml.5
25
26+ifndef GODEBUG
27+ EXTRA_LDFLAGS += -s -w
28+endif
29+
30 # Build tags seccomp and apparmor are needed by CRI plugin.
31 BUILDTAGS ?= seccomp apparmor
32 GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
33-GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'
34-SHIM_GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static"'
35+GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'
36+SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static" $(EXTRA_LDFLAGS)'
37
38 #Replaces ":" (*nix), ";" (windows) with newline for easy parsing
39 GOPATHS=$(shell echo ${GOPATH} | tr ":" "\n" | tr ";" "\n")
40--
412.7.4
42
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb
index 424de74e..347eae5d 100644
--- a/recipes-containers/containerd/containerd-opencontainers_git.bb
+++ b/recipes-containers/containerd/containerd-opencontainers_git.bb
@@ -1,6 +1,7 @@
1SRCREV = "fd103cb716352c7e19768e4fed057f71d68902a0" 1SRCREV = "fd103cb716352c7e19768e4fed057f71d68902a0"
2SRC_URI = "git://github.com/containerd/containerd;branch=release/1.2 \ 2SRC_URI = "git://github.com/containerd/containerd;branch=release/1.2 \
3 file://0001-build-use-oe-provided-GO-and-flags.patch \ 3 file://0001-build-use-oe-provided-GO-and-flags.patch \
4 file://0001-Add-build-option-GODEBUG-1.patch \
4 " 5 "
5 6
6include containerd.inc 7include containerd.inc
@@ -9,5 +10,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d
9 10
10CONTAINERD_VERSION = "v1.2.7" 11CONTAINERD_VERSION = "v1.2.7"
11 12
13EXTRA_OEMAKE += "GODEBUG=1"
14
12PROVIDES += "virtual/containerd" 15PROVIDES += "virtual/containerd"
13RPROVIDES_${PN} = "virtual/containerd" 16RPROVIDES_${PN} = "virtual/containerd"