diff --git a/0002-add-loongarch64-base-support.patch b/0002-add-loongarch64-base-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..7668697f95aa338198fd592655040380cd1dcd5e --- /dev/null +++ b/0002-add-loongarch64-base-support.patch @@ -0,0 +1,65 @@ +From 6b68fbafbd04067e8944e4dfce7f750e771618ee Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Tue, 15 Nov 2022 17:11:56 +0800 +Subject: [PATCH] add loongarch64 base support + +--- + .../src/3rdparty/pdfium/pdfium/build/build_config.h | 5 +++++ + .../allocator/partition_allocator/page_allocator_constants.h | 4 ++-- + .../partition_allocator/partition_alloc_constants.h | 2 +- + 3 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/build/build_config.h b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/build/build_config.h +index ef6d460..18af0f8 100644 +--- a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/build/build_config.h ++++ b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/build/build_config.h +@@ -174,6 +174,11 @@ + #elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__) + #define ARCH_CPU_32_BITS 1 + #define ARCH_CPU_LITTLE_ENDIAN 1 ++#elif defined(__loongarch__) ++#define ARCH_CPU_LOONGARCH_FAMILY 1 ++#define ARCH_CPU_LOONGARCH64 1 ++#define ARCH_CPU_64_BITS 1 ++#define ARCH_CPU_LITTLE_ENDIAN 1 + #elif defined(__MIPSEL__) + #if defined(__LP64__) + #define ARCH_CPU_MIPS_FAMILY 1 +diff --git a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h +index 0b94503..17e29ec 100644 +--- a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h ++++ b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h +@@ -13,7 +13,7 @@ namespace pdfium { + namespace base { + #if defined(OS_WIN) || defined(ARCH_CPU_PPC64) + static constexpr size_t kPageAllocationGranularityShift = 16; // 64KB +-#elif defined(_MIPS_ARCH_LOONGSON) ++#elif defined(_MIPS_ARCH_LOONGSON) || defined(ARCH_CPU_LOONGARCH64) + static constexpr size_t kPageAllocationGranularityShift = 14; // 16KB + #elif defined(ARCH_CPU_SW64) + static constexpr size_t kPageAllocationGranularityShift = 13; // 8KB +@@ -29,7 +29,7 @@ static constexpr size_t kPageAllocationGranularityOffsetMask = + static constexpr size_t kPageAllocationGranularityBaseMask = + ~kPageAllocationGranularityOffsetMask; + +-#if defined(_MIPS_ARCH_LOONGSON) ++#if defined(_MIPS_ARCH_LOONGSON) || defined(ARCH_CPU_LOONGARCH64) + static constexpr size_t kSystemPageSize = 16384; + #elif defined(ARCH_CPU_PPC64) + // Modern ppc64 systems support 4KB and 64KB page sizes. +diff --git a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h +index 28323b2..da9fb66 100644 +--- a/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h ++++ b/3rdparty/deepin-pdfium/src/3rdparty/pdfium/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h +@@ -36,7 +36,7 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; + // other constant values, we pack _all_ `PartitionRootGeneric::Alloc` sizes + // perfectly up against the end of a system page. + +-#if defined(_MIPS_ARCH_LOONGSON) ++#if defined(_MIPS_ARCH_LOONGSON) || defined(ARCH_CPU_LOONGARCH64) + static const size_t kPartitionPageShift = 16; // 64 KiB + #elif defined(ARCH_CPU_PPC64) + static const size_t kPartitionPageShift = 18; // 256 KiB +-- +2.20.1 + diff --git a/deepin-reader.spec b/deepin-reader.spec index b275f5a915ed4313bf96f5d89059f005ced59b7c..2d39f0633104d02777edbc9408a97e2e0b062e54 100644 --- a/deepin-reader.spec +++ b/deepin-reader.spec @@ -1,12 +1,14 @@ +%global anolis_release .0.1 Name: deepin-reader Version: 5.9.13 -Release: 2%{?dist}.01 +Release: 3%{anolis_release}%{?dist} Summary: A simple PDF reader, supporting bookmarks, highlights and annotations License: GPLv3+ URL: https://github.com/linuxdeepin/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch1: 0001-remove-docx-from-support-format.patch +Patch2: 0002-add-loongarch64-base-support.patch BuildRequires: gcc-c++ BuildRequires: glibc-headers @@ -65,6 +67,9 @@ popd #/usr/lib/deepin-reader/libdeepin-poppler* %changelog +* Tue Nov 15 2022 liweiganga - 5.9.13-3.0.1 +- feat: add loongarch64 base support + * Thu Jul 21 2022 liuxingwei liuxingwei@uniontech.com - 5.9.13-2.01 - rebuild for an8.6