diff mbox series

[meta-oe] protobuf: Add -latomic to CXXFLAGS

Message ID 20250324063331.3015703-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] protobuf: Add -latomic to CXXFLAGS | expand

Commit Message

Khem Raj March 24, 2025, 6:33 a.m. UTC
Adding to LDFLAGS works with LLD linker but not with BFD ld since it
gets added before the abseil-cpp libraries on linker cmdline which does
not link it and still finds the atomic function like `__atomic_store_8'
as missing

Use mipsarcho32 for override which covers both mips and mipsel

Thanks for suggestions - RAED [1]

[1] https://github.com/openembedded/meta-openembedded/pull/952

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb
index 9d49e0d3e4..30b805e6b1 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb
@@ -22,8 +22,7 @@  SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=29.x;protocol=ht
            file://0001-fix-protobuf-native-build-failure-with-gcc-10.patch \
            file://0001-utf8_range-add-version-marker-to-library-19009.patch \
            "
-SRC_URI:append:mips:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
-SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
+SRC_URI:append:mipsarcho32:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
 
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.(25\.(\d+)))"
 
@@ -51,7 +50,8 @@  EXTRA_OECMAKE += "\
 TEST_SRC_DIR = "examples"
 LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
 
-LDFLAGS:append:riscv32 = " -latomic"
+CXXFLAGS:append:mipsarcho32 = " -latomic"
+CXXFLAGS:append:riscv32 = " -latomic"
 
 do_compile_ptest() {
 	mkdir -p "${B}/${TEST_SRC_DIR}"