diff mbox series

[blacksail,40/60] libfyaml: Link with libatomic on targets lacking 64-bit atomics

Message ID f4a481233f479d85be4173bf77f62038740e67d0.1793867929.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [blacksail,01/60] gstreamer1.0-plugins-bad: use gtk+3 dependency name | expand

Commit Message

Yoann Congal Nov. 5, 2026, 8:42 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>

libfyaml uses 64-bit atomic operations, which need libatomic on 32-bit
targets such as riscv32, otherwise linking fails with

  error: undefined reference: __atomic_load_8
  error: undefined reference: __atomic_compare_exchange_8

Match on the relevant TUNE_FEATURES (32 for riscv32, armv5, o32 for
mips and m32 for ppc/x86) to add -latomic.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
(cherry picked from commit bea66b4bceddada3ac2fb63e1f7fa1afb500b19b)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/recipes-support/libfyaml/libfyaml_0.9.6.bb | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-support/libfyaml/libfyaml_0.9.6.bb b/meta/recipes-support/libfyaml/libfyaml_0.9.6.bb
index 4c3fe42891f..012ff7052d9 100644
--- a/meta/recipes-support/libfyaml/libfyaml_0.9.6.bb
+++ b/meta/recipes-support/libfyaml/libfyaml_0.9.6.bb
@@ -13,5 +13,7 @@  SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libfyaml-${PV}.tar.gz \
 SRC_URI[sha256sum] = "a59cc3331e2eb903ec36933ad52a45888041cac31e44f553a00511131242c483"
 
 inherit autotools pkgconfig github-releases
+# Specify linking with -latomic on architectures missing 64bit atomics.
+LDFLAGS += "${@bb.utils.contains_any('TUNE_FEATURES', '32 armv5 o32 m32', '-latomic', '', d)}"
 
 BBCLASSEXTEND = "native"