Skip to contentSkip to conversation

libcereal: Link libatomics on mips for ptests

PATCH New Khem Raj 1 participant 1 message Mar 11, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libcereal: Link libatomics on mips for ptests

clang/mips emits calls to atomic builtins which it expects from C runtime perhaps but compiler-rt does not provide them so link in libatomics

Fixes
atomic.cpp:(.text._ZN6cereal12Inpu tArchiveINS_16JSONInputArchiveELj0EE7processIRNSt3__16atomicIdEEEEvOT_[_ZN6cereal12InputArchiveINS_16JSONInputArchiveELj0EE7processIRNSt3__16atomicIdEEEEvOT_]+0x10c): undefined reference to `__atomic_store_8'

---
 meta-oe/recipes-support/libcereal/libcereal_1.3.2.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta-oe/recipes-support/libcereal/libcereal_1.3.2.bb +3 -2
index 250ea97f40..fb37de3c30 100644
@@ -26,9 +26,10 @@ S = "${WORKDIR}/git"
 
 inherit cmake pkgconfig ptest
 
-PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"
-PACKAGECONFIG[with-tests] = "-DWITH_WERROR=OFF -DBUILD_TESTS=ON,,"
+LIBATOMIC:mips:toolchain-clang = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCEREAL_THREAD_LIBS="-latomic"', '', d)}"
 
+PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"
+PACKAGECONFIG[with-tests] = "-DWITH_WERROR=OFF -DBUILD_TESTS=ON ${LIBATOMIC},,"
 EXTRA_OECMAKE = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '', '-DJUST_INSTALL_CEREAL=ON', d)} \
                  ${@['','-DSKIP_PORTABILITY_TEST=ON'][d.getVar('SITEINFO_BITS') != '32']}"
 
Signature · 1 line
2.35.1