the dpkg-shlibdeps pacakging tool warns about some under- and overlinked 
libraries:

symbol _Ux86_64_dwarf_find_unwind_table used by libunwind-coredump.so.0.0.0
found in none of the libraries
symbol _Ux86_64_get_elf_image used by libunwind-coredump.so.0.0.0 found in none
of the libraries
symbol _Ux86_64_dwarf_search_unwind_table used by libunwind-coredump.so.0.0.0
found in none of the libraries
symbol _Ux86_64_dwarf_search_unwind_table used by libunwind-ptrace.so.0.0.0
found in none of the libraries
symbol _Ux86_64_get_elf_image used by libunwind-ptrace.so.0.0.0 found in none of
the libraries
symbol lzma_index_uncompressed_size used by libunwind-ptrace.so.0.0.0 found in
none of the libraries
symbol lzma_index_end used by libunwind-ptrace.so.0.0.0 found in none of the
libraries
symbol lzma_index_buffer_decode used by libunwind-ptrace.so.0.0.0 found in none
of the libraries
symbol _Ux86_64_dwarf_find_unwind_table used by libunwind-ptrace.so.0.0.0 found
in none of the libraries
symbol lzma_stream_footer_decode used by libunwind-ptrace.so.0.0.0 found in none
of the libraries
symbol lzma_index_size used by libunwind-ptrace.so.0.0.0 found in none of the
libraries
symbol lzma_stream_buffer_decode used by libunwind-ptrace.so.0.0.0 found in none
of the libraries

The following patch addresses these:

src/Makefile.am

 - define PTRACE_SO
 - add libunwind-ptrace.la and libunwind-coredump.la last to
   lib_LTLIBRARIES to fix build errors with the new LIBADD
   dependencies.
 - define libunwind_ptrace_la_LDFLAGS and libunwind_ptrace_la_LIBADD
 - define libunwind_coredump_la_LIBADD
 - remove libunwind-$(arch).la from libunwind_setjmp_la_LIBADD

Matthias
liblzuma used in decoding MiniDebuginfo is not listed in
libunwind.pc.

Changes in version 2 of patch:

* Don't check HAVE_LZMA. It is redundant.
* Make liblzma as private libraries in use.

Both are suggested by Mike Frysinger <[email protected]>.

Signed-off-by: Masatake YAMATO <[email protected]>
---
 configure.ac               | 4 +++-
 src/Makefile.am            | 4 +---
 src/unwind/libunwind.pc.in | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

Index: b/src/Makefile.am
===================================================================
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,7 @@
 SOVERSION=8:1:0		# See comments at end of file.
 SETJMP_SO_VERSION=0:0:0
 COREDUMP_SO_VERSION=0:0:0
+PTRACE_SO_VERSION=0:0:0
 #
 # Don't link with start-files since we don't use any constructors/destructors:
 #
@@ -10,12 +11,6 @@ lib_LIBRARIES =
 lib_LTLIBRARIES =
 if !REMOTE_ONLY
 lib_LTLIBRARIES += libunwind.la
-if BUILD_PTRACE
-lib_LTLIBRARIES += libunwind-ptrace.la
-endif
-if BUILD_COREDUMP
-lib_LTLIBRARIES += libunwind-coredump.la
-endif
 endif
 
 noinst_HEADERS =
@@ -50,6 +45,9 @@ libunwind_ptrace_la_SOURCES =						  \
 	ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c	  \
 	ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c
 noinst_HEADERS += ptrace/_UPT_internal.h
+libunwind_ptrace_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \
+				-version-info $(PTRACE_SO_VERSION)
+libunwind_ptrace_la_LIBADD = libunwind-$(arch).la libunwind.la $(LIBLZMA)
 
 ### libunwind-coredump:
 libunwind_coredump_la_SOURCES = \
@@ -68,7 +66,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)
+libunwind_coredump_la_LIBADD = libunwind-$(arch).la libunwind.la $(LIBLZMA)
 noinst_HEADERS += coredump/_UCD_internal.h coredump/_UCD_lib.h
 
 ### libunwind-setjmp:
@@ -86,7 +84,6 @@ LIBUNWIND_ELF = libunwind-elfxx.la
 endif
 
 libunwind_setjmp_la_LIBADD		= $(LIBUNWIND_ELF)	\
-					  libunwind-$(arch).la	\
 					  libunwind.la -lc
 libunwind_setjmp_la_SOURCES		= setjmp/longjmp.c	\
 					  setjmp/siglongjmp.c
@@ -659,6 +656,16 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 noinst_HEADERS += unwind/unwind-internal.h
 
+# these need to come last, after the libunwind-$(arch).la
+if !REMOTE_ONLY
+if BUILD_PTRACE
+lib_LTLIBRARIES += libunwind-ptrace.la
+endif
+if BUILD_COREDUMP
+lib_LTLIBRARIES += libunwind-coredump.la
+endif
+endif
+
 EXTRA_DIST =	$(libunwind_la_SOURCES_aarch64)			\
 		$(libunwind_la_SOURCES_arm)			\
 		$(libunwind_la_SOURCES_hppa)			\
_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to