about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2021-11-28 15:04:03 +0800
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-12-02 17:47:16 -0800
commit8169ad8838ceb9f7a9a5315d72f456057b4923aa (patch)
treed6b5b9ff5580006da5100580d98aa1d4a819fa19
parentae418d54d34bfead1996cfdd48ca7998e64e36af (diff)
libunwind: 1.4.0 -> 1.6.2
-rw-r--r--pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch45
-rw-r--r--pkgs/development/libraries/libunwind/default.nix18
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 5 insertions, 60 deletions
diff --git a/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch b/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
deleted file mode 100644
index 5fcaa72c0c013..0000000000000
--- a/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-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/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix
index 643752da1dc57..4e0fe9a4aa8d8 100644
--- a/pkgs/development/libraries/libunwind/default.nix
+++ b/pkgs/development/libraries/libunwind/default.nix
@@ -1,24 +1,14 @@
-{ stdenv, lib, fetchurl, fetchpatch, autoreconfHook, xz, coreutils }:
+{ stdenv, lib, fetchurl, autoreconfHook, xz, coreutils }:
 
 stdenv.mkDerivation rec {
   pname = "libunwind";
-  version = "1.4.0";
+  version = "1.6.2";
 
   src = fetchurl {
     url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
-    sha256 = "0dc46flppifrv2z0mrdqi60165ghxm1wk0g47vcbyzjdplqwjnfz";
+    sha256 = "sha256-SmrsZmmR+0XQiJxErt6K1usQgHHDVU/N/2cfnJR5SXY=";
   };
 
-  patches = [
-    ./backtrace-only-with-glibc.patch
-
-    (fetchpatch {
-      # upstream build fix against -fno-common compilers like >=gcc-10
-      url = "https://github.com/libunwind/libunwind/commit/29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e.patch";
-      sha256 = "1angwfq6h0jskg6zx8g6w9min38g5mgmrcbppcy5hqn59cgsxbw0";
-    })
-  ];
-
   postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
     substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
   '';
@@ -46,7 +36,7 @@ stdenv.mkDerivation rec {
     description = "A portable and efficient API to determine the call-chain of a program";
     maintainers = with maintainers; [ orivej ];
     platforms = platforms.linux;
-    badPlatforms = [ "riscv32-linux" "riscv64-linux" ];
+    badPlatforms = [ "riscv32-linux" ];
     license = licenses.mit;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ca17856aad3e1..3844f0f8731c7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18427,7 +18427,7 @@ with pkgs;
 
   libunwind =
     if stdenv.isDarwin then darwin.libunwind
-    else if stdenv.hostPlatform.isRiscV then llvmPackages_latest.libunwind
+    else if stdenv.hostPlatform.system == "riscv32-linux" then llvmPackages_latest.libunwind
     else callPackage ../development/libraries/libunwind { };
 
   libuv = callPackage ../development/libraries/libuv {