[9/9] test-installation: skip libanl if not built

Message ID 20260919100444.2316950-10-xry111@xry111.site (mailing list archive)
State Superseded
Delegated to: Adhemerval Zanella Netto
Headers
Series Make test-installation.pl work |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Xi Ruoyao Sept. 19, 2026, 10:04 a.m. UTC
  For newer ports (such as LoongArch) libanl is not built at all.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 scripts/test-installation.pl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
  

Comments

Adhemerval Zanella Sept. 24, 2026, 4:41 p.m. UTC | #1
On 19/09/26 07:04, Xi Ruoyao wrote:
> For newer ports (such as LoongArch) libanl is not built at all.

libanl is the same kind of library as libdl, libpthread, librt and
libutil, which 6/9 already skips.

I noticed it is related to a bogus change I did (bc1e344dc1fb) were:

  # Pretend that libanl.so is a linker script, so that the symbolic link
  # is not installed.
  install-lib-ldscripts = libanl.so

But later we have libnss_dns overwriting install-lib-ldscripts again with
"=" instead of "+=, so libanl.so has been installed ever since.

On ABIs where libanl is built, this patch passes only because of that bug.
I ran the script against an x86_64 install tree with the libanl.so link
removed, which is what bc1e344dc1f intended. 

With the whole series applied it fails with:

  Library libanl is not correctly installed since the test program
  was not linked dynamically against it.

because -lanl picks up the empty libanl.a.

The have-GLIBC_2.34 check also does not match how the build decides.
On Hurd, sysdeps/htl/Makeconfig sets have-anl-library = yes
unconditionally, so on x86_64-gnu (baseline GLIBC_2.38) the script
would skip a libanl that is actually built.

I think it is simpler to drop this patch and skip "anl" unconditionally
with the other stub libraries in 6/9.  With that change the script
passes on x86_64 both with and without the libanl.so link, and on a
LoongArch-like layout where libanl is not built.  The resolv/Makefile
assignment should be fixed separately.

> 
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
>  scripts/test-installation.pl | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
> index cce7691a92..7c1dbc8d5e 100755
> --- a/scripts/test-installation.pl
> +++ b/scripts/test-installation.pl
> @@ -81,15 +81,18 @@ if ($#ARGV == -1) {
>      $dir = ".";
>      $soversions="soversions.mk";
>      $config="config.make";
> +    $symversions="Versions.mk";
>  } elsif ($#ARGV == 0) {
>      if (-d $ARGV[0]) {
>        $dir = $ARGV[0];
>        $soversions = "$ARGV[0]/soversions.mk";
>        $config = "$ARGV[0]/config.make";
> +      $symversions = "$ARGV[0]/Versions.mk";
>      } else {
>        $soversions = $dir = $ARGV[0];
>        $dir =~ s!/?[^/]*/*$!!;
>        $config = $dir . "/config.make";
> +      $symversions = $dir . "/Versions.mk";
>      }
>  } else {
>      die "Wrong number of arguments.";
> @@ -101,6 +104,12 @@ if (system ("grep -q \"build-mathvec = yes\" $config") == 0) {
>      $build_mathvec = 0;
>  }
>  
> +if (system ("grep -q \"have-GLIBC_2.34 = yes\" $symversions") == 0) {
> +    $build_anl = 1;
> +} else {
> +    $build_anl = 0;
> +}
> +
>  # Read names and versions of all shared libraries that are part of
>  # glibc
>  open SOVERSIONS, $soversions
> @@ -130,8 +139,9 @@ while (<SOVERSIONS>) {
>        "dl", "rt", "pthread", "util",
>      );
>      next if (grep { $_ eq $name } @skip);
> -    # libmvec if it wasn't built
> +    # libmvec and/or libanl if one wasn't built
>      next if ($build_mathvec == 0 && $name eq "mvec");
> +    next if ($build_anl == 0 && $name eq "anl");
>      $link_libs .= " -l$name";
>      $versions{$name} = $version;
>    } elsif ($LD_SO ne "") {
  

Patch

diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
index cce7691a92..7c1dbc8d5e 100755
--- a/scripts/test-installation.pl
+++ b/scripts/test-installation.pl
@@ -81,15 +81,18 @@  if ($#ARGV == -1) {
     $dir = ".";
     $soversions="soversions.mk";
     $config="config.make";
+    $symversions="Versions.mk";
 } elsif ($#ARGV == 0) {
     if (-d $ARGV[0]) {
       $dir = $ARGV[0];
       $soversions = "$ARGV[0]/soversions.mk";
       $config = "$ARGV[0]/config.make";
+      $symversions = "$ARGV[0]/Versions.mk";
     } else {
       $soversions = $dir = $ARGV[0];
       $dir =~ s!/?[^/]*/*$!!;
       $config = $dir . "/config.make";
+      $symversions = $dir . "/Versions.mk";
     }
 } else {
     die "Wrong number of arguments.";
@@ -101,6 +104,12 @@  if (system ("grep -q \"build-mathvec = yes\" $config") == 0) {
     $build_mathvec = 0;
 }
 
+if (system ("grep -q \"have-GLIBC_2.34 = yes\" $symversions") == 0) {
+    $build_anl = 1;
+} else {
+    $build_anl = 0;
+}
+
 # Read names and versions of all shared libraries that are part of
 # glibc
 open SOVERSIONS, $soversions
@@ -130,8 +139,9 @@  while (<SOVERSIONS>) {
       "dl", "rt", "pthread", "util",
     );
     next if (grep { $_ eq $name } @skip);
-    # libmvec if it wasn't built
+    # libmvec and/or libanl if one wasn't built
     next if ($build_mathvec == 0 && $name eq "mvec");
+    next if ($build_anl == 0 && $name eq "anl");
     $link_libs .= " -l$name";
     $versions{$name} = $version;
   } elsif ($LD_SO ne "") {