diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2019-09-02 16:36:49 +0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-09-03 16:01:06 -0400 |
| commit | 4846ff50eae9123c436c2660f4a6715ffc0c1b94 (patch) | |
| tree | ff99c5a88ce12ef2c7c7e1770d3d7f315b7e307d | |
| parent | f8568abe01de28e91adaeb636ee0ed89c1d1c8b8 (diff) | |
| download | meta-virtualization-4846ff50eae9123c436c2660f4a6715ffc0c1b94.tar.gz | |
containerd-opencontainers: building unstripped binaries
It defaults to "-s -w" [1] which strips debug information, refresh a backported
patch to build unstripped binaries
https://golang.org/cmd/link/
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch | 42 | ||||
| -rw-r--r-- | recipes-containers/containerd/containerd-opencontainers_git.bb | 3 |
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 @@ | |||
| 1 | From 84874e47aa2025b8e73df0286c44f3b8a1d9fdb2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Mon, 2 Sep 2019 16:20:07 +0800 | ||
| 4 | Subject: [PATCH] Add build option "GODEBUG=1" | ||
| 5 | |||
| 6 | Make will generate GDB friendly binary with this build option. | ||
| 7 | |||
| 8 | Signed-off-by: Hui Zhu <teawater@hyper.sh> | ||
| 9 | |||
| 10 | Upstream-Status: Backport [c5a0c7f491b435e4eb45972903b00e2d8ed46495] | ||
| 11 | |||
| 12 | Partly backport and refresh to v1.2.7 | ||
| 13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 14 | --- | ||
| 15 | src/import/Makefile | 8 ++++++-- | ||
| 16 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/src/import/Makefile b/src/import/Makefile | ||
| 19 | index 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 | -- | ||
| 41 | 2.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 @@ | |||
| 1 | SRCREV = "fd103cb716352c7e19768e4fed057f71d68902a0" | 1 | SRCREV = "fd103cb716352c7e19768e4fed057f71d68902a0" |
| 2 | SRC_URI = "git://github.com/containerd/containerd;branch=release/1.2 \ | 2 | SRC_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 | ||
| 6 | include containerd.inc | 7 | include containerd.inc |
| @@ -9,5 +10,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d | |||
| 9 | 10 | ||
| 10 | CONTAINERD_VERSION = "v1.2.7" | 11 | CONTAINERD_VERSION = "v1.2.7" |
| 11 | 12 | ||
| 13 | EXTRA_OEMAKE += "GODEBUG=1" | ||
| 14 | |||
| 12 | PROVIDES += "virtual/containerd" | 15 | PROVIDES += "virtual/containerd" |
| 13 | RPROVIDES_${PN} = "virtual/containerd" | 16 | RPROVIDES_${PN} = "virtual/containerd" |
