#1050992 hwcap default search paths changed

#1050992#5
Date:
2023-09-01 07:14:40 UTC
From:
To:
Previously defined hwcap search paths have been changed. Those
specified in `man 8 ld.so` are no longer accurate (bug #1050930).

Typical output on sid/i386:

% LD_DEBUG=libs LD_LIBRARY_PATH=. /bin/true
   3611433:     find library=libc.so.6 [0]; searching
   3611433:      search path=.          (LD_LIBRARY_PATH)
   3611433:       trying file=./libc.so.6
   3611433:      search cache=/etc/ld.so.cache
   3611433:       trying file=/lib/i386-linux-gnu/libc.so.6
   3611433:
   3611433:
   3611433:     calling init: /lib/ld-linux.so.2
   3611433:
   3611433:
   3611433:     calling init: /lib/i386-linux-gnu/libc.so.6
   3611433:
   3611433:
   3611433:     initialize program: /bin/true
   3611433:
   3611433:
   3611433:     transferring control: /bin/true
   3611433:
   3611433:
   3611433:     calling fini:  [0]
   3611433:
   3611433:
   3611433:     calling fini: /lib/i386-linux-gnu/libc.so.6 [0]
   3611433:
   3611433:
   3611433:     calling fini: /lib/ld-linux.so.2 [0]
   3611433:

Same goes for:

[...]
%  /lib/ld-linux.so.2 --help | tail
This program interpreter self-identifies as: /lib/ld-linux.so.2

Shared library search path:
  (libraries located via /etc/ld.so.cache)
  /lib/i386-linux-gnu (system search path)
  /usr/lib/i386-linux-gnu (system search path)
  /lib (system search path)
  /usr/lib (system search path)

No subdirectories of glibc-hwcaps directories are searched.
[...]

If I understand correctly, this render the following .so file obsolete (unused):

% file /usr/lib/i386-linux-gnu/i686/sse2/libx264.so.164
/usr/lib/i386-linux-gnu/i686/sse2/libx264.so.164: ELF 32-bit LSB
shared object, Intel 80386, version 1 (SYSV), dynamically linked,
BuildID[sha1]=e66974d10aef77af7ed504266cde974d103484d6, stripped

Possibly other packages might be impacted.

I suspect the best upgrade path is simply to document the old hwcap
search path have been removed, and Debian package(s) should not rely
on them anymore (lintian warning?).

Comments ?

Reference:
* https://lists.debian.org/debian-glibc/2023/08/msg00084.html

#1050992#12
Date:
2023-09-01 17:57:55 UTC
From:
To:
Hi,

[snip]

Yes, the old AT_HWCAP mechanism has been deprecated in glibc 2.33 in
favor of the glibc-hwcaps mechanism, and removed in glibc 2.37. Instead
of relying on a huge number of CPU feature combinations, the new
mechanism is based on architecture baseline level. For instance for
amd64 we have x86-64-v1 to x86-64-v4 levels defined directly in the ELF
x86-64-ABI psABI [1]. The supported directories can be queried by
running ld.so --help

That indeed means that the ld.so manpage need to be updated, thanks for
filling the bug against manpages-dev.

Indeed no level has been yet defined for i386 and I am afraid nobody is
really interested in doing so.

This is already documented in the upstream NEWS.gz, but it might warrant
an additional entry in NEWS.Debian.gz. The lintian warning might be a
good idea depending how widely this is used in the archive. I'll
investigate and report back.

Regards
Aurelien

[1] https://gitlab.com/x86-psABIs/x86-64-ABI