about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libsigsegv
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libsigsegv')
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigsegv/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch8
2 files changed, 44 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
new file mode 100644
index 000000000000..30921ade4cf5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl
+, enableSigbusFix ? false # required by kernels < 3.18.6
+}:
+
+stdenv.mkDerivation rec {
+  name = "libsigsegv-2.12";
+
+  src = fetchurl {
+    url = "mirror://gnu/libsigsegv/${name}.tar.gz";
+    sha256 = "1dlhqf4igzpqayms25lkhycjq1ccavisx8cnb3y4zapbkqsszq9s";
+  };
+
+  patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
+
+  doCheck = true; # not cross;
+
+  meta = {
+    homepage = "https://www.gnu.org/software/libsigsegv/";
+    description = "Library to handle page faults in user mode";
+
+    longDescription = ''
+      GNU libsigsegv is a library for handling page faults in user mode. A
+      page fault occurs when a program tries to access to a region of memory
+      that is currently not available. Catching and handling a page fault is
+      a useful technique for implementing pageable virtual memory,
+      memory-mapped access to persistent databases, generational garbage
+      collectors, stack overflow handlers, distributed shared memory, and
+      more.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch b/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch
new file mode 100644
index 000000000000..6f1c399041dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch
@@ -0,0 +1,8 @@
+--- a/src/signals.h	2017-08-23 14:07:05.000000000 +0100
++++ b/src/signals.h	2017-08-23 14:06:53.000000000 +0100
+@@ -18,4 +18,4 @@
+ /* List of signals that are sent when an invalid virtual memory address
+    is accessed, or when the stack overflows.  */
+ #define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
+-  { int var; var = SIGSEGV; { body } }
++  { int var; var = SIGSEGV; { body } var = SIGBUS; { body } }