diff options
author | 2021-07-25 00:31:51 +0200 | |
---|---|---|
committer | 2021-07-25 00:31:51 +0200 | |
commit | d34517382846910ddcaed884920ef48e0b651518 (patch) | |
tree | 14fec97ec7424778ea0292f8f3b46fd6bd980f4b | |
parent | Backport patch to fix a quadratic slow down in the BFD library. (diff) | |
download | binutils-gdb-d34517382846910ddcaed884920ef48e0b651518.tar.gz binutils-gdb-d34517382846910ddcaed884920ef48e0b651518.tar.bz2 binutils-gdb-d34517382846910ddcaed884920ef48e0b651518.zip |
Gentoo: Give also libctf optionally a gentoo-specific soversion
-rw-r--r-- | libctf/Makefile.am | 13 | ||||
-rw-r--r-- | libctf/Makefile.in | 8 | ||||
-rwxr-xr-x | libctf/configure | 31 | ||||
-rw-r--r-- | libctf/configure.ac | 8 |
4 files changed, 56 insertions, 4 deletions
diff --git a/libctf/Makefile.am b/libctf/Makefile.am index f45433483c0..a9aacea6acc 100644 --- a/libctf/Makefile.am +++ b/libctf/Makefile.am @@ -21,6 +21,8 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex +EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is # -I../zlib, unless we were configured with --with-system-zlib, in which # case both are empty. @@ -41,8 +43,17 @@ include_HEADERS = noinst_LTLIBRARIES = libctf.la libctf-nobfd.la endif +# libctf by default uses libtool versioning. Unfortunately that keeps us from adding +# a supplement to the soversion. So we need to switch tracks and be creative. + +if HAVE_EXTRA_SOVERSION_SUFFIX +gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) +else +gentoo_ctf_soversion = 0.0.0 +endif + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(LIBINTL) $(ZLIB) -libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@ +libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@ libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \ ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \ diff --git a/libctf/Makefile.in b/libctf/Makefile.in index d31d017c1f5..efb4cc2b3e0 100644 --- a/libctf/Makefile.in +++ b/libctf/Makefile.in @@ -330,6 +330,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ FGREP = @FGREP@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ @@ -457,8 +458,13 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @ @INSTALL_LIBBFD_FALSE@include_HEADERS = @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libctf.la libctf-nobfd.la +@HAVE_EXTRA_SOVERSION_SUFFIX_FALSE@gentoo_ctf_soversion = 0.0.0 + +# libctf by default uses libtool versioning. Unfortunately that keeps us from adding +# a supplement to the soversion. So we need to switch tracks and be creative. +@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(LIBINTL) $(ZLIB) -libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@ +libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@ libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \ ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \ diff --git a/libctf/configure b/libctf/configure index 6b294bfebfb..648c90ae565 100755 --- a/libctf/configure +++ b/libctf/configure @@ -640,6 +640,9 @@ CTF_LIBADD SHARED_LDFLAGS NEED_CTF_QSORT_R_FALSE NEED_CTF_QSORT_R_TRUE +HAVE_EXTRA_SOVERSION_SUFFIX_FALSE +HAVE_EXTRA_SOVERSION_SUFFIX_TRUE +EXTRA_SOVERSION_SUFFIX ENABLE_LIBCTF_HASH_DEBUGGING_FALSE ENABLE_LIBCTF_HASH_DEBUGGING_TRUE zlibinc @@ -797,6 +800,7 @@ enable_maintainer_mode enable_install_libbfd with_system_zlib enable_libctf_hash_debugging +with_extra_soversion_suffix ' ac_precious_vars='build_alias host_alias @@ -1453,6 +1457,8 @@ Optional Packages: both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-system-zlib use installed libz + --with-extra-soversion-suffix=SUFFIX + Append '.SUFFIX' to SONAME [[default=]] Some influential environment variables: CC C compiler command @@ -11508,7 +11514,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11511 "configure" +#line 11529 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11614,7 +11620,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11617 "configure" +#line 11635 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12821,6 +12827,23 @@ else fi +EXTRA_SOVERSION_SUFFIX= + +# Check whether --with-extra-soversion-suffix was given. +if test "${with_extra_soversion_suffix+set}" = set; then : + withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}" +fi + + + if test -n "${with_extra_soversion_suffix}"; then + HAVE_EXTRA_SOVERSION_SUFFIX_TRUE= + HAVE_EXTRA_SOVERSION_SUFFIX_FALSE='#' +else + HAVE_EXTRA_SOVERSION_SUFFIX_TRUE='#' + HAVE_EXTRA_SOVERSION_SUFFIX_FALSE= +fi + + # Similar to GDB_AC_CHECK_BFD. OLD_CFLAGS=$CFLAGS OLD_LDFLAGS=$LDFLAGS @@ -13511,6 +13534,10 @@ if test -z "${ENABLE_LIBCTF_HASH_DEBUGGING_TRUE}" && test -z "${ENABLE_LIBCTF_HA as_fn_error $? "conditional \"ENABLE_LIBCTF_HASH_DEBUGGING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_TRUE}" && test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_FALSE}"; then + as_fn_error $? "conditional \"HAVE_EXTRA_SOVERSION_SUFFIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${NEED_CTF_QSORT_R_TRUE}" && test -z "${NEED_CTF_QSORT_R_FALSE}"; then as_fn_error $? "conditional \"NEED_CTF_QSORT_R\" was never defined. diff --git a/libctf/configure.ac b/libctf/configure.ac index bbdfd63e7c9..66063bd2106 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -74,6 +74,14 @@ if test "${enable_libctf_hash_debugging}" = yes; then fi AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debugging}" = yes) +EXTRA_SOVERSION_SUFFIX= +AC_ARG_WITH(extra-soversion-suffix, + AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX], + [Append '.SUFFIX' to SONAME [[default=]]]), +[EXTRA_SOVERSION_SUFFIX="${withval}"]) +AC_SUBST(EXTRA_SOVERSION_SUFFIX) +AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"]) + # Similar to GDB_AC_CHECK_BFD. OLD_CFLAGS=$CFLAGS OLD_LDFLAGS=$LDFLAGS |