diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2023-06-29 10:17:09 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-07-05 23:46:19 -0400 |
commit | 0cc4d01dcbcaf1aa880b4ccc55c46b9ed343bef4 (patch) | |
tree | 10c871f5eae239aac7674ac2f24f04b03ee4bb9d | |
parent | 3ce3ef94866483aecd10dce426c8ac91602339f2 (diff) | |
download | meta-virtualization-0cc4d01dcbcaf1aa880b4ccc55c46b9ed343bef4.tar.gz |
cni: fix textrel QA issue
When building cni, we get textrel QA issue like below:
cni: ELF binary /usr/libexec/cni/macvlan has relocations in .text
The problem could be solved by adding '-buildmode=pie' to ${GO}.
In go.bbclass, this flag is added to GOBUILDFLAGS conditionally,
that is, if the arch is not mips nor riscv32, this '-buildmode=pie'
is added to GOBUILDFLAGS. So make use of that.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-networking/cni/cni_git.bb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb index 35aea39a..06cef81f 100644 --- a/recipes-networking/cni/cni_git.bb +++ b/recipes-networking/cni/cni_git.bb | |||
@@ -38,10 +38,10 @@ do_compile() { | |||
38 | export GO111MODULE=off | 38 | export GO111MODULE=off |
39 | 39 | ||
40 | cd ${B}/src/github.com/containernetworking/cni/libcni | 40 | cd ${B}/src/github.com/containernetworking/cni/libcni |
41 | ${GO} build -trimpath | 41 | ${GO} build ${GOBUILDFLAGS} |
42 | 42 | ||
43 | cd ${B}/src/github.com/containernetworking/cni/cnitool | 43 | cd ${B}/src/github.com/containernetworking/cni/cnitool |
44 | ${GO} build -trimpath | 44 | ${GO} build ${GOBUILDFLAGS} |
45 | 45 | ||
46 | cd ${B}/src/github.com/containernetworking/plugins | 46 | cd ${B}/src/github.com/containernetworking/plugins |
47 | PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" | 47 | PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" |
@@ -49,7 +49,7 @@ do_compile() { | |||
49 | for p in $PLUGINS; do | 49 | for p in $PLUGINS; do |
50 | plugin="$(basename "$p")" | 50 | plugin="$(basename "$p")" |
51 | echo "building: $p" | 51 | echo "building: $p" |
52 | ${GO} build -trimpath -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p | 52 | ${GO} build ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p |
53 | done | 53 | done |
54 | } | 54 | } |
55 | 55 | ||