From 3adf7cc414780c3c6af5ae78f16951975c82d41c Mon Sep 17 00:00:00 2001 From: wuzx Date: Fri, 18 Nov 2022 14:31:37 +0800 Subject: [PATCH] Add sw64 architecture Signed-off-by: wuzx --- libsigsegv-Add-sw64-architecture.patch | 174 +++++++++++++++++++++++++ libsigsegv.spec | 10 +- 2 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 libsigsegv-Add-sw64-architecture.patch diff --git a/libsigsegv-Add-sw64-architecture.patch b/libsigsegv-Add-sw64-architecture.patch new file mode 100644 index 0000000..8845383 --- /dev/null +++ b/libsigsegv-Add-sw64-architecture.patch @@ -0,0 +1,174 @@ +From 5970fcb15c0c2757afaaede0ff88e512c8df9fe9 Mon Sep 17 00:00:00 2001 +From: wuzx +Date: Fri, 18 Nov 2022 14:29:18 +0800 +Subject: [PATCH] Add sw64 architecture + +Add sw64 architecture in file configure configure.ac src/Makefile.am src/Makefile.in src/fault-linux-sw_64-old.h and src/fault-linux-sw_64.h to support sw64 architecture. + +Signed-off-by: wuzx +--- + configure | 8 ++++++++ + configure.ac | 8 ++++++++ + src/Makefile.am | 1 + + src/Makefile.in | 1 + + src/fault-linux-sw_64-old.h | 22 ++++++++++++++++++++++ + src/fault-linux-sw_64.h | 28 ++++++++++++++++++++++++++++ + 6 files changed, 68 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 4775db4..1786674 100755 +--- a/configure ++++ b/configure +@@ -15156,6 +15156,9 @@ done + ;; + linux*) + case "$host_cpu" in ++ sw_64*) ++ CFG_FAULT=fault-linux-sw_64.h ++ ;; + alpha*) + CFG_FAULT=fault-linux-alpha.h + ;; +@@ -15327,6 +15330,10 @@ else + case "$host_os" in + linux*) + case "$host_cpu" in ++ sw_64*) ++ CFG_FAULT=fault-linux-sw_64-old.h ++ FAULT_CONTEXT='struct sigcontext' ++ ;; + alpha*) + CFG_FAULT=fault-linux-alpha-old.h + FAULT_CONTEXT='struct sigcontext' +@@ -15437,6 +15444,7 @@ else + a29k | \ + aarch64* | \ + alpha* | \ ++ sw_64* | \ + arc | \ + arm* | strongarm* | xscale* | \ + avr | avr32 | \ +diff --git a/configure.ac b/configure.ac +index 367ae19..1763739 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -338,6 +338,7 @@ if test -z "$CFG_FAULT" && test "$sv_cv_fault_posix" = yes; then + openbsd*) + case "$host_cpu" in + alpha*) CFG_FAULT=fault-openbsd-alpha.h ;; ++ sw_64*) CFG_FAULT=fault-openbsd-sw_64.h ;; + arm* | strongarm* | xscale*) CFG_FAULT=fault-openbsd-arm.h ;; + hppa* | parisc*) CFG_FAULT=fault-openbsd-hppa.h ;; + i?86 | x86_64) CFG_FAULT=fault-openbsd-i386.h ;; +@@ -423,6 +424,9 @@ if test -z "$CFG_FAULT" && test "$sv_cv_fault_posix" = yes; then + 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 + ;; +@@ -601,6 +605,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' +diff --git a/src/Makefile.am b/src/Makefile.am +index bbd1779..46aad45 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -36,6 +36,7 @@ noinst_HEADERS = \ + fault-hurd.h fault-hurd-i386.h \ + fault-irix.h fault-irix-mips.h \ + fault-linux.h fault-linux-alpha.h fault-linux-alpha-old.h \ ++ fault-linux.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 48fb83d..471373c 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -350,6 +350,7 @@ noinst_HEADERS = \ + fault-hurd.h fault-hurd-i386.h \ + fault-irix.h fault-irix-mips.h \ + fault-linux.h fault-linux-alpha.h fault-linux-alpha-old.h \ ++ fault-linux.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..c86b7f0 +--- /dev/null ++++ b/src/fault-linux-sw_64.h +@@ -0,0 +1,28 @@ ++/* Fault handler information. Linux/Alpha 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] +-- +2.33.0 + diff --git a/libsigsegv.spec b/libsigsegv.spec index 4ba2247..5e6dd57 100644 --- a/libsigsegv.spec +++ b/libsigsegv.spec @@ -1,11 +1,13 @@ Name: libsigsegv Version: 2.13 -Release: 2 +Release: 3 Summary: library for handling page faults in user mode License: GPLv2+ URL: https://www.gnu.org/software/libsigsegv/ Source0: https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-%{version}.tar.gz +Patch1: libsigsegv-Add-sw64-architecture.patch + BuildRequires: libtool automake %description @@ -62,6 +64,12 @@ make check %changelog +* Fri Oct 21 2022 wuzx - 2.13-3 +- Type:feature +- CVE:NA +- SUG:NA +- DESC:Add sw64 architecture + * Wed Sep 7 2022 fuanan - 2.13-2 - Type:bugfix - ID:NA -- Gitee