From a9e6228cabdb25e23517080b9a86d8c7571e68a2 Mon Sep 17 00:00:00 2001 From: wxiat Date: Mon, 26 Jun 2023 15:31:00 +0800 Subject: [PATCH] add sw Signed-off-by: wxiat --- 0001-libsigsegv-add-sw.patch | 161 +++++++++++++++++++++++++++++++++++ libsigsegv.spec | 8 +- 2 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 0001-libsigsegv-add-sw.patch diff --git a/0001-libsigsegv-add-sw.patch b/0001-libsigsegv-add-sw.patch new file mode 100644 index 0000000..200f3bb --- /dev/null +++ b/0001-libsigsegv-add-sw.patch @@ -0,0 +1,161 @@ +From 8c8e95bafd41d942efcf2e8208d2235f6f5465d7 Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Mon, 26 Jun 2023 15:04:32 +0800 +Subject: [PATCH] add sw + +Signed-off-by: wxiat +--- + configure | 8 ++++++++ + m4/stack-direction.m4 | 1 + + src/Makefile.am | 1 + + src/Makefile.in | 1 + + src/fault-linux-sw_64-old.h | 22 ++++++++++++++++++++++ + src/fault-linux-sw_64.h | 28 ++++++++++++++++++++++++++++ + src/fault-osf.h | 1 + + 7 files changed, 62 insertions(+) + create mode 100644 src/fault-linux-sw_64-old.h + create mode 100644 src/fault-linux-sw_64.h + +diff --git a/configure b/configure +index 0a6b0b6..602ef70 100755 +--- a/configure ++++ b/configure +@@ -15071,6 +15071,9 @@ done + alpha*) + CFG_FAULT=fault-linux-alpha.h + ;; ++ sw_64*) ++ CFG_FAULT=fault-linux-sw_64.h ++ ;; + arm* | strongarm* | xscale* | aarch64*) + CFG_FAULT=fault-linux-arm.h + ;; +@@ -15234,6 +15237,10 @@ else + CFG_FAULT=fault-linux-alpha-old.h + FAULT_CONTEXT='struct sigcontext' + ;; ++ sw_64*) ++ CFG_FAULT=fault-linux-sw_64-old.h ++ FAULT_CONTEXT='struct sigcontext' ++ ;; + arm* | strongarm* | xscale*) + CFG_FAULT=fault-linux-arm-old.h + FAULT_CONTEXT='struct sigcontext' +@@ -15340,6 +15347,7 @@ else + a29k | \ + aarch64* | \ + alpha* | \ ++ sw_64* | \ + arc | \ + arm* | strongarm* | xscale* | \ + avr | avr32 | \ +diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4 +index c373f1c..1abbf44 100644 +--- a/m4/stack-direction.m4 ++++ b/m4/stack-direction.m4 +@@ -15,6 +15,7 @@ AC_DEFUN([SV_STACK_DIRECTION], + a29k | \ + aarch64* | \ + alpha* | \ ++ sw_64* | \ + arc | \ + arm* | strongarm* | xscale* | \ + avr | avr32 | \ +diff --git a/src/Makefile.am b/src/Makefile.am +index af933d1..a66c90c 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -31,6 +31,7 @@ noinst_HEADERS = \ + fault-bsd.h fault-freebsd-i386.h \ + fault-hpux.h fault-hpux-hppa.h fault-hurd.h fault-irix.h fault-irix-mips.h \ + fault-linux.h fault-linux-alpha.h fault-linux-alpha-old.h \ ++ fault-linux-sw_64.h fault-linux-sw_64-old.h \ + fault-linux-arm.h fault-linux-arm-old.h \ + fault-linux-cris.h fault-linux-cris-old.h \ + fault-linux-hppa.h fault-linux-hppa-old.h \ +diff --git a/src/Makefile.in b/src/Makefile.in +index d76db10..ae6d32c 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -345,6 +345,7 @@ noinst_HEADERS = \ + fault-bsd.h fault-freebsd-i386.h \ + fault-hpux.h fault-hpux-hppa.h fault-hurd.h fault-irix.h fault-irix-mips.h \ + fault-linux.h fault-linux-alpha.h fault-linux-alpha-old.h \ ++ fault-linux-sw_64.h fault-linux-sw_64-old.h \ + fault-linux-arm.h fault-linux-arm-old.h \ + fault-linux-cris.h fault-linux-cris-old.h \ + fault-linux-hppa.h fault-linux-hppa-old.h \ +diff --git a/src/fault-linux-sw_64-old.h b/src/fault-linux-sw_64-old.h +new file mode 100644 +index 0000000..0b49da0 +--- /dev/null ++++ b/src/fault-linux-sw_64-old.h +@@ -0,0 +1,22 @@ ++/* Fault handler information. Linux/Alpha version. ++ Copyright (C) 2002 Bruno Haible ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#include ++ ++#define SIGSEGV_FAULT_HANDLER_ARGLIST int sig, int code, struct sigcontext *scp ++#define SIGSEGV_FAULT_CONTEXT scp ++#define SIGSEGV_FAULT_STACKPOINTER scp->sc_regs[30] +diff --git a/src/fault-linux-sw_64.h b/src/fault-linux-sw_64.h +new file mode 100644 +index 0000000..84b369e +--- /dev/null ++++ b/src/fault-linux-sw_64.h +@@ -0,0 +1,28 @@ ++/* Fault handler information. Linux/Sw_64 version when it supports POSIX. ++ Copyright (C) 2002, 2009 Bruno Haible ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#include "fault-posix-ucontext.h" ++ ++/* See glibc/sysdeps/unix/sysv/linux/sw_64/sys/ucontext.h ++ and the definition of GET_STACK in ++ glibc/sysdeps/unix/sysv/linux/sw_64/sigcontextinfo.h. ++ Note that the 'mcontext_t' defined in ++ glibc/sysdeps/unix/sysv/linux/sw_64/sys/ucontext.h ++ and the 'struct sigcontext' defined in ++ are actually the same. */ ++ ++#define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.sc_regs[30] +diff --git a/src/fault-osf.h b/src/fault-osf.h +index 8b93957..b141686 100644 +--- a/src/fault-osf.h ++++ b/src/fault-osf.h +@@ -17,3 +17,4 @@ + + #define SIGSEGV_FAULT_HANDLER_ARGLIST int sig, int code, struct sigcontext *scp + #define SIGSEGV_FAULT_CONTEXT scp ++#define SIGSEGV_FAULT_ADDRESS scp->sc_traparg_a0 +-- +2.31.1 + diff --git a/libsigsegv.spec b/libsigsegv.spec index f643578..250c361 100644 --- a/libsigsegv.spec +++ b/libsigsegv.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Summary: Library for handling page faults in user mode @@ -10,6 +10,8 @@ License: GPLv2+ URL: https://www.gnu.org/software/libsigsegv/ Source0: http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-%{version}.tar.gz +Patch0: 0001-libsigsegv-add-sw.patch + BuildRequires: automake libtool %description @@ -46,6 +48,7 @@ Doc pages for %{name}. %prep %setup -q +%patch0 -p1 %build @@ -99,6 +102,9 @@ make check %doc AUTHORS NEWS README %changelog +* Mon Jun 26 2023 wxiat - 2.11-5.0.2 +- add sw patch + * Tue Jul 19 2022 DengXiewei - 2.11-5.0.1 - Add doc sub package -- Gitee