This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] scripts/test-installation.pl: Handle NSS crypto libraries [BZ #21940]


On 12/19/2017 10:16 AM, Rical Jasan wrote:
diff --git a/Makeconfig b/Makeconfig
index 80c498e33b..d9e9003c4b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1110,6 +1110,8 @@ $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
  	   case $$number in \
  	     [0-9]*) echo "$$lib.so-version=.$$number"; \
  		     echo "all-sonames+=$$lib=$$lib.so\$$($$lib.so-version)";;\
+	     undef)  echo "$$lib.so-version="; \
+		     echo "all-sonames+=$$lib=$$lib.so";;\
  	     *)	     echo "$$lib.so-version=$$number"; \
  		     echo "all-sonames+=$$lib=\$$($$lib.so-version)";;\
  	   esac; \
diff --git a/scripts/soversions.awk b/scripts/soversions.awk
index 247f061bc3..676c8692f6 100644
--- a/scripts/soversions.awk
+++ b/scripts/soversions.awk
@@ -14,6 +14,8 @@ $1 == "DEFAULT" {
    sub(/=.*$/, "", lib);
    sub(/^.*=/, "", number);
    if (lib in numbers) next;
+  if (number == "")
+    number = "undef";
    numbers[lib] = number;
    order[lib] = ++order_n;
    if (NF > 1) {

I'm not sure if want to put libfrebl3.so into soversions.mk anyway. It results in

gnu/lib-names-64.h:#define LIBFREEBL3_SO          "libfreebl3.so"

which is unexpected.

So perhaps it is better to stick libfreebl3.so explicitly into test-installation.pl.

diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
index 45c666b0a2..b77d7c4020 100755
--- a/scripts/test-installation.pl
+++ b/scripts/test-installation.pl
@@ -112,7 +112,8 @@ while (<SOVERSIONS>) {
    next if (/^all-sonames/);
    chop;
    if (/^lib/) {
-    ($name, $version)= /^lib(.*)\.so-version=\.(.*)$/;
+    ($name, $version)= /^lib(.*)\.so-version=\.?(.*)$/;
+    $version = "" if ! defined $version;

I believe $version will always be defined at this point, although it can be the empty string.

      # Filter out some libraries we don't want to link:
      # - nss_ldap since it's not yet available
      # - libdb1 since it conflicts with libdb
@@ -123,7 +124,8 @@ while (<SOVERSIONS>) {
      next if ($build_mathvec == 0 && $name eq "mvec");
      if ($name ne "nss_ldap" && $name ne "db1"
  	&& $name ne "thread_db"
-	&& $name ne "nss_test1" && $name ne "libgcc_s") {
+	&& $name ne "nss_test1" && $name ne "nss_test2"
+	&& $name ne "libgcc_s") {

I think you need to filter out libfreebl3 at this point as well because it is not necessarily available. It should not be subject to link tests, just like libgcc_s.

        $link_libs .= " -l$name";
        $versions{$name} = $version;
      }
@@ -171,14 +173,20 @@ if ($?) {
$ok = 1;
  %found = ();
+$librgx = qr/lib(\w+)\.so(?:\.([0-9\.]+))?/;
open LDD, "ldd /tmp/test-prg$$ |"
    or die ("Couldn't execute ldd");
  while (<LDD>) {
-  if (/^\s*lib/) {
+  if (m,^\s*${librgx}\s*=>\s*(?:/[^/]+)*/${librgx},) {
      ($name, $version1, $version2) =
-      /^\s*lib(\w*)\.so\.([0-9\.]*)\s*=>.*\.so\.([0-9\.]*)/;
+      ($1, defined($2) ? $2 : '', defined($4) ? $4 : '');
      $found{$name} = 1;
+    if (!exists $versions{$name}) {
+      print "Unexpected dependency: lib$name\n";
+      $ok = 0;
+      next;
+    }
      if ($versions{$name} ne $version1 || $version1 ne $version2) {
        print "Library lib$name is not correctly installed.\n";
        print "Please check your installation!\n";
diff --git a/shlib-versions b/shlib-versions
index b9cb99d2fb..e73d4270ac 100644
--- a/shlib-versions
+++ b/shlib-versions
@@ -75,3 +75,7 @@ libgcc_s=1
# The vector math library
  libmvec=1
+
+# libcrypt is linked against this when built with --enable-nss-crypt.
+# It does not use a versioned soname.
+libfreebl3=

See above, this won't be necessary if libfreebl3.so is included in test-installation.pl.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]