From 842250064b776d0b19b449a00dbcbeb633946cbf Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 27 Jun 2017 01:28:59 +0000 Subject: [PATCH] libunwind: 1.1 -> 1.2.1 --- .../libraries/libunwind/cve-2015-3239.patch | 15 ----- .../libraries/libunwind/default.nix | 30 ++------- .../libunwind/libunwind-1.1-lzma.patch | 63 ------------------- 3 files changed, 6 insertions(+), 102 deletions(-) delete mode 100644 pkgs/development/libraries/libunwind/cve-2015-3239.patch delete mode 100644 pkgs/development/libraries/libunwind/libunwind-1.1-lzma.patch diff --git a/pkgs/development/libraries/libunwind/cve-2015-3239.patch b/pkgs/development/libraries/libunwind/cve-2015-3239.patch deleted file mode 100644 index 247b2dab44f8..000000000000 --- a/pkgs/development/libraries/libunwind/cve-2015-3239.patch +++ /dev/null @@ -1,15 +0,0 @@ -http://git.savannah.gnu.org/cgit/libunwind.git/commit/?id=396b6c7ab737e2bff244d640601c436a26260ca1 - -diff --git a/include/dwarf_i.h b/include/dwarf_i.h -index 0e72845..86dcdb8 100644 ---- a/include/dwarf_i.h -+++ b/include/dwarf_i.h -@@ -20,7 +20,7 @@ - extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; - /* REG is evaluated multiple times; it better be side-effects free! */ - # define dwarf_to_unw_regnum(reg) \ -- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) -+ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) - #endif - - #ifdef UNW_LOCAL_ONLY diff --git a/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix index 419a14551ba4..474b91751507 100644 --- a/pkgs/development/libraries/libunwind/default.nix +++ b/pkgs/development/libraries/libunwind/default.nix @@ -1,39 +1,20 @@ { stdenv, fetchurl, fetchpatch, autoreconfHook, xz }: stdenv.mkDerivation rec { - name = "libunwind-1.1"; + name = "libunwind-${version}"; + version = "1.2.1"; src = fetchurl { url = "mirror://savannah/libunwind/${name}.tar.gz"; - sha256 = "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx"; + sha256 = "1jsslwkilwrsj959dc8b479qildawz67r8m4lzxm7glcwa8cngiz"; }; - buildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook; - - patches = [ ./libunwind-1.1-lzma.patch ./cve-2015-3239.patch - # https://lists.nongnu.org/archive/html/libunwind-devel/2014-04/msg00000.html - (fetchpatch { - url = "https://raw.githubusercontent.com/dropbox/pyston/1b2e676417b0f5f17526ece0ed840aa88c744145/libunwind_patches/0001-Change-the-RBP-validation-heuristic-to-allow-size-0-.patch"; - sha256 = "1a0fsgfxmgd218nscswx7pgyb7rcn2gh6566252xhfvzhgn5i4ha"; - }) - ] ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch { - url = "https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/77709d1c6d5c39e23c1535b1bd584be1455f2551/extra/libunwind/libunwind-aarch64.patch"; - sha256 = "1mpjs8izq9wxiaf5rl4gzaxrkz0s51f9qz5qc5dj72pr84mw50w8"; - }); - - postPatch = '' - sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure - ''; + nativeBuildInputs = [ autoreconfHook ]; outputs = [ "out" "dev" ]; propagatedBuildInputs = [ xz ]; - preInstall = '' - mkdir -p "$out/lib" - touch "$out/lib/libunwind-generic.so" - ''; - postInstall = '' find $out -name \*.la | while read file; do sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file @@ -43,7 +24,8 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { homepage = http://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.gpl2; + license = licenses.mit; }; } diff --git a/pkgs/development/libraries/libunwind/libunwind-1.1-lzma.patch b/pkgs/development/libraries/libunwind/libunwind-1.1-lzma.patch deleted file mode 100644 index 09cefa028539..000000000000 --- a/pkgs/development/libraries/libunwind/libunwind-1.1-lzma.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 38c349bb000b427c376e756e3ecdb764a2b4d297 Mon Sep 17 00:00:00 2001 -From: Mike Frysinger -Date: Sat, 15 Feb 2014 21:00:59 -0500 -Subject: [PATCH] link sublibs against liblzma as needed - -The coredump/elf32/elf64/elfxx libs use lzma funcs but don't link against -it. This produces sub-shared libs that don't link against lzma and can -make the linker angry due to underlinking like so: - -libtool: link: x86_64-pc-linux-gnu-gcc -O2 -march=amdfam10 -pipe -g \ - -frecord-gcc-switches -Wimplicit-function-declaration -fexceptions \ - -Wall -Wsign-compare -Wl,-O1 -Wl,--hash-style=gnu \ - -o .libs/test-coredump-unwind test-coredump-unwind.o \ - ../src/.libs/libunwind-coredump.so ../src/.libs/libunwind-x86_64.so -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_footer_decode' -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_buffer_decode' -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_size' -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_end' -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_uncompressed_size' -../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_buffer_decode' -collect2: error: ld returned 1 exit status - -So add LIBLZMA to the right LIBADD for each of these libraries. - -URL: https://bugs.gentoo.org/444050 -Signed-off-by: Mike Frysinger ---- - src/Makefile.am | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -169,7 +169,7 @@ libunwind_arm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libunwind_arm_la_LDFLAGS) $(LDFLAGS) -o $@ - @ARCH_ARM_TRUE@am_libunwind_arm_la_rpath = -rpath $(libdir) --libunwind_coredump_la_LIBADD = -+libunwind_coredump_la_LIBADD = $(LIBLZMA) - am__libunwind_coredump_la_SOURCES_DIST = coredump/_UCD_accessors.c \ - coredump/_UCD_create.c coredump/_UCD_destroy.c \ - coredump/_UCD_access_mem.c coredump/_UCD_elf_map_image.c \ -@@ -214,15 +214,15 @@ am_libunwind_dwarf_local_la_OBJECTS = dwarf/Lexpr.lo dwarf/Lfde.lo \ - libunwind_dwarf_local_la_OBJECTS = \ - $(am_libunwind_dwarf_local_la_OBJECTS) - @REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am_libunwind_dwarf_local_la_rpath = --libunwind_elf32_la_LIBADD = -+libunwind_elf32_la_LIBADD = $(LIBLZMA) - am_libunwind_elf32_la_OBJECTS = elf32.lo - libunwind_elf32_la_OBJECTS = $(am_libunwind_elf32_la_OBJECTS) - @USE_ELF32_TRUE@am_libunwind_elf32_la_rpath = --libunwind_elf64_la_LIBADD = -+libunwind_elf64_la_LIBADD = $(LIBLZMA) - am_libunwind_elf64_la_OBJECTS = elf64.lo - libunwind_elf64_la_OBJECTS = $(am_libunwind_elf64_la_OBJECTS) - @USE_ELF64_TRUE@am_libunwind_elf64_la_rpath = --libunwind_elfxx_la_LIBADD = -+libunwind_elfxx_la_LIBADD = $(LIBLZMA) - am_libunwind_elfxx_la_OBJECTS = elfxx.lo - libunwind_elfxx_la_OBJECTS = $(am_libunwind_elfxx_la_OBJECTS) - @USE_ELFXX_TRUE@am_libunwind_elfxx_la_rpath = --- -1.8.5.5 -