On Wed, 2026-05-27 at 06:35 -0700, Hemanth Kumar M D via lists.openembedded.org 
wrote:
> From: Hemanth Kumar M D <[email protected]>
> 
> GCC 16 introduced -flink-libatomic which automatically injects
> -latomic_asneeded into link commands via LINK_LIBATOMIC_SPEC.
> When glibc is built with a GCC 16 cross-compiler, the compiler
> would attempt to link against libatomic which does not exist yet
> at this stage.(libatomic is built later as part of gcc-runtime)
> 
> Link: 
> https://github.com/gcc-mirror/gcc/commit/e63cf4b130b86dd7dde1bf499d3d40faca10ea2e
> 
> Signed-off-by: Hemanth Kumar M D <[email protected]>
> ---
>  meta/recipes-core/glibc/glibc.inc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/recipes-core/glibc/glibc.inc 
> b/meta/recipes-core/glibc/glibc.inc
> index dae087d53f..91fabe14a8 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -46,6 +46,9 @@ EXTRA_OEMAKE += "SHELL=/bin/bash"
>  # bash but it can be configured by setting KSHELL Makefile variable
>  EXTRA_OEMAKE += "KSHELL=/bin/sh"
>  
> +TARGET_CC_ARCH:toolchain-gcc += "-fno-link-libatomic"
> +SDK_CC_ARCH:toolchain-gcc += "-fno-link-libatomic"
> +
>  do_configure:prepend() {
>       sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in
>  }

I think using the override is causing the default flags in TARGET_CC_ARCH to be 
lost, resulting in errors like:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3912
https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/3837
https://autobuilder.yoctoproject.org/valkyrie/#/builders/40/builds/3790
https://autobuilder.yoctoproject.org/valkyrie/#/builders/42/builds/3768

I think it needs to be:

TARGET_CC_ARCH:append:toolchain-gcc = " -fno-link-libatomic"
SDK_CC_ARCH:append:toolchain-gcc = " -fno-link-libatomic"

I will retest with that.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#237694): 
https://lists.openembedded.org/g/openembedded-core/message/237694
Mute This Topic: https://lists.openembedded.org/mt/119512437/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to