All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH] nerdctl: fix textrel QA issue
@ 2023-09-20  5:18 Qi.Chen
  2023-09-25  1:23 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Qi.Chen @ 2023-09-20  5:18 UTC (permalink / raw)
  To: meta-virtualization

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

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>
---
 recipes-containers/nerdctl/nerdctl_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/recipes-containers/nerdctl/nerdctl_git.bb b/recipes-containers/nerdctl/nerdctl_git.bb
index 62460a52..f68223df 100644
--- a/recipes-containers/nerdctl/nerdctl_git.bb
+++ b/recipes-containers/nerdctl/nerdctl_git.bb
@@ -51,6 +51,8 @@ PACKAGECONFIG ?= ""
 # sets the "sites" variable.
 include relocation.inc
 
+PIEFLAG = "${@bb.utils.contains('GOBUILDFLAGS', '-buildmode=pie', '-buildmode=pie', '', d)}"
+
 do_compile() {
 
     	cd ${S}/src/import
@@ -64,7 +66,7 @@ do_compile() {
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 
-	export GOFLAGS="-mod=vendor -trimpath"
+	export GOFLAGS="-mod=vendor -trimpath ${PIEFLAG}"
 
 	# our copied .go files are to be used for the build
 	ln -sf vendor.copy vendor
-- 
2.40.0



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

* Re: [meta-virtualization][PATCH] nerdctl: fix textrel QA issue
  2023-09-20  5:18 [meta-virtualization][PATCH] nerdctl: fix textrel QA issue Qi.Chen
@ 2023-09-25  1:23 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2023-09-25  1:23 UTC (permalink / raw)
  To: Qi.Chen; +Cc: meta-virtualization

merged.

Bruce

In message: [meta-virtualization][PATCH] nerdctl: fix textrel QA issue
on 19/09/2023 Chen Qi via lists.yoctoproject.org wrote:

> From: Chen Qi <Qi.Chen@windriver.com>
> 
> 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>
> ---
>  recipes-containers/nerdctl/nerdctl_git.bb | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/recipes-containers/nerdctl/nerdctl_git.bb b/recipes-containers/nerdctl/nerdctl_git.bb
> index 62460a52..f68223df 100644
> --- a/recipes-containers/nerdctl/nerdctl_git.bb
> +++ b/recipes-containers/nerdctl/nerdctl_git.bb
> @@ -51,6 +51,8 @@ PACKAGECONFIG ?= ""
>  # sets the "sites" variable.
>  include relocation.inc
>  
> +PIEFLAG = "${@bb.utils.contains('GOBUILDFLAGS', '-buildmode=pie', '-buildmode=pie', '', d)}"
> +
>  do_compile() {
>  
>      	cd ${S}/src/import
> @@ -64,7 +66,7 @@ do_compile() {
>  	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
>  	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
>  
> -	export GOFLAGS="-mod=vendor -trimpath"
> +	export GOFLAGS="-mod=vendor -trimpath ${PIEFLAG}"
>  
>  	# our copied .go files are to be used for the build
>  	ln -sf vendor.copy vendor
> -- 
> 2.40.0
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8313): https://lists.yoctoproject.org/g/meta-virtualization/message/8313
> Mute This Topic: https://lists.yoctoproject.org/mt/101473054/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



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

end of thread, other threads:[~2023-09-25  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20  5:18 [meta-virtualization][PATCH] nerdctl: fix textrel QA issue Qi.Chen
2023-09-25  1:23 ` 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.