From 74450082b087f93c93de752b37cc0b5d5f3b43dd Mon Sep 17 00:00:00 2001 From: Gordon Messmer Date: Sat, 25 Feb 2023 17:07:20 -0800 Subject: [PATCH] Use a more accurate name than "libtool". --- macros.in | 4 ++-- tests/rpmbuild.at | 24 ++++++++++++------------ tools/elfdeps.c | 32 ++++++++++++++++---------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/macros.in b/macros.in index 50a63528fd..eac199a91f 100644 --- a/macros.in +++ b/macros.in @@ -564,8 +564,8 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\ # # Generate minimum versions for ELF libraries that don't provide # versioned symbol? -#%_elf_provide_fallback_versions --libtool-version-fallback -#%_elf_require_fallback_versions --libtool-version-fallback +#%_elf_provide_fallback_versions --full-name-version-fallback +#%_elf_require_fallback_versions --full-name-version-fallback # Directories whose contents should be considered as documentation. %__docdir_path %{_datadir}/doc:%{_datadir}/man:%{_datadir}/info:%{_datadir}/gtk-doc/html:%{_datadir}/gnome/help:%{?_docdir}:%{?_mandir}:%{?_infodir}:%{?_javadocdir}:/usr/doc:/usr/man:/usr/info:/usr/X11R6/man diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at index beac80306a..d1fc5e86ee 100644 --- a/tests/rpmbuild.at +++ b/tests/rpmbuild.at @@ -1114,9 +1114,9 @@ RPMDB_INIT AT_CHECK([ runroot_other chmod a-x /data/misc/libhello.so -runroot_other ${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback /data/misc/libhello.so +runroot_other ${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback /data/misc/libhello.so runroot_other chmod a+x /data/misc/libhello.so -runroot_other ${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback /data/misc/libhello.so +runroot_other ${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback /data/misc/libhello.so ], [0], [libc.so.6(GLIBC_2.2.5)(64bit) @@ -1130,9 +1130,9 @@ rtld(GNU_HASH) AT_CHECK([ runroot_other chmod a-x /data/misc/libhello.so.1.0.0 -runroot_other ${RPM_CONFIGDIR}/elfdeps -P --libtool-version-fallback /data/misc/libhello.so +runroot_other ${RPM_CONFIGDIR}/elfdeps -P --full-name-version-fallback /data/misc/libhello.so runroot_other chmod a+x /data/misc/libhello.so.1.0.0 -runroot_other ${RPM_CONFIGDIR}/elfdeps -P --libtool-version-fallback /data/misc/libhello.so +runroot_other ${RPM_CONFIGDIR}/elfdeps -P --full-name-version-fallback /data/misc/libhello.so ], [0], [libhello.so()(64bit) = 1.0.0 @@ -1144,9 +1144,9 @@ AT_SKIP_IF([! $HAVE_GNU_DLFCN]) AT_CHECK([ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${RPMTEST}/data/misc runroot_other chmod a-x /data/misc/helloexe -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/helloexe +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/helloexe runroot_other chmod a+x /data/misc/helloexe -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/helloexe +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/helloexe ], [0], [libc.so.6(GLIBC_2.2.5)(64bit) @@ -1160,9 +1160,9 @@ AT_SKIP_IF([! $HAVE_GNU_DLFCN]) AT_CHECK([ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${RPMTEST}/data/misc runroot_other chmod a-x /data/misc/hellopie -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/hellopie +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/hellopie runroot_other chmod a+x /data/misc/hellopie -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/hellopie +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/hellopie ], [0], [libc.so.6(GLIBC_2.2.5)(64bit) @@ -1176,9 +1176,9 @@ AT_SKIP_IF([$HAVE_GNU_DLFCN]) AT_CHECK([ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${RPMTEST}/data/misc runroot_other chmod a-x /data/misc/helloexe -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/helloexe +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/helloexe runroot_other chmod a+x /data/misc/helloexe -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/helloexe +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/helloexe ], [0], [libc.so.6(GLIBC_2.2.5)(64bit) @@ -1192,9 +1192,9 @@ AT_SKIP_IF([$HAVE_GNU_DLFCN]) AT_CHECK([ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${RPMTEST}/data/misc runroot_other chmod a-x /data/misc/hellopie -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/hellopie +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/hellopie runroot_other chmod a+x /data/misc/hellopie -${RPM_CONFIGDIR}/elfdeps -R --libtool-version-fallback ${RPMTEST}/data/misc/hellopie +${RPM_CONFIGDIR}/elfdeps -R --full-name-version-fallback ${RPMTEST}/data/misc/hellopie ], [0], [libc.so.6(GLIBC_2.2.5)(64bit) diff --git a/tools/elfdeps.c b/tools/elfdeps.c index a4149b6351..ee8bb2c750 100644 --- a/tools/elfdeps.c +++ b/tools/elfdeps.c @@ -16,7 +16,7 @@ #include #include -int libtool_version_fallback = 0; +int full_name_version_fallback = 0; int soname_only = 0; int fake_soname = 1; int filter_soname = 1; @@ -43,7 +43,7 @@ typedef struct elfInfo_s { * If filename is a symlink to a path that contains ".so." followed by * a version number, return a copy of the version number. */ -static char *getLibtoolVer(const char *filename) +static char *getFullNameVer(const char *filename) { const char *so, *link_basename, *dest_basename; char dest[PATH_MAX]; @@ -106,7 +106,7 @@ static char *getLibtoolVer(const char *filename) * functions, which isn't necessarily safe, so do that in a separate * process. */ -static char *getLibtoolVerFromShLink(const char *filename) +static char *getFullNameVerFromShLink(const char *filename) { #if defined(HAVE_DLMOPEN) && defined(HAVE_DLINFO) char dest[PATH_MAX]; @@ -130,7 +130,7 @@ static char *getLibtoolVerFromShLink(const char *filename) if (dl_handle == NULL) _exit(EXIT_FAILURE); if (dlinfo(dl_handle, RTLD_DI_LINKMAP, &linkmap) == -1) _exit(EXIT_FAILURE); - version = getLibtoolVer(linkmap->l_name); + version = getFullNameVer(linkmap->l_name); if (version) (void) write(pipefd[1], version, strlen(version)); close(pipefd[1]); @@ -246,7 +246,7 @@ static void addDep(ARGV_t *deps, if (compare_op && fallback_ver) { /* - * when versioned symbols aren't available, the libtool version + * when versioned symbols aren't available, the full name version * might be used to generate a minimum dependency version. */ rasprintf(&dep, @@ -372,17 +372,17 @@ static void processDynamic(Elf_Scn *scn, GElf_Shdr *shdr, elfInfo *ei) if (genRequires(ei)) { s = elf_strptr(ei->elf, shdr->sh_link, dyn->d_un.d_val); if (s) { - char *libtool_ver = NULL; + char *full_name_ver = NULL; /* * If soname matches an item already in the deps, then * it had versioned symbols and doesn't require fallback. */ - if (libtool_version_fallback && + if (full_name_version_fallback && !findSonameInDeps(ei->requires, s)) { - libtool_ver = getLibtoolVerFromShLink(s); + full_name_ver = getFullNameVerFromShLink(s); } - addDep(&ei->requires, s, NULL, ei->marker, ">=", libtool_ver); - free(libtool_ver); + addDep(&ei->requires, s, NULL, ei->marker, ">=", full_name_ver); + free(full_name_ver); } } break; @@ -483,12 +483,12 @@ static int processFile(const char *fn, int dtype) ei->soname = rstrdup(bn ? bn + 1 : fn); } if (ei->soname) { - char *libtool_ver = NULL; - if (libtool_version_fallback) { - libtool_ver = getLibtoolVer(fn); + char *full_name_ver = NULL; + if (full_name_version_fallback) { + full_name_ver = getFullNameVer(fn); } - addDep(&ei->provides, ei->soname, NULL, ei->marker, "=", libtool_ver); - free(libtool_ver); + addDep(&ei->provides, ei->soname, NULL, ei->marker, "=", full_name_ver); + free(full_name_ver); } } @@ -529,7 +529,7 @@ int main(int argc, char *argv[]) struct poptOption opts[] = { { "provides", 'P', POPT_ARG_VAL, &provides, -1, NULL, NULL }, { "requires", 'R', POPT_ARG_VAL, &requires, -1, NULL, NULL }, - { "libtool-version-fallback", 0, POPT_ARG_VAL, &libtool_version_fallback, -1, NULL, NULL }, + { "full-name-version-fallback", 0, POPT_ARG_VAL, &full_name_version_fallback, -1, NULL, NULL }, { "soname-only", 0, POPT_ARG_VAL, &soname_only, -1, NULL, NULL }, { "no-fake-soname", 0, POPT_ARG_VAL, &fake_soname, 0, NULL, NULL }, { "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL },