Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/
Date: Sat, 24 Jul 2021 20:57:36
Message-Id: 1627155641.bc2a10f35b091063cf84b9cfd5300b6c0f0cf428.dilfridge@gentoo
1 commit: bc2a10f35b091063cf84b9cfd5300b6c0f0cf428
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 24 19:40:41 2021 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 24 19:40:41 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=bc2a10f3
7
8 Add libctf soversion patches
9
10 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
11
12 ...ibctf-optionally-a-gentoo-specific-sovers.patch | 177 +++++++++++++++++++++
13 ...-soversion-suffix-then-we-also-use-the-bd.patch | 111 +++++++++++++
14 2 files changed, 288 insertions(+)
15
16 diff --git a/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch b/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch
17 new file mode 100644
18 index 0000000..6f1c6b3
19 --- /dev/null
20 +++ b/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch
21 @@ -0,0 +1,177 @@
22 +From d3cd41f5c7e405a8db5e85a7be9dfc42d44ef1b8 Mon Sep 17 00:00:00 2001
23 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@g.o>
24 +Date: Sat, 24 Jul 2021 15:20:16 +0200
25 +Subject: [PATCH 1/2] Give also libctf optionally a gentoo-specific soversion
26 +
27 +---
28 + libctf/Makefile.am | 13 ++++++++++++-
29 + libctf/Makefile.in | 8 +++++++-
30 + libctf/configure | 31 +++++++++++++++++++++++++++++--
31 + libctf/configure.ac | 8 ++++++++
32 + 4 files changed, 56 insertions(+), 4 deletions(-)
33 +
34 +diff --git a/libctf/Makefile.am b/libctf/Makefile.am
35 +index e586d25fb37..eabc7fa8394 100644
36 +--- a/libctf/Makefile.am
37 ++++ b/libctf/Makefile.am
38 +@@ -21,6 +21,8 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
39 +
40 + AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex
41 +
42 ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@
43 ++
44 + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
45 + # -I../zlib, unless we were configured with --with-system-zlib, in which
46 + # case both are empty.
47 +@@ -41,8 +43,17 @@ include_HEADERS =
48 + noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
49 + endif
50 +
51 ++# libctf by default uses libtool versioning. Unfortunately that keeps us from adding
52 ++# a supplement to the soversion. So we need to switch tracks and be creative.
53 ++
54 ++if HAVE_EXTRA_SOVERSION_SUFFIX
55 ++gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX)
56 ++else
57 ++gentoo_ctf_soversion = 0.0.0
58 ++endif
59 ++
60 + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB)
61 +-libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
62 ++libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@
63 + libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
64 + libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \
65 + ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \
66 +diff --git a/libctf/Makefile.in b/libctf/Makefile.in
67 +index 5cfa100f9cc..b528781af97 100644
68 +--- a/libctf/Makefile.in
69 ++++ b/libctf/Makefile.in
70 +@@ -338,6 +338,7 @@ EXEEXT = @EXEEXT@
71 +
72 + # Setup the testing framework, if you have one
73 + EXPECT = expect
74 ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@
75 + FGREP = @FGREP@
76 + GENCAT = @GENCAT@
77 + GMSGFMT = @GMSGFMT@
78 +@@ -469,8 +470,13 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @
79 + @INSTALL_LIBBFD_FALSE@include_HEADERS =
80 + @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h
81 + @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
82 ++@HAVE_EXTRA_SOVERSION_SUFFIX_FALSE@gentoo_ctf_soversion = 0.0.0
83 ++
84 ++# libctf by default uses libtool versioning. Unfortunately that keeps us from adding
85 ++# a supplement to the soversion. So we need to switch tracks and be creative.
86 ++@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX)
87 + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB)
88 +-libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
89 ++libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@
90 + libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
91 + libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \
92 + ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \
93 +diff --git a/libctf/configure b/libctf/configure
94 +index 82bcf13a606..e961f637a69 100755
95 +--- a/libctf/configure
96 ++++ b/libctf/configure
97 +@@ -643,6 +643,9 @@ CTF_LIBADD
98 + SHARED_LDFLAGS
99 + NEED_CTF_QSORT_R_FALSE
100 + NEED_CTF_QSORT_R_TRUE
101 ++HAVE_EXTRA_SOVERSION_SUFFIX_FALSE
102 ++HAVE_EXTRA_SOVERSION_SUFFIX_TRUE
103 ++EXTRA_SOVERSION_SUFFIX
104 + ENABLE_LIBCTF_HASH_DEBUGGING_FALSE
105 + ENABLE_LIBCTF_HASH_DEBUGGING_TRUE
106 + zlibinc
107 +@@ -804,6 +807,7 @@ enable_maintainer_mode
108 + enable_install_libbfd
109 + with_system_zlib
110 + enable_libctf_hash_debugging
111 ++with_extra_soversion_suffix
112 + '
113 + ac_precious_vars='build_alias
114 + host_alias
115 +@@ -1461,6 +1465,8 @@ Optional Packages:
116 + both]
117 + --with-gnu-ld assume the C compiler uses GNU ld [default=no]
118 + --with-system-zlib use installed libz
119 ++ --with-extra-soversion-suffix=SUFFIX
120 ++ Append '.SUFFIX' to SONAME [[default=]]
121 +
122 + Some influential environment variables:
123 + CC C compiler command
124 +@@ -11586,7 +11592,7 @@ else
125 + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
126 + lt_status=$lt_dlunknown
127 + cat > conftest.$ac_ext <<_LT_EOF
128 +-#line 11589 "configure"
129 ++#line 11607 "configure"
130 + #include "confdefs.h"
131 +
132 + #if HAVE_DLFCN_H
133 +@@ -11692,7 +11698,7 @@ else
134 + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
135 + lt_status=$lt_dlunknown
136 + cat > conftest.$ac_ext <<_LT_EOF
137 +-#line 11695 "configure"
138 ++#line 11713 "configure"
139 + #include "confdefs.h"
140 +
141 + #if HAVE_DLFCN_H
142 +@@ -12899,6 +12905,23 @@ else
143 + fi
144 +
145 +
146 ++EXTRA_SOVERSION_SUFFIX=
147 ++
148 ++# Check whether --with-extra-soversion-suffix was given.
149 ++if test "${with_extra_soversion_suffix+set}" = set; then :
150 ++ withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}"
151 ++fi
152 ++
153 ++
154 ++ if test -n "${with_extra_soversion_suffix}"; then
155 ++ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE=
156 ++ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE='#'
157 ++else
158 ++ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE='#'
159 ++ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE=
160 ++fi
161 ++
162 ++
163 + # Similar to GDB_AC_CHECK_BFD.
164 + OLD_CFLAGS=$CFLAGS
165 + OLD_LDFLAGS=$LDFLAGS
166 +@@ -13657,6 +13680,10 @@ if test -z "${ENABLE_LIBCTF_HASH_DEBUGGING_TRUE}" && test -z "${ENABLE_LIBCTF_HA
167 + as_fn_error $? "conditional \"ENABLE_LIBCTF_HASH_DEBUGGING\" was never defined.
168 + Usually this means the macro was only invoked conditionally." "$LINENO" 5
169 + fi
170 ++if test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_TRUE}" && test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_FALSE}"; then
171 ++ as_fn_error $? "conditional \"HAVE_EXTRA_SOVERSION_SUFFIX\" was never defined.
172 ++Usually this means the macro was only invoked conditionally." "$LINENO" 5
173 ++fi
174 +
175 + if test -z "${NEED_CTF_QSORT_R_TRUE}" && test -z "${NEED_CTF_QSORT_R_FALSE}"; then
176 + as_fn_error $? "conditional \"NEED_CTF_QSORT_R\" was never defined.
177 +diff --git a/libctf/configure.ac b/libctf/configure.ac
178 +index 80644b89d67..f7e6180afd8 100644
179 +--- a/libctf/configure.ac
180 ++++ b/libctf/configure.ac
181 +@@ -77,6 +77,14 @@ if test "${enable_libctf_hash_debugging}" = yes; then
182 + fi
183 + AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debugging}" = yes)
184 +
185 ++EXTRA_SOVERSION_SUFFIX=
186 ++AC_ARG_WITH(extra-soversion-suffix,
187 ++ AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX],
188 ++ [Append '.SUFFIX' to SONAME [[default=]]]),
189 ++[EXTRA_SOVERSION_SUFFIX="${withval}"])
190 ++AC_SUBST(EXTRA_SOVERSION_SUFFIX)
191 ++AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"])
192 ++
193 + # Similar to GDB_AC_CHECK_BFD.
194 + OLD_CFLAGS=$CFLAGS
195 + OLD_LDFLAGS=$LDFLAGS
196 +--
197 +2.31.1
198 +
199
200 diff --git a/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch b/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch
201 new file mode 100644
202 index 0000000..b88f50e
203 --- /dev/null
204 +++ b/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch
205 @@ -0,0 +1,111 @@
206 +From 235448cc5c53641417e17fd39ced95a21053c8ca Mon Sep 17 00:00:00 2001
207 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@g.o>
208 +Date: Sat, 24 Jul 2021 19:25:32 +0200
209 +Subject: [PATCH 2/2] If we use a soversion suffix, then we also use the bdf
210 + version as soversion
211 +
212 +---
213 + libctf/Makefile.am | 3 ++-
214 + libctf/Makefile.in | 3 ++-
215 + libctf/configure | 8 ++++++--
216 + libctf/configure.ac | 2 ++
217 + 4 files changed, 12 insertions(+), 4 deletions(-)
218 +
219 +diff --git a/libctf/Makefile.am b/libctf/Makefile.am
220 +index eabc7fa8394..e1304e8e89b 100644
221 +--- a/libctf/Makefile.am
222 ++++ b/libctf/Makefile.am
223 +@@ -22,6 +22,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
224 + AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex
225 +
226 + EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@
227 ++BFD_VERSION = @BFD_VERSION@
228 +
229 + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
230 + # -I../zlib, unless we were configured with --with-system-zlib, in which
231 +@@ -47,7 +48,7 @@ endif
232 + # a supplement to the soversion. So we need to switch tracks and be creative.
233 +
234 + if HAVE_EXTRA_SOVERSION_SUFFIX
235 +-gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX)
236 ++gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)"
237 + else
238 + gentoo_ctf_soversion = 0.0.0
239 + endif
240 +diff --git a/libctf/Makefile.in b/libctf/Makefile.in
241 +index b528781af97..18d482411e8 100644
242 +--- a/libctf/Makefile.in
243 ++++ b/libctf/Makefile.in
244 +@@ -316,6 +316,7 @@ AUTOCONF = @AUTOCONF@
245 + AUTOHEADER = @AUTOHEADER@
246 + AUTOMAKE = @AUTOMAKE@
247 + AWK = @AWK@
248 ++BFD_VERSION = @BFD_VERSION@
249 + CATALOGS = @CATALOGS@
250 + CATOBJEXT = @CATOBJEXT@
251 + CC = @CC@
252 +@@ -474,7 +475,7 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @
253 +
254 + # libctf by default uses libtool versioning. Unfortunately that keeps us from adding
255 + # a supplement to the soversion. So we need to switch tracks and be creative.
256 +-@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX)
257 ++@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)"
258 + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB)
259 + libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@
260 + libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
261 +diff --git a/libctf/configure b/libctf/configure
262 +index e961f637a69..520d3a5cb3e 100755
263 +--- a/libctf/configure
264 ++++ b/libctf/configure
265 +@@ -643,6 +643,7 @@ CTF_LIBADD
266 + SHARED_LDFLAGS
267 + NEED_CTF_QSORT_R_FALSE
268 + NEED_CTF_QSORT_R_TRUE
269 ++BFD_VERSION
270 + HAVE_EXTRA_SOVERSION_SUFFIX_FALSE
271 + HAVE_EXTRA_SOVERSION_SUFFIX_TRUE
272 + EXTRA_SOVERSION_SUFFIX
273 +@@ -11592,7 +11593,7 @@ else
274 + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
275 + lt_status=$lt_dlunknown
276 + cat > conftest.$ac_ext <<_LT_EOF
277 +-#line 11607 "configure"
278 ++#line 11608 "configure"
279 + #include "confdefs.h"
280 +
281 + #if HAVE_DLFCN_H
282 +@@ -11698,7 +11699,7 @@ else
283 + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
284 + lt_status=$lt_dlunknown
285 + cat > conftest.$ac_ext <<_LT_EOF
286 +-#line 11713 "configure"
287 ++#line 11714 "configure"
288 + #include "confdefs.h"
289 +
290 + #if HAVE_DLFCN_H
291 +@@ -12922,6 +12923,9 @@ else
292 + fi
293 +
294 +
295 ++BFD_VERSION=$(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p')
296 ++
297 ++
298 + # Similar to GDB_AC_CHECK_BFD.
299 + OLD_CFLAGS=$CFLAGS
300 + OLD_LDFLAGS=$LDFLAGS
301 +diff --git a/libctf/configure.ac b/libctf/configure.ac
302 +index f7e6180afd8..5306e5499ec 100644
303 +--- a/libctf/configure.ac
304 ++++ b/libctf/configure.ac
305 +@@ -85,6 +85,8 @@ AC_ARG_WITH(extra-soversion-suffix,
306 + AC_SUBST(EXTRA_SOVERSION_SUFFIX)
307 + AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"])
308 +
309 ++AC_SUBST(BFD_VERSION, $(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'), [Version of the accompanying bfd linker])
310 ++
311 + # Similar to GDB_AC_CHECK_BFD.
312 + OLD_CFLAGS=$CFLAGS
313 + OLD_LDFLAGS=$LDFLAGS
314 +--
315 +2.31.1
316 +