summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch32
-rw-r--r--recipes-containers/containerd/containerd-opencontainers/0001-build-don-t-use-gcflags-to-define-trimpath.patch30
-rw-r--r--recipes-containers/containerd/containerd-opencontainers_git.bb6
3 files changed, 33 insertions, 35 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
deleted file mode 100644
index 8b43c8a0..00000000
--- a/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch
+++ /dev/null
@@ -1,32 +0,0 @@
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
18Index: git/src/import/Makefile
19===================================================================
20--- git.orig/src/import/Makefile 2020-10-12 08:09:41.638977052 -0700
21+++ git/src/import/Makefile 2020-10-12 08:10:49.783074373 -0700
22@@ -72,6 +72,10 @@
23 COMMANDS=ctr containerd containerd-stress
24 MANPAGES=ctr.8 containerd.8 containerd-config.8 containerd-config.toml.5
25
26+ifndef GODEBUG
27+ EXTRA_LDFLAGS += -s -w
28+endif
29+
30 ifdef BUILDTAGS
31 GO_BUILDTAGS = ${BUILDTAGS}
32 endif
diff --git a/recipes-containers/containerd/containerd-opencontainers/0001-build-don-t-use-gcflags-to-define-trimpath.patch b/recipes-containers/containerd/containerd-opencontainers/0001-build-don-t-use-gcflags-to-define-trimpath.patch
new file mode 100644
index 00000000..f1dea5a4
--- /dev/null
+++ b/recipes-containers/containerd/containerd-opencontainers/0001-build-don-t-use-gcflags-to-define-trimpath.patch
@@ -0,0 +1,30 @@
1From 9174091fa1624dbb09ce812792a4102dff693541 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Mon, 12 Sep 2022 15:40:08 -0400
4Subject: [PATCH] build: don't use gcflags to define trimpath
5
6We can pass trimpath in via environment variables. The gcflags
7definition of trimpath is for older go versions and is using the
8complete path for trimming. If the variable is captured in the
9resulting binary, we have a reproducibility and QA issue.
10
11Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
12---
13 Makefile | 1 -
14 1 file changed, 1 deletion(-)
15
16diff --git git.orig/src/import/Makefile git.orig/src/import/Makefile
17index 4a6c13042..debb57925 100644
18--- git.orig/src/import/Makefile
19+++ git.orig/src/import/Makefile
20@@ -130,7 +130,6 @@ TESTFLAGS_RACE=
21 # See Golang issue re: '-trimpath': https://github.com/golang/go/issues/13809
22 GO_GCFLAGS=$(shell \
23 set -- ${GOPATHS}; \
24- echo "-gcflags=-trimpath=$${1}/src"; \
25 )
26
27 BINARIES=$(addprefix bin/,$(COMMANDS))
28--
292.19.1
30
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb
index af91a22b..edc3a5cb 100644
--- a/recipes-containers/containerd/containerd-opencontainers_git.bb
+++ b/recipes-containers/containerd/containerd-opencontainers_git.bb
@@ -7,8 +7,8 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and
7 7
8SRCREV = "579a6380ec93ab92a6e7f26167fe4f18dfcf2a4b" 8SRCREV = "579a6380ec93ab92a6e7f26167fe4f18dfcf2a4b"
9SRC_URI = "git://github.com/containerd/containerd;branch=release/1.6;protocol=https \ 9SRC_URI = "git://github.com/containerd/containerd;branch=release/1.6;protocol=https \
10 file://0001-Add-build-option-GODEBUG-1.patch \
11 file://0001-Makefile-allow-GO_BUILD_FLAGS-to-be-externally-speci.patch \ 10 file://0001-Makefile-allow-GO_BUILD_FLAGS-to-be-externally-speci.patch \
11 file://0001-build-don-t-use-gcflags-to-define-trimpath.patch \
12 " 12 "
13 13
14# Apache-2.0 for containerd 14# Apache-2.0 for containerd
@@ -18,7 +18,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d
18CONTAINERD_VERSION = "v1.6.8" 18CONTAINERD_VERSION = "v1.6.8"
19CVE_VERSION = "1.6.8" 19CVE_VERSION = "1.6.8"
20 20
21EXTRA_OEMAKE += "GODEBUG=1" 21# EXTRA_OEMAKE += "GODEBUG=1"
22 22
23PROVIDES += "virtual/containerd" 23PROVIDES += "virtual/containerd"
24RPROVIDES:${PN} = "virtual-containerd" 24RPROVIDES:${PN} = "virtual-containerd"
@@ -84,7 +84,7 @@ do_compile() {
84 # cannot find package runtime/cgo (using -importcfg) 84 # cannot find package runtime/cgo (using -importcfg)
85 # ... recipe-sysroot-native/usr/lib/aarch64-poky-linux/go/pkg/tool/linux_amd64/link: 85 # ... recipe-sysroot-native/usr/lib/aarch64-poky-linux/go/pkg/tool/linux_amd64/link:
86 # cannot open file : open : no such file or directory 86 # cannot open file : open : no such file or directory
87 export GO_BUILD_FLAGS="-a -pkgdir dontusecurrentpkgs" 87 export GO_BUILD_FLAGS="-trimpath -a -pkgdir dontusecurrentpkgs"
88 export GO111MODULE=off 88 export GO111MODULE=off
89 89
90 cd ${S}/src/import 90 cd ${S}/src/import