Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

libunwind: Fix build

+69
+6
pkgs/development/libraries/libunwind/default.nix
··· 8 8 sha256 = "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx"; 9 9 }; 10 10 11 + patches = [ ./libunwind-1.1-lzma.patch ]; 12 + 13 + postPatch = '' 14 + sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure 15 + ''; 16 + 11 17 propagatedBuildInputs = [ xz ]; 12 18 13 19 NIX_CFLAGS_COMPILE = if stdenv.system == "x86_64-linux" then "-fPIC" else "";
+63
pkgs/development/libraries/libunwind/libunwind-1.1-lzma.patch
··· 1 + From 38c349bb000b427c376e756e3ecdb764a2b4d297 Mon Sep 17 00:00:00 2001 2 + From: Mike Frysinger <vapier@gentoo.org> 3 + Date: Sat, 15 Feb 2014 21:00:59 -0500 4 + Subject: [PATCH] link sublibs against liblzma as needed 5 + 6 + The coredump/elf32/elf64/elfxx libs use lzma funcs but don't link against 7 + it. This produces sub-shared libs that don't link against lzma and can 8 + make the linker angry due to underlinking like so: 9 + 10 + libtool: link: x86_64-pc-linux-gnu-gcc -O2 -march=amdfam10 -pipe -g \ 11 + -frecord-gcc-switches -Wimplicit-function-declaration -fexceptions \ 12 + -Wall -Wsign-compare -Wl,-O1 -Wl,--hash-style=gnu \ 13 + -o .libs/test-coredump-unwind test-coredump-unwind.o \ 14 + ../src/.libs/libunwind-coredump.so ../src/.libs/libunwind-x86_64.so 15 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_footer_decode' 16 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_buffer_decode' 17 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_size' 18 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_end' 19 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_uncompressed_size' 20 + ../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_buffer_decode' 21 + collect2: error: ld returned 1 exit status 22 + 23 + So add LIBLZMA to the right LIBADD for each of these libraries. 24 + 25 + URL: https://bugs.gentoo.org/444050 26 + Signed-off-by: Mike Frysinger <vapier@gentoo.org> 27 + --- 28 + src/Makefile.am | 4 ++++ 29 + 1 file changed, 4 insertions(+) 30 + 31 + --- a/src/Makefile.in 32 + +++ b/src/Makefile.in 33 + @@ -169,7 +169,7 @@ libunwind_arm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ 34 + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 35 + $(libunwind_arm_la_LDFLAGS) $(LDFLAGS) -o $@ 36 + @ARCH_ARM_TRUE@am_libunwind_arm_la_rpath = -rpath $(libdir) 37 + -libunwind_coredump_la_LIBADD = 38 + +libunwind_coredump_la_LIBADD = $(LIBLZMA) 39 + am__libunwind_coredump_la_SOURCES_DIST = coredump/_UCD_accessors.c \ 40 + coredump/_UCD_create.c coredump/_UCD_destroy.c \ 41 + coredump/_UCD_access_mem.c coredump/_UCD_elf_map_image.c \ 42 + @@ -214,15 +214,15 @@ am_libunwind_dwarf_local_la_OBJECTS = dwarf/Lexpr.lo dwarf/Lfde.lo \ 43 + libunwind_dwarf_local_la_OBJECTS = \ 44 + $(am_libunwind_dwarf_local_la_OBJECTS) 45 + @REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am_libunwind_dwarf_local_la_rpath = 46 + -libunwind_elf32_la_LIBADD = 47 + +libunwind_elf32_la_LIBADD = $(LIBLZMA) 48 + am_libunwind_elf32_la_OBJECTS = elf32.lo 49 + libunwind_elf32_la_OBJECTS = $(am_libunwind_elf32_la_OBJECTS) 50 + @USE_ELF32_TRUE@am_libunwind_elf32_la_rpath = 51 + -libunwind_elf64_la_LIBADD = 52 + +libunwind_elf64_la_LIBADD = $(LIBLZMA) 53 + am_libunwind_elf64_la_OBJECTS = elf64.lo 54 + libunwind_elf64_la_OBJECTS = $(am_libunwind_elf64_la_OBJECTS) 55 + @USE_ELF64_TRUE@am_libunwind_elf64_la_rpath = 56 + -libunwind_elfxx_la_LIBADD = 57 + +libunwind_elfxx_la_LIBADD = $(LIBLZMA) 58 + am_libunwind_elfxx_la_OBJECTS = elfxx.lo 59 + libunwind_elfxx_la_OBJECTS = $(am_libunwind_elfxx_la_OBJECTS) 60 + @USE_ELFXX_TRUE@am_libunwind_elfxx_la_rpath = 61 + -- 62 + 1.8.5.5 63 +