Merge #28536: libsigsegv: add enableSigbusFix option

(It's partially changed version of the PR.)
This commit is contained in:
Vladimír Čunát 2017-08-27 17:23:32 +02:00
commit 017b33aaaa
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
3 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,6 @@
{ stdenv, fetchurl }: { stdenv, fetchurl
, enableSigbusFix ? false # required by kernels < 3.18.6
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libsigsegv-2.5"; name = "libsigsegv-2.5";
@ -8,6 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0fvcsq9msi63vrbpvks6mqkrnls5cfy6bzww063sqhk2h49vsyyg"; sha256 = "0fvcsq9msi63vrbpvks6mqkrnls5cfy6bzww063sqhk2h49vsyyg";
}; };
patches = stdenv.lib.optional enableSigbusFix ./sigbus_fix.patch;
meta = { meta = {
homepage = http://libsigsegv.sf.net; homepage = http://libsigsegv.sf.net;
description = "A library for handling page faults in user mode"; description = "A library for handling page faults in user mode";

View File

@ -1,5 +1,6 @@
{ stdenv, fetchurl { stdenv, fetchurl
, buildPlatform, hostPlatform , buildPlatform, hostPlatform
, enableSigbusFix ? false # required by kernels < 3.18.6
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -10,6 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "063swdvq7mbmc1clv0rnh20grwln1zfc2qnm0sa1hivcxyr2wz6x"; sha256 = "063swdvq7mbmc1clv0rnh20grwln1zfc2qnm0sa1hivcxyr2wz6x";
}; };
patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
doCheck = hostPlatform == buildPlatform; doCheck = hostPlatform == buildPlatform;
meta = { meta = {

View File

@ -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 } }