From 81f285a67c874a7d45fdf16d1af96dcf791a8590 Mon Sep 17 00:00:00 2001 From: panchenbo Date: Sat, 12 Aug 2023 14:47:37 +0800 Subject: [PATCH] add loongarch64 and sw_64 support (cherry picked from commit 50ef2e5f5b251fc3f2bfa91e89ce0d2d7e2f7c6d) --- 3000-add-sw_64-support.patch | 14 ++++++++++++++ 3001-add-loongarch64-support.patch | 27 +++++++++++++++++++++++++++ protobuf2.spec | 10 +++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 3000-add-sw_64-support.patch create mode 100644 3001-add-loongarch64-support.patch diff --git a/3000-add-sw_64-support.patch b/3000-add-sw_64-support.patch new file mode 100644 index 0000000..7390bf2 --- /dev/null +++ b/3000-add-sw_64-support.patch @@ -0,0 +1,14 @@ +diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h +index db691d8..0a5bcef 100644 +--- a/src/google/protobuf/stubs/platform_macros.h ++++ b/src/google/protobuf/stubs/platform_macros.h +@@ -69,6 +69,9 @@ + #elif defined(__s390__) + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 + #define GOOGLE_PROTOBUF_ARCH_S390 1 ++#elif defined(__sw_64__) ++#define GOOGLE_PROTOBUF_ARCH_SW_64 1 ++#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 + #else + #error Host architecture was not detected as supported by protobuf + #endif diff --git a/3001-add-loongarch64-support.patch b/3001-add-loongarch64-support.patch new file mode 100644 index 0000000..8fafce6 --- /dev/null +++ b/3001-add-loongarch64-support.patch @@ -0,0 +1,27 @@ +From 112b961833d582207565a6929b0e68d6f5e22af7 Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Mon, 8 May 2023 14:10:13 +0800 +Subject: [PATCH] Add support loongarch64 + +Signed-off-by: yangchenguang +--- + src/google/protobuf/stubs/platform_macros.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h +index 0a5bcef..d3597a5 100644 +--- a/src/google/protobuf/stubs/platform_macros.h ++++ b/src/google/protobuf/stubs/platform_macros.h +@@ -72,6 +72,9 @@ + #elif defined(__sw_64__) + #define GOOGLE_PROTOBUF_ARCH_SW_64 1 + #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 ++#elif defined(__loongarch64) ++#define GOOGLE_PROTOBUF_ARCH_LA64 1 ++#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 + #else + #error Host architecture was not detected as supported by protobuf + #endif +-- +2.33.0 + diff --git a/protobuf2.spec b/protobuf2.spec index 9ec6fcb..70e6029 100644 --- a/protobuf2.spec +++ b/protobuf2.spec @@ -6,7 +6,7 @@ Summary: Protocol Buffers - Google's data interchange format Name: protobuf2 Version: 2.5.0 -Release: 3 +Release: 4 License: BSD Source: http://protobuf.googlecode.com/files/protobuf-%{version}.tar.bz2 Source1: ftdetect-proto.vim @@ -15,6 +15,9 @@ Patch1: protobuf-2.5.0-gtest.patch Patch2: protobuf-2.5.0-java-fixes.patch Patch3: 0001-Add-generic-GCC-support-for-atomic-operations.patch Patch4: protobuf-2.5.0-makefile.patch + +Patch3000: 3000-add-sw_64-support.patch +Patch3001: 3001-add-loongarch64-support.patch URL: http://code.google.com/p/protobuf/ BuildRequires: automake autoconf libtool pkgconfig zlib-devel emacs emacs-el >= 24.1 maven-plugin-bundle gcc-c++ %if %{with gtest} @@ -134,6 +137,8 @@ rm -rf java/src/test %endif %patch3 -p1 -b .generic-atomics %patch4 -p1 -b .generic-atomics-makefile +%patch3000 -p1 -b .add-sw_64-support +%patch3001 -p1 -b .add-loongarch64-support %build iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 @@ -241,6 +246,9 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir} %endif %changelog +* Sat Aug 12 2023 panchenbo - 2.5.0-4 +- add loongarch64 and sw_64 support + * Wed Aug 18 2021 lingsheng - 2.5.0-3 - Modify subpackage's install require -- Gitee