From a5950d68ab7928ae8b19f3d4affd6c0e542b21b1 Mon Sep 17 00:00:00 2001 From: silver_code Date: Fri, 21 Apr 2023 19:37:00 +0000 Subject: [PATCH] Backport patches from upstream --- Fix-signed-vs-unsigned-comparison.patch | 30 +++++++++++++++++++++++++ libffi.spec | 6 ++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 Fix-signed-vs-unsigned-comparison.patch diff --git a/Fix-signed-vs-unsigned-comparison.patch b/Fix-signed-vs-unsigned-comparison.patch new file mode 100644 index 0000000..7edd1ab --- /dev/null +++ b/Fix-signed-vs-unsigned-comparison.patch @@ -0,0 +1,30 @@ +From 9f65428e39c72481ba924d2544487f738c27f5ea Mon Sep 17 00:00:00 2001 +From: Wang Zhang +Date: Sat, 22 Apr 2023 02:16:04 +0800 +Subject: [PATCH] Fix signed vs unsigned comparison (#765) + +As reported by -Wsign-compare. In the case of getting the result of +comparing the result of sysconf (_SC_PAGESIZE) to other value, this also +correctly handles edge cases where the above fails and returns -1. + +Signed-off-by: Wang Zhang +--- + src/closures.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/closures.c b/src/closures.c +index 5120021..c02e818 100644 +--- a/src/closures.c ++++ b/src/closures.c +@@ -734,7 +734,7 @@ open_temp_exec_file (void) + static int + allocate_space (int fd, off_t offset, off_t len) + { +- static size_t page_size; ++ static long page_size; + + /* Obtain system page size. */ + if (!page_size) +-- +2.34.1 + diff --git a/libffi.spec b/libffi.spec index eacf2a0..6aa2db6 100644 --- a/libffi.spec +++ b/libffi.spec @@ -7,9 +7,9 @@ URL: http://sourceware.org/libff Source0: ftp://sourceware.org/pub/libffi/%{name}-%{version}.tar.gz Patch0: Add-gcc-bug-tests-back.patch +Patch1: Fix-signed-vs-unsigned-comparison.patch BuildRequires: gcc gcc-c++ dejagnu -BuildRequires: make %description Compilers for high level languages generate code that follows certain conventions. These @@ -89,11 +89,11 @@ fi %{_infodir}/libffi.info.gz %changelog -* Fri Dec 16 2022 wangjiang - 3.3-9 +* Sat Apr 22 2023 zhangwang - 3.3-9 - Type:bugfix - ID:NA - SUG:NA -- DESC:add BuildRequires make +- DESC:backport patches from upstream * Mon Dec 6 2021 panxiaohe - 3.3-8 - Type:enhancement -- Gitee