diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/libunwind | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libunwind')
3 files changed, 98 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch b/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch new file mode 100644 index 000000000000..5fcaa72c0c01 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch @@ -0,0 +1,45 @@ +From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem at gmail.com> +Date: Thu, 31 Dec 2015 06:44:07 +0000 +Subject: [PATCH] backtrace: Use only with glibc and uclibc + +backtrace API is glibc specific not linux specific +so make it behave so. + +Signed-off-by: Khem Raj <raj.khem at gmail.com> +--- +Upstream-Status: Pending + + tests/test-coredump-unwind.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c +index 5254708..8767b42 100644 +--- a/tests/test-coredump-unwind.c ++++ b/tests/test-coredump-unwind.c +@@ -57,7 +57,9 @@ + #include <grp.h> + + /* For SIGSEGV handler code */ ++#ifdef __GLIBC__ + #include <execinfo.h> ++#endif + #include <sys/ucontext.h> + + #include <libunwind-coredump.h> +@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext) + ip); + + { ++#ifdef __GLIBC__ + /* glibc extension */ + void *array[50]; + int size; + size = backtrace(array, 50); +-#ifdef __linux__ + backtrace_symbols_fd(array, size, 2); + #endif + } +-- +2.6.4 + diff --git a/nixpkgs/pkgs/development/libraries/libunwind/default.nix b/nixpkgs/pkgs/development/libraries/libunwind/default.nix new file mode 100644 index 000000000000..2453484cb9c4 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libunwind/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, autoreconfHook, xz }: + +stdenv.mkDerivation rec { + name = "libunwind-${version}"; + version = "1.2.1"; + + src = fetchurl { + url = "mirror://savannah/libunwind/${name}.tar.gz"; + sha256 = "1jsslwkilwrsj959dc8b479qildawz67r8m4lzxm7glcwa8cngiz"; + }; + + patches = [ + ./version-1.2.1.patch + ./backtrace-only-with-glibc.patch + ]; + + nativeBuildInputs = [ autoreconfHook ]; + + outputs = [ "out" "dev" ]; + + propagatedBuildInputs = [ xz ]; + + postInstall = '' + find $out -name \*.la | while read file; do + sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file + done + ''; + + doCheck = false; # fails + + meta = with stdenv.lib; { + homepage = https://www.nongnu.org/libunwind; + description = "A portable and efficient API to determine the call-chain of a program"; + maintainers = with maintainers; [ orivej ]; + platforms = platforms.linux; + license = licenses.mit; + }; + + passthru.supportsHost = !stdenv.hostPlatform.isRiscV; +} diff --git a/nixpkgs/pkgs/development/libraries/libunwind/version-1.2.1.patch b/nixpkgs/pkgs/development/libraries/libunwind/version-1.2.1.patch new file mode 100644 index 000000000000..63202937084c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libunwind/version-1.2.1.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index a254bbe..fe0247b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,6 +1,6 @@ + define(pkg_major, 1) +-define(pkg_minor, 2.1) +-define(pkg_extra, ) ++define(pkg_minor, 2) ++define(pkg_extra, 1) + define(pkg_maintainer, libunwind-devel@nongnu.org) + define(mkvers, $1.$2$3) + dnl Process this file with autoconf to produce a configure script. |