Re: [meta-virtualization][PATCH] yq: fix do_compile failure caused by CGO_ENABLED="0"

Bruce Ashfield <[email protected]> Thu, 9 Apr 2026 13:52:10 +0000
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <[email protected]>
merged.

Bruce

In message: [meta-virtualization][PATCH] yq: fix do_compile failure caused by CGO_ENABLED="0"
on 08/04/2026 Li Zhou via lists.yoctoproject.org wrote:

> New version of yq need set CGO_ENABLED="0" when compiling,
> and this causes do_compile failure for 32 bits target as below:
> -buildmode=pie requires external (cgo) linking, but cgo is not enabled
> 
> Tool go's internal linker doesn't support PIE for linux 32 bits target,
> so -buildmode=pie requires external (cgo) linking on ARM and x86.
> To fix this conflict with CGO_ENABLED="0", remove "-buildmode=pie"
> from GOBUILDFLAGS.
> 
> Signed-off-by: Li Zhou <[email protected]>
> ---
>  recipes-devtools/yq/yq_git.bb | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/recipes-devtools/yq/yq_git.bb b/recipes-devtools/yq/yq_git.bb
> index ac19f2c4..759cd616 100644
> --- a/recipes-devtools/yq/yq_git.bb
> +++ b/recipes-devtools/yq/yq_git.bb
> @@ -35,6 +35,10 @@ GO_MOD_DISCOVERY_GIT_REF = "${SRCREV_yq}"
>  inherit go goarch ptest
>  inherit go-mod-discovery
>  
> +# GO's internal linker doesn't support PIE for linux 32 bits target,
> +# so -buildmode=pie requires external (cgo) linking on ARM and x86.
> +GOBUILDFLAGS:remove = "-buildmode=pie"
> +
>  do_compile() {
>      cd ${S}/src/import
>  
> -- 
> 2.51.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#9688): https://lists.yoctoproject.org/g/meta-virtualization/message/9688
> Mute This Topic: https://lists.yoctoproject.org/mt/118721968/1050810
> Group Owner: [email protected]
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
>