diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2023-12-11 10:53:19 +0100 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-12-14 19:59:10 +0000 |
commit | 33f31493ed2b233c75e2a2316b7f3323d23aa9d3 (patch) | |
tree | 7a6b6984c513e4a7e31037ff4279c1d932dc8e56 /recipes-networking | |
parent | 2efdfa20a4767aa5959468737496475fc26481e7 (diff) | |
download | meta-virtualization-33f31493ed2b233c75e2a2316b7f3323d23aa9d3.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>
Diffstat (limited to 'recipes-networking')
-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 fd9115ab..854c7a04 100644 --- a/recipes-networking/cni/cni_git.bb +++ b/recipes-networking/cni/cni_git.bb | |||
@@ -39,10 +39,10 @@ do_compile() { | |||
39 | export GO111MODULE=off | 39 | export GO111MODULE=off |
40 | 40 | ||
41 | cd ${B}/src/github.com/containernetworking/cni/libcni | 41 | cd ${B}/src/github.com/containernetworking/cni/libcni |
42 | ${GO} build -trimpath | 42 | ${GO} build ${GOBUILDFLAGS} |
43 | 43 | ||
44 | cd ${B}/src/github.com/containernetworking/cni/cnitool | 44 | cd ${B}/src/github.com/containernetworking/cni/cnitool |
45 | ${GO} build -trimpath | 45 | ${GO} build ${GOBUILDFLAGS} |
46 | 46 | ||
47 | cd ${B}/src/github.com/containernetworking/plugins | 47 | cd ${B}/src/github.com/containernetworking/plugins |
48 | PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" | 48 | PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" |
@@ -50,7 +50,7 @@ do_compile() { | |||
50 | for p in $PLUGINS; do | 50 | for p in $PLUGINS; do |
51 | plugin="$(basename "$p")" | 51 | plugin="$(basename "$p")" |
52 | echo "building: $p" | 52 | echo "building: $p" |
53 | ${GO} build -trimpath -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p | 53 | ${GO} build ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p |
54 | done | 54 | done |
55 | } | 55 | } |
56 | 56 | ||