All of lore.kernel.org
 help / color / mirror / Atom feed
* [mickledore][PATCH] cni: fix textrel QA issue
@ 2023-07-07  8:44 Martin Jansa
  2023-07-11 19:06 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Jansa @ 2023-07-07  8:44 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Chen Qi, Bruce Ashfield

From: Chen Qi <Qi.Chen@windriver.com>

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>
---
 recipes-networking/cni/cni_git.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb
index 35aea39..06cef81 100644
--- a/recipes-networking/cni/cni_git.bb
+++ b/recipes-networking/cni/cni_git.bb
@@ -38,10 +38,10 @@ do_compile() {
 	export GO111MODULE=off
 
 	cd ${B}/src/github.com/containernetworking/cni/libcni
-	${GO} build -trimpath
+	${GO} build ${GOBUILDFLAGS}
 
 	cd ${B}/src/github.com/containernetworking/cni/cnitool
-	${GO} build -trimpath
+	${GO} build ${GOBUILDFLAGS}
 
 	cd ${B}/src/github.com/containernetworking/plugins
 	PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)"
@@ -49,7 +49,7 @@ do_compile() {
 	for p in $PLUGINS; do
 	    plugin="$(basename "$p")"
 	    echo "building: $p"
-	    ${GO} build -trimpath -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
+	    ${GO} build ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
 	done
 }
 
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [mickledore][PATCH] cni: fix textrel QA issue
  2023-07-07  8:44 [mickledore][PATCH] cni: fix textrel QA issue Martin Jansa
@ 2023-07-11 19:06 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2023-07-11 19:06 UTC (permalink / raw)
  To: Martin Jansa; +Cc: meta-virtualization, Chen Qi

In message: [mickledore][PATCH] cni: fix textrel QA issue
on 07/07/2023 Martin Jansa wrote:

> From: Chen Qi <Qi.Chen@windriver.com>
> 
> 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.

merged.

Bruce

> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>  recipes-networking/cni/cni_git.bb | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb
> index 35aea39..06cef81 100644
> --- a/recipes-networking/cni/cni_git.bb
> +++ b/recipes-networking/cni/cni_git.bb
> @@ -38,10 +38,10 @@ do_compile() {
>  	export GO111MODULE=off
>  
>  	cd ${B}/src/github.com/containernetworking/cni/libcni
> -	${GO} build -trimpath
> +	${GO} build ${GOBUILDFLAGS}
>  
>  	cd ${B}/src/github.com/containernetworking/cni/cnitool
> -	${GO} build -trimpath
> +	${GO} build ${GOBUILDFLAGS}
>  
>  	cd ${B}/src/github.com/containernetworking/plugins
>  	PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)"
> @@ -49,7 +49,7 @@ do_compile() {
>  	for p in $PLUGINS; do
>  	    plugin="$(basename "$p")"
>  	    echo "building: $p"
> -	    ${GO} build -trimpath -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
> +	    ${GO} build ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
>  	done
>  }
>  
> -- 
> 2.41.0
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-11 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  8:44 [mickledore][PATCH] cni: fix textrel QA issue Martin Jansa
2023-07-11 19:06 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.