]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
glibc: disable automatic libatomic linking
authorHemanth Kumar M D <Hemanth.KumarMD@windriver.com>
Wed, 27 May 2026 13:35:12 +0000 (06:35 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 May 2026 10:21:29 +0000 (11:21 +0100)
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>
meta/recipes-core/glibc/glibc.inc

index dae087d53f615acee00aced49f4f4e72eb4ad1fc..3bb935e223008ab95554b6762dec96e6cf75cc9b 100644 (file)
@@ -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: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
 }