diff --git a/0001-libEMF-Add-loongarch64-support.patch b/0001-libEMF-Add-loongarch64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..60d967e2af64f04105b2e552ec07c805c20c2d28 --- /dev/null +++ b/0001-libEMF-Add-loongarch64-support.patch @@ -0,0 +1,37 @@ +From 416542f9abb6a9928ef883a853fb542a96ffcfdf Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Tue, 9 May 2023 08:46:09 +0800 +Subject: [PATCH] Add loongarch64 support + +Signed-off-by: yangchenguang +--- + include/libEMF/wine/winnt.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/libEMF/wine/winnt.h b/include/libEMF/wine/winnt.h +index 39e2f90..9b88e7a 100644 +--- a/include/libEMF/wine/winnt.h ++++ b/include/libEMF/wine/winnt.h +@@ -69,6 +69,10 @@ + # define WORDS_BIGENDIAN + # define BITFIELDS_BIGENDIAN + # undef ALLOW_UNALIGNED_ACCESS ++#elif defined(__loongarch__) ++# define WORDS_BIGENDIAN ++# define BITFIELDS_BIGENDIAN ++# undef ALLOW_UNALIGNED_ACCESS + #elif !defined(RC_INVOKED) + # error Unknown CPU architecture! + #endif +@@ -1021,7 +1025,7 @@ typedef struct _CONTEXT + #endif /* _ALPHA_ */ + + /* Mips context definitions */ +-#if defined(_MIPS_) || defined(__MIPS__) || defined(__mips__) ++#if defined(_MIPS_) || defined(__MIPS__) || defined(__mips__) || defined(__loongarch__) + + #define CONTEXT_R4000 0x00010000 + +-- +2.33.0 + diff --git a/0002-libEMF-Add-sw_64-support.patch b/0002-libEMF-Add-sw_64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..683710534aa84157a600eef3c90e195f6000982c --- /dev/null +++ b/0002-libEMF-Add-sw_64-support.patch @@ -0,0 +1,42 @@ +diff --git a/include/libEMF/wine/winnt.h b/include/libEMF/wine/winnt.h +index 9b88e7a..3f12199 100644 +--- a/include/libEMF/wine/winnt.h ++++ b/include/libEMF/wine/winnt.h +@@ -41,6 +41,10 @@ + # undef WORDS_BIGENDIAN + # undef BITFIELDS_BIGENDIAN + # undef ALLOW_UNALIGNED_ACCESS ++#elif defined(__sw_64__) ++# undef WORDS_BIGENDIAN ++# undef BITFIELDS_BIGENDIAN ++# undef ALLOW_UNALIGNED_ACCESS + #elif defined(__arm__) + # undef WORDS_BIGENDIAN + # undef BITFIELDS_BIGENDIAN +@@ -270,7 +274,7 @@ typedef unsigned short WORD, *PWORD, *LPWORD; + typedef int INT, *PINT, *LPINT; + typedef unsigned int UINT, *PUINT, *LPUINT; + /* Not sure this is correct. Probably should depend on the compiler, too. */ +-#if defined( __LP64__) || defined(__alpha__) ++#if defined( __LP64__) || defined(__alpha__) || defined(__sw_64__) + typedef unsigned int DWORD, *PDWORD, *LPDWORD; + typedef unsigned int ULONG, *PULONG, *LPULONG; + #else +@@ -316,7 +320,7 @@ typedef VOID *PVOID, *LPVOID; + typedef BYTE BOOLEAN, *PBOOLEAN; + typedef char CHAR, *PCHAR; + typedef short SHORT, *PSHORT; +-#if defined(__LP64__) || defined(__alpha__) ++#if defined(__LP64__) || defined(__alpha__) || defined(__sw_64__) + typedef int LONG, *PLONG, *LPLONG; + #else + typedef long LONG, *PLONG, *LPLONG; +@@ -929,7 +933,7 @@ PVOID WINAPI RtlVirtualUnwind(ULONG,ULONG64,ULONG64,RUNTIME_FUNCTION + #endif /* __x86_64__ */ + + /* Alpha context definitions */ +-#if defined(__alpha__) ++#if defined(__alpha__) || defined(__sw_64__) + + #define CONTEXT_ALPHA 0x00020000 + diff --git a/libEMF.spec b/libEMF.spec index 79cffe3c1272fb3ea57e03bab10ec5e57a506de7..9976cd6864d051c10fa22157aa4523d1be4383ba 100644 --- a/libEMF.spec +++ b/libEMF.spec @@ -1,10 +1,12 @@ Name: libEMF Version: 1.0.13 -Release: 1 +Release: 2 Summary: A library for generating Enhanced Metafiles License: LGPLv2+ and GPLv2+ URL: http://libemf.sourceforge.net/ Source0: https://downloads.sourceforge.net/project/libemf/libemf/%{version}/libemf-%{version}.tar.gz +Patch0: 0001-libEMF-Add-loongarch64-support.patch +Patch1: 0002-libEMF-Add-sw_64-support.patch BuildRequires: gcc-c++ chrpath @@ -59,6 +61,9 @@ make check %doc doc/html/* NEWS README %changelog +* Tue Aug 8 2023 suwei - 1.0.13-2 +- Add loongarch64 and sw_64 support + * Tue Sep 28 2021 yaoxin - 1.0.13-1 - Upgrade libEMF to 1.0.13; fix CVE-2020-13999 CVE-2020-11863 CVE-2020-11865 CVE-2020-11866 CVE-2020-11864