dev-libs/protobuf: Fix building on IA64.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Wed, 21 Feb 2018 17:57:00 +0000 (18:57 +0100)
committerMike Gilbert <floppym@gentoo.org>
Wed, 21 Feb 2018 20:32:17 +0000 (15:32 -0500)
Closes: https://bugs.gentoo.org/648248

dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch [new file with mode: 0644]
dev-libs/protobuf/protobuf-3.5.1.1.ebuild

diff --git a/dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch b/dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch
new file mode 100644 (file)
index 0000000..7a88e83
--- /dev/null
@@ -0,0 +1,21 @@
+https://github.com/google/protobuf/issues/3937
+https://github.com/google/protobuf/pull/3955
+https://github.com/google/protobuf/commit/642e1ac635f2563b4a14c255374f02645ae85dac
+
+--- /src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
++++ /src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
+@@ -146,6 +146,14 @@
+   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
index 4f44ebc4d8c796f3497a66c8a7b77709de1a11ad..97cbe92c9220d04c21df3eee97f3c959a6a35594 100644 (file)
@@ -23,16 +23,21 @@ PATCHES=(
        "${FILESDIR}/${PN}-3.4.0-disable_no-warning-test.patch"
        "${FILESDIR}/${PN}-3.4.0-system_libraries.patch"
        "${FILESDIR}/${PN}-3.4.0-protoc_input_output_files.patch"
+       "${FILESDIR}/${PN}-3.5.0-atomic_operations.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
-       append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
        default
        eautoreconf
 }
 
+src_configure() {
+       append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+       multilib-minimal_src_configure
+}
+
 multilib_src_configure() {
        local myeconfargs=(
                $(use_enable static-libs static)