diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2023-07-07 10:44:24 +0200 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-07-11 19:06:28 +0000 |
| commit | 84f5cb62de4c639817ebd5534d240b9cf78a1b32 (patch) | |
| tree | 38a4010fb5460dd66e79875d27772ec95e355774 | |
| parent | a19092ce81339a129edce745522eebf577efc744 (diff) | |
| download | meta-virtualization-84f5cb62de4c639817ebd5534d240b9cf78a1b32.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 | ||
