diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2023-09-19 22:18:03 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-09-25 01:23:34 +0000 |
commit | b65fe24b8cbcf8797f31d058a79f8a21985e955d (patch) | |
tree | b0e32b713fd5f1c3756c89c1ecb896b8d411e0ce | |
parent | 5510a784fffd4fee89bc068d2689e865dfa0b9c3 (diff) | |
download | meta-virtualization-b65fe24b8cbcf8797f31d058a79f8a21985e955d.tar.gz |
nerdctl: fix textrel QA issue
Fix the following QA issue:
ERROR: QA Issue: nerdctl: ELF binary /usr/bin/nerdctl has relocations in .text [textrel]
We want to use -buildmode=pie, in order to avoid duplicating codes with
go.bbclass, make use of GOBUILDFLAGS.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/nerdctl/nerdctl_git.bb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/recipes-containers/nerdctl/nerdctl_git.bb b/recipes-containers/nerdctl/nerdctl_git.bb index 892629fe..4e65405e 100644 --- a/recipes-containers/nerdctl/nerdctl_git.bb +++ b/recipes-containers/nerdctl/nerdctl_git.bb | |||
@@ -49,6 +49,8 @@ PACKAGECONFIG ?= "" | |||
49 | # sets the "sites" variable. | 49 | # sets the "sites" variable. |
50 | include relocation.inc | 50 | include relocation.inc |
51 | 51 | ||
52 | PIEFLAG = "${@bb.utils.contains('GOBUILDFLAGS', '-buildmode=pie', '-buildmode=pie', '', d)}" | ||
53 | |||
52 | do_compile() { | 54 | do_compile() { |
53 | 55 | ||
54 | cd ${S}/src/import | 56 | cd ${S}/src/import |
@@ -62,7 +64,7 @@ do_compile() { | |||
62 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | 64 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
63 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | 65 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
64 | 66 | ||
65 | export GOFLAGS="-mod=vendor -trimpath" | 67 | export GOFLAGS="-mod=vendor -trimpath ${PIEFLAG}" |
66 | 68 | ||
67 | # our copied .go files are to be used for the build | 69 | # our copied .go files are to be used for the build |
68 | ln -sf vendor.copy vendor | 70 | ln -sf vendor.copy vendor |