From 84439a1cac9492dfeb6b940fb8811472d13a9862f1cefe242adf9531638c3cc0 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 23 Feb 2018 10:53:55 +0000 Subject: [PATCH] Accepting request 579462 from home:mlin7442:branches:devel:tools:building add upstream patch to fix compile error on s390x OBS-URL: https://build.opensuse.org/request/show/579462 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=60 --- ...elease_CompareAndSwap-64-bit-variant.patch | 31 +++++++++++++++++++ protobuf.changes | 8 +++++ protobuf.spec | 3 ++ 3 files changed, 42 insertions(+) create mode 100644 adding-Release_CompareAndSwap-64-bit-variant.patch diff --git a/adding-Release_CompareAndSwap-64-bit-variant.patch b/adding-Release_CompareAndSwap-64-bit-variant.patch new file mode 100644 index 0000000..7c90723 --- /dev/null +++ b/adding-Release_CompareAndSwap-64-bit-variant.patch @@ -0,0 +1,31 @@ +From 642e1ac635f2563b4a14c255374f02645ae85dac Mon Sep 17 00:00:00 2001 +From: Nayana-ibm +Date: Mon, 27 Nov 2017 05:43:30 -0500 +Subject: [PATCH] Adding Release_CompareAndSwap 64-bit variant + +--- + src/google/protobuf/stubs/atomicops_internals_generic_gcc.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h +index 0b0b06ce..075c406a 100644 +--- a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h ++++ b/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 +-- +2.16.1 + diff --git a/protobuf.changes b/protobuf.changes index ad11f93..12207ea 100644 --- a/protobuf.changes +++ b/protobuf.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Feb 23 10:12:07 UTC 2018 - mlin@suse.com + +- Add adding-Release_CompareAndSwap-64-bit-variant.patch + * Fix compile error undefined reference to + `google::protobuf::internal::Release_CompareAndSwap(long volatile*, long, long)' + on s390x https://github.com/google/protobuf/issues/3937 + ------------------------------------------------------------------- Mon Jan 22 16:50:28 UTC 2018 - tchvatal@suse.com diff --git a/protobuf.spec b/protobuf.spec index 50f248d..f6d1f92 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -34,6 +34,8 @@ Url: https://github.com/google/protobuf/ Source0: https://github.com/google/protobuf/archive/v%{version}.tar.gz#/%{tarname}-%{version}.tar.gz Source1: manifest.txt.in Source2: baselibs.conf +# PATCH-FIX-UPSTREAM Adding Release_CompareAndSwap 64-bit variant to fix compile error - mlin@suse.com +Patch0: adding-Release_CompareAndSwap-64-bit-variant.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module python-dateutil} BuildRequires: %{python_module python-gflags} @@ -128,6 +130,7 @@ This package contains the Python bindings for Google Protocol Buffers. %prep %setup -q -n %{tarname}-%{version} +%patch0 -p1 mkdir gmock %if %{with python2} || %{with python3}