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
[RP: Tweaked to use append]
Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
# bash but it can be configured by setting KSHELL Makefile variable
EXTRA_OEMAKE += "KSHELL=/bin/sh"
+TARGET_CC_ARCH:append:toolchain-gcc = " -fno-link-libatomic"
+SDK_CC_ARCH:append:toolchain-gcc = " -fno-link-libatomic"
+
do_configure:prepend() {
sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in
}