1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages libsigsegv)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu))
26 (define-public libsigsegv
33 "mirror://gnu/libsigsegv/libsigsegv-"
36 (base32 "1dlhqf4igzpqayms25lkhycjq1ccavisx8cnb3y4zapbkqsszq9s"))))
37 (build-system gnu-build-system)
38 (home-page "https://www.gnu.org/software/libsigsegv/")
39 (synopsis "Library for handling page faults")
41 `(;; The shared library isn't built by default but some packages need it.
42 #:configure-flags '("--enable-shared")
44 ;; On MIPS, work around this error:
46 ;; In file included from fault-linux-mips-old.h:18:0,
48 ;; linux-libre-headers-cross-mips64el-linux-gnu-3.3.8/include/asm/sigcontext.h:57:8: error: redefinition of 'struct sigcontext'
49 ,@(if (string-contains (or (%current-target-system) (%current-system))
51 `(#:phases (modify-phases %standard-phases
52 (add-before 'configure 'patch-mips-old-h
54 (substitute* "src/fault-linux-mips-old.h"
55 (("#include <asm/sigcontext\\.h>") ""))
59 "GNU libsigsegv is a library to handle page faults, which occur when a
60 program tries to access an unavailable region of memory, in user mode. By
61 catching and handling page faults, the program can implement pageable virtual
62 memory, stack overflow handlers, and so on.")