diff --git a/macros.in b/macros.in index e93a76e3aa..560c80112d 100644 --- a/macros.in +++ b/macros.in @@ -545,8 +545,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 788b4fb258..5d944e8a7c 100644 --- a/tests/rpmbuild.at +++ b/tests/rpmbuild.at @@ -896,9 +896,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) @@ -912,9 +912,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 @@ -926,9 +926,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) @@ -942,9 +942,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) @@ -958,9 +958,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) @@ -974,9 +974,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 8c011bb8ad..f51f931a5e 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; @@ -42,7 +42,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]; @@ -105,7 +105,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]; @@ -129,7 +129,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]); @@ -245,7 +245,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, @@ -371,17 +371,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; @@ -482,12 +482,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); } } @@ -524,7 +524,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 },