Control: tags -1 + patch

This patch get rid of the missing symbol in
build/temp.linux-riscv64-cpython-313/third_party/protobuf/src/google/protobuf/arena.o.
I've pushed the fix to salsa.

diff --git a/debian/patches/0020-generic-64-compareandswap.patch 
b/debian/patches/0020-generic-64-compareandswap.patch
new file mode 100644
index 0000000..77792e7
--- /dev/null
+++ b/debian/patches/0020-generic-64-compareandswap.patch
@@ -0,0 +1,32 @@
+Description:Adding Release_CompareAndSwap 64-bit variant
+ While building Protobuf v3.5.0 (latest stable) facing an issue:
+ undefined reference to
pere@minerva:~/src/debian/python-grpc-tools-salsa$ 
pere@minerva:~/src/debian/python-grpc-tools-salsa$ 
pere@minerva:~/src/debian/python-grpc-tools-salsa$ git diff --staged|cat
diff --git a/debian/patches/0020-generic-64-compareandswap.patch 
b/debian/patches/0020-generic-64-compareandswap.patch
new file mode 100644
index 0000000..77792e7
--- /dev/null
+++ b/debian/patches/0020-generic-64-compareandswap.patch
@@ -0,0 +1,32 @@
+Description:Adding Release_CompareAndSwap 64-bit variant
+ While building Protobuf v3.5.0 (latest stable) facing an issue:
+ undefined reference to
+ `google::protobuf::internal::Release_CompareAndSwap(long volatile*,
+ long, long)'
+
+ Need to add 64-bit version for function : Release_CompareAndSwap
+
+ I had already raised an issue here : #3937
+Author: Nayana-ibn
+Origin: https://github.com/protocolbuffers/protobuf/pull/3955
+Last-updated: 2025-04-21
+---
+diff --git 
a/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
 
b/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
+index 0b0b06c..075c406 100644
+--- 
a/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
++++ 
b/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
+@@ -146,6 +146,14 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* 
ptr) {
+   return __atomic_load_n(ptr, __ATOMIC_RELAXED);
+ }
+ 
++inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
++                                       Atomic64 old_value,
++                                       Atomic64 new_value) {
++  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
++                              __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
++  return old_value;
++}
++
+ #endif // defined(__LP64__)
+ 
+ }  // namespace internal
diff --git a/debian/patches/series b/debian/patches/series
index 8b93e47..af82d44 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 setuptools-60
 cython-0.29.32
+0020-generic-64-compareandswap.patch
-- 
Happy hacking
Petter Reinholdtsen

Reply via email to