From 385c19f3356c35e20143082120800374461ffb25 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 15 Feb 2014 21:09:42 -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(+) diff --git a/src/Makefile.am b/src/Makefile.am index 9d82a4f7..efa976b2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -68,6 +68,7 @@ libunwind_coredump_la_SOURCES = \ coredump/_UPT_resume.c libunwind_coredump_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \ -version-info $(COREDUMP_SO_VERSION) +libunwind_coredump_la_LIBADD = $(LIBLZMA) noinst_HEADERS += coredump/_UCD_internal.h coredump/_UCD_lib.h ### libunwind-setjmp: @@ -178,6 +179,9 @@ noinst_HEADERS += elf32.h elf64.h elfxx.h libunwind_elf32_la_SOURCES = elf32.c libunwind_elf64_la_SOURCES = elf64.c libunwind_elfxx_la_SOURCES = elfxx.c +libunwind_elf32_la_LIBADD = $(LIBLZMA) +libunwind_elf64_la_LIBADD = $(LIBLZMA) +libunwind_elfxx_la_LIBADD = $(LIBLZMA) noinst_LTLIBRARIES += $(LIBUNWIND_ELF) libunwind_la_LIBADD += $(LIBUNWIND_ELF)