From bc2ad5a9683d772ace19cf28f79ef98f0722b29a Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 11 Jan 2018 14:27:52 -0600 Subject: [PATCH] libunwind: patch to fix build on non-glibc --- .../libunwind/backtrace-only-with-glibc.patch | 45 +++++++++++++++++++ .../libraries/libunwind/default.nix | 1 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch diff --git a/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch b/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch new file mode 100644 index 000000000000..5fcaa72c0c01 --- /dev/null +++ b/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 +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 +--- +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 + + /* For SIGSEGV handler code */ ++#ifdef __GLIBC__ + #include ++#endif + #include + + #include +@@ -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/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix index 8565bc75ff9f..6afdac3fdf5c 100644 --- a/pkgs/development/libraries/libunwind/default.nix +++ b/pkgs/development/libraries/libunwind/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { patches = [ ./version-1.2.1.patch + ./backtrace-only-with-glibc.patch ]; nativeBuildInputs = [ autoreconfHook ];