Package: libunwind / 1.1-3.2

fix-lzma-linking.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
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 <vapier@gentoo.org>.

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

Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -240,19 +240,21 @@ if test x$enable_msabi_support = xyes; t
 fi
 AC_MSG_RESULT([$enable_msabi_support])
 
+LIBLZMA=
 AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
 AC_ARG_ENABLE(minidebuginfo,
 AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
 AC_MSG_RESULT([$enable_minidebuginfo])
 if test x$enable_minidebuginfo != xno; then
    AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
-   [AC_SUBST([LIBLZMA], [-lzma])
+   [LIBLZMA=-llzma
     AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
     enable_minidebuginfo=yes],
    [if test x$enable_minidebuginfo = xyes; then
       AC_MSG_FAILURE([liblzma not found])
     fi])
 fi
+AC_SUBST([LIBLZMA])
 AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes)
 
 LIBUNWIND___THREAD
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:
 #
@@ -9,9 +10,11 @@ COMMON_SO_LDFLAGS =	-XCClinker -nostartf
 lib_LIBRARIES =
 lib_LTLIBRARIES =
 if !REMOTE_ONLY
-lib_LTLIBRARIES += libunwind.la libunwind-ptrace.la
+lib_LTLIBRARIES += libunwind.la
+# libunwind-ptrace.la and libunwind-coredump.la  need to come last, after the libunwind-$(arch).la
+#lib_LTLIBRARIES += libunwind-ptrace.la
 if BUILD_COREDUMP
-lib_LTLIBRARIES += libunwind-coredump.la
+#lib_LTLIBRARIES += libunwind-coredump.la
 endif
 endif
 
@@ -40,6 +43,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 = \
@@ -58,6 +64,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 = libunwind-$(arch).la libunwind.la $(LIBLZMA)
 noinst_HEADERS += coredump/_UCD_internal.h
 
 ### libunwind-setjmp:
@@ -76,7 +83,7 @@ endif
 
 libunwind_setjmp_la_LIBADD		= $(LIBUNWIND_ELF)	\
 					  libunwind-$(arch).la	\
-					  libunwind.la -lc
+					  libunwind.la $(LIBLZMA) -lc
 libunwind_setjmp_la_SOURCES		= setjmp/longjmp.c	\
 					  setjmp/siglongjmp.c
 noinst_HEADERS				+= setjmp/setjmp_i.h
@@ -451,6 +458,7 @@ if ARCH_AARCH64
  libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_aarch64_la_LIBADD += libunwind-elf64.la
+ libunwind_aarch64_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_aarch64_la_LIBADD += libunwind.la -lc
 endif
@@ -463,6 +471,7 @@ if ARCH_ARM
  libunwind_arm_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_arm_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_arm_la_LIBADD += libunwind-elf32.la
+ libunwind_arm_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_arm_la_LIBADD += libunwind.la -lc
 endif
@@ -484,6 +493,7 @@ Lcursor_i.h: mk_Lcursor_i.s
  libunwind_ia64_la_SOURCES = $(libunwind_ia64_la_SOURCES_ia64)
  libunwind_ia64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_ia64_la_LIBADD = libunwind-elf64.la
+ libunwind_ia64_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_ia64_la_LIBADD += libunwind.la -lc
 endif
@@ -497,6 +507,7 @@ if ARCH_HPPA
  libunwind_hppa_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_hppa_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_hppa_la_LIBADD += libunwind-elf32.la
+ libunwind_hppa_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_hppa_la_LIBADD += libunwind.la -lc
 endif
@@ -509,6 +520,7 @@ if ARCH_MIPS
  libunwind_mips_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_mips_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_mips_la_LIBADD += libunwind-elfxx.la
+ libunwind_mips_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_mips_la_LIBADD += libunwind.la -lc
 endif
@@ -521,6 +533,7 @@ if ARCH_X86
  libunwind_x86_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_x86_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_x86_la_LIBADD += libunwind-elf32.la
+ libunwind_x86_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_x86_la_LIBADD += libunwind.la -lc
 endif
@@ -533,6 +546,7 @@ if ARCH_X86_64
  libunwind_x86_64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_x86_64_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_x86_64_la_LIBADD += libunwind-elf64.la
+ libunwind_x86_64_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_x86_64_la_LIBADD += libunwind.la -lc
 endif
@@ -545,6 +559,7 @@ if ARCH_PPC32
  libunwind_ppc32_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_ppc32_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_ppc32_la_LIBADD += libunwind-elf32.la
+ libunwind_ppc32_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_ppc32_la_LIBADD += libunwind.la -lc
 endif
@@ -570,6 +585,7 @@ if ARCH_SH
  libunwind_sh_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_sh_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_sh_la_LIBADD += libunwind-elf32.la
+ libunwind_sh_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_sh_la_LIBADD += libunwind.la -lc
 endif
@@ -599,13 +615,19 @@ endif
 libunwind_la_LDFLAGS =	$(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
 			$(LDFLAGS_STATIC_LIBCXA) -version-info $(SOVERSION)
 libunwind_la_LIBADD  += -lc $(LIBCRTS)
-if HAVE_LZMA
- libunwind_la_LIBADD += -llzma
-endif
+libunwind_la_LIBADD += $(LIBLZMA)
 
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 noinst_HEADERS += unwind/unwind-internal.h
+ 
+# these need to come last, after the libunwind-$(arch).la
+if !REMOTE_ONLY
+lib_LTLIBRARIES += libunwind-ptrace.la
+if BUILD_COREDUMP
+lib_LTLIBRARIES += libunwind-coredump.la
+endif
+endif
 
 EXTRA_DIST =	$(libunwind_la_SOURCES_aarch64)			\
 		$(libunwind_la_SOURCES_arm)			\
Index: b/src/unwind/libunwind.pc.in
===================================================================
--- a/src/unwind/libunwind.pc.in
+++ b/src/unwind/libunwind.pc.in
@@ -7,3 +7,4 @@ Name: libunwind
 Description: libunwind base library
 Version: @VERSION@
 Libs: -L${libdir} -lunwind
+Libs.private: @LIBLZMA@