From 0a1c6f83e7c8565783820d541003188f6021895d Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Tue, 17 Dec 2024 17:38:37 +0800 Subject: [PATCH] fix build error for loongarch64 --- 0001-fix-build-error-for-loongarch64.patch | 25 ++++++++++++++++++++++ protobuf2.spec | 7 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0001-fix-build-error-for-loongarch64.patch diff --git a/0001-fix-build-error-for-loongarch64.patch b/0001-fix-build-error-for-loongarch64.patch new file mode 100644 index 0000000..5417b13 --- /dev/null +++ b/0001-fix-build-error-for-loongarch64.patch @@ -0,0 +1,25 @@ +From d90339371ef462a9197189bf7e08cb26dbb2818d Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Tue, 17 Dec 2024 09:36:25 +0000 +Subject: [PATCH] fix build error for loongarch64 + +--- + src/google/protobuf/stubs/platform_macros.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h +index 3e17fea..5b07aaf 100644 +--- a/src/google/protobuf/stubs/platform_macros.h ++++ b/src/google/protobuf/stubs/platform_macros.h +@@ -69,7 +69,7 @@ + #elif defined(__s390__) + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 + #define GOOGLE_PROTOBUF_ARCH_S390 1 +-#elif defined(_LOONGARCH_ARCH_LOONGARCH64) ++#elif defined(__loongarch64) + #define GOOGLE_PROTOBUF_ARCH_LOONGARCH64 1 + #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 + #else +-- +2.43.0 + diff --git a/protobuf2.spec b/protobuf2.spec index c318cef..0372405 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: 5 +Release: 6 License: BSD Source: http://protobuf.googlecode.com/files/protobuf-%{version}.tar.bz2 Source1: ftdetect-proto.vim @@ -17,6 +17,7 @@ Patch3: 0001-Add-generic-GCC-support-for-atomic-operations.patch Patch4: protobuf-2.5.0-makefile.patch Patch5: 0001-protobuf2-add-support-for-loongarch64.patch Patch6: add-riscv64-support.patch +Patch7: 0001-fix-build-error-for-loongarch64.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} @@ -138,6 +139,7 @@ rm -rf java/src/test %patch4 -p1 -b .generic-atomics-makefile %ifarch loongarch64 %patch5 -p1 +%patch7 -p1 %endif %ifarch riscv64 %patch6 -p1 @@ -249,6 +251,9 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir} %endif %changelog +* Tue Dec 17 2024 Wenlong Zhang - 2.5.0-6 +- fix build error for loongarch64 + * Mon Jul 17 2023 zhangxiang - 2.5.0-5 - add riscv64 support -- Gitee