[v4,00/11] glibc-hwcaps support

Message ID cover.1604946656.git.fweimer@redhat.com
Headers
Series glibc-hwcaps support |

Message

Florian Weimer Nov. 9, 2020, 6:40 p.m. UTC
  This patch series incorporates Adhemerval's feedback.  It picks up the
suggestion for introducing enum opt_format in ldconfig.

It also fixes a a ldconfig bug (wrong size in xmalloc call) uncovered by
testing on i686-linux-gnu.

I have dropped the s390x patch until I have located a suitable machine
on which to test it.  We also need to discuss how to achieve GCC
alignment there.

Patch order is different than before because both the x86_64 and
powerpc64le patches contain tests now, including a test that runs the
ld.so-based test without special options in the container, to check for
ld.so.cache support.

The powerpc64le patch aligns the subdirectory selection with GCC.

I feel like this series has a reasonable level of test coverage.  It
does not test all possible permutations (ld.so option combinations and
ld.so.cache contents), but I hope that's okay.

(Not sure if this actually v4, I sort of lost count.)

Thanks,
Florian

Florian Weimer (11):
  support: Add support_copy_file
  elf: Introduce enum opt_format in the ldconfig implementation
  elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
  elf: Add endianness markup to ld.so.cache
  elf: Add extension mechanism to ld.so.cache
  elf: Implement a string table for ldconfig, with tail merging
  elf: Implement tail merging of strings in ldconfig
  elf: Process glibc-hwcaps subdirectories in ldconfig
  elf: Add glibc-hwcaps subdirectory support to ld.so cache processing
  x86_64: Add glibc-hwcaps support
  powerpc64le: Add glibc-hwcaps support

 elf/Makefile                                  |  90 +++-
 elf/cache.c                                   | 413 +++++++++++++++---
 elf/dl-cache.c                                | 202 ++++++++-
 elf/dl-hwcaps-subdirs.c                       |  29 ++
 elf/dl-hwcaps.c                               | 216 ++++++++-
 elf/dl-hwcaps.h                               | 124 ++++++
 elf/dl-hwcaps_split.c                         |  77 ++++
 elf/dl-load.c                                 |   7 +-
 elf/dl-main.h                                 |  11 +-
 elf/dl-support.c                              |   5 +-
 elf/dl-usage.c                                |  68 ++-
 elf/ldconfig.c                                | 164 +++++--
 elf/markermodMARKER-VALUE.c                   |  29 ++
 elf/rtld.c                                    |  18 +
 elf/stringtable.c                             | 209 +++++++++
 elf/stringtable.h                             |  64 +++
 elf/stringtable_free.c                        |  33 ++
 elf/tst-dl-hwcaps_split.c                     | 139 ++++++
 elf/tst-glibc-hwcaps-cache.c                  |  45 ++
 .../etc/ld.so.conf                            |   2 +
 elf/tst-glibc-hwcaps-cache.root/postclean.req |   0
 elf/tst-glibc-hwcaps-cache.script             |  18 +
 elf/tst-glibc-hwcaps-mask.c                   |  31 ++
 elf/tst-glibc-hwcaps-prepend-cache.c          | 133 ++++++
 .../postclean.req                             |   0
 elf/tst-glibc-hwcaps-prepend.c                |  32 ++
 elf/tst-glibc-hwcaps.c                        |  28 ++
 elf/tst-stringtable.c                         | 141 ++++++
 support/Makefile                              |   1 +
 support/support.h                             |   5 +
 support/support_copy_file.c                   |  43 ++
 sysdeps/generic/dl-cache.h                    | 233 +++++++++-
 sysdeps/generic/ldconfig.h                    |  27 +-
 sysdeps/generic/ldsodefs.h                    |  20 +-
 sysdeps/powerpc/powerpc64/le/Makefile         |  28 ++
 .../powerpc/powerpc64/le/dl-hwcaps-subdirs.c  |  46 ++
 .../powerpc/powerpc64/le/tst-glibc-hwcaps.c   |  54 +++
 sysdeps/x86_64/Makefile                       |  39 ++
 sysdeps/x86_64/dl-hwcaps-subdirs.c            |  66 +++
 sysdeps/x86_64/tst-glibc-hwcaps.c             |  76 ++++
 40 files changed, 2839 insertions(+), 127 deletions(-)
 create mode 100644 elf/dl-hwcaps-subdirs.c
 create mode 100644 elf/dl-hwcaps_split.c
 create mode 100644 elf/markermodMARKER-VALUE.c
 create mode 100644 elf/stringtable.c
 create mode 100644 elf/stringtable.h
 create mode 100644 elf/stringtable_free.c
 create mode 100644 elf/tst-dl-hwcaps_split.c
 create mode 100644 elf/tst-glibc-hwcaps-cache.c
 create mode 100644 elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf
 create mode 100644 elf/tst-glibc-hwcaps-cache.root/postclean.req
 create mode 100644 elf/tst-glibc-hwcaps-cache.script
 create mode 100644 elf/tst-glibc-hwcaps-mask.c
 create mode 100644 elf/tst-glibc-hwcaps-prepend-cache.c
 create mode 100644 elf/tst-glibc-hwcaps-prepend-cache.root/postclean.req
 create mode 100644 elf/tst-glibc-hwcaps-prepend.c
 create mode 100644 elf/tst-glibc-hwcaps.c
 create mode 100644 elf/tst-stringtable.c
 create mode 100644 support/support_copy_file.c
 create mode 100644 sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c
 create mode 100644 sysdeps/powerpc/powerpc64/le/tst-glibc-hwcaps.c
 create mode 100644 sysdeps/x86_64/dl-hwcaps-subdirs.c
 create mode 100644 sysdeps/x86_64/tst-glibc-hwcaps.c
  

Comments

Dan Horák Nov. 9, 2020, 9:56 p.m. UTC | #1
On Mon, 09 Nov 2020 19:40:10 +0100
Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> wrote:

> This patch series incorporates Adhemerval's feedback.  It picks up the
> suggestion for introducing enum opt_format in ldconfig.
> 
> It also fixes a a ldconfig bug (wrong size in xmalloc call) uncovered by
> testing on i686-linux-gnu.
> 
> I have dropped the s390x patch until I have located a suitable machine
> on which to test it.  We also need to discuss how to achieve GCC
> alignment there.

Florian, what kind of machine do you need?


		Dan
 
> Patch order is different than before because both the x86_64 and
> powerpc64le patches contain tests now, including a test that runs the
> ld.so-based test without special options in the container, to check for
> ld.so.cache support.
> 
> The powerpc64le patch aligns the subdirectory selection with GCC.
> 
> I feel like this series has a reasonable level of test coverage.  It
> does not test all possible permutations (ld.so option combinations and
> ld.so.cache contents), but I hope that's okay.
> 
> (Not sure if this actually v4, I sort of lost count.)
> 
> Thanks,
> Florian
> 
> Florian Weimer (11):
>   support: Add support_copy_file
>   elf: Introduce enum opt_format in the ldconfig implementation
>   elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
>   elf: Add endianness markup to ld.so.cache
>   elf: Add extension mechanism to ld.so.cache
>   elf: Implement a string table for ldconfig, with tail merging
>   elf: Implement tail merging of strings in ldconfig
>   elf: Process glibc-hwcaps subdirectories in ldconfig
>   elf: Add glibc-hwcaps subdirectory support to ld.so cache processing
>   x86_64: Add glibc-hwcaps support
>   powerpc64le: Add glibc-hwcaps support
> 
>  elf/Makefile                                  |  90 +++-
>  elf/cache.c                                   | 413 +++++++++++++++---
>  elf/dl-cache.c                                | 202 ++++++++-
>  elf/dl-hwcaps-subdirs.c                       |  29 ++
>  elf/dl-hwcaps.c                               | 216 ++++++++-
>  elf/dl-hwcaps.h                               | 124 ++++++
>  elf/dl-hwcaps_split.c                         |  77 ++++
>  elf/dl-load.c                                 |   7 +-
>  elf/dl-main.h                                 |  11 +-
>  elf/dl-support.c                              |   5 +-
>  elf/dl-usage.c                                |  68 ++-
>  elf/ldconfig.c                                | 164 +++++--
>  elf/markermodMARKER-VALUE.c                   |  29 ++
>  elf/rtld.c                                    |  18 +
>  elf/stringtable.c                             | 209 +++++++++
>  elf/stringtable.h                             |  64 +++
>  elf/stringtable_free.c                        |  33 ++
>  elf/tst-dl-hwcaps_split.c                     | 139 ++++++
>  elf/tst-glibc-hwcaps-cache.c                  |  45 ++
>  .../etc/ld.so.conf                            |   2 +
>  elf/tst-glibc-hwcaps-cache.root/postclean.req |   0
>  elf/tst-glibc-hwcaps-cache.script             |  18 +
>  elf/tst-glibc-hwcaps-mask.c                   |  31 ++
>  elf/tst-glibc-hwcaps-prepend-cache.c          | 133 ++++++
>  .../postclean.req                             |   0
>  elf/tst-glibc-hwcaps-prepend.c                |  32 ++
>  elf/tst-glibc-hwcaps.c                        |  28 ++
>  elf/tst-stringtable.c                         | 141 ++++++
>  support/Makefile                              |   1 +
>  support/support.h                             |   5 +
>  support/support_copy_file.c                   |  43 ++
>  sysdeps/generic/dl-cache.h                    | 233 +++++++++-
>  sysdeps/generic/ldconfig.h                    |  27 +-
>  sysdeps/generic/ldsodefs.h                    |  20 +-
>  sysdeps/powerpc/powerpc64/le/Makefile         |  28 ++
>  .../powerpc/powerpc64/le/dl-hwcaps-subdirs.c  |  46 ++
>  .../powerpc/powerpc64/le/tst-glibc-hwcaps.c   |  54 +++
>  sysdeps/x86_64/Makefile                       |  39 ++
>  sysdeps/x86_64/dl-hwcaps-subdirs.c            |  66 +++
>  sysdeps/x86_64/tst-glibc-hwcaps.c             |  76 ++++
>  40 files changed, 2839 insertions(+), 127 deletions(-)
>  create mode 100644 elf/dl-hwcaps-subdirs.c
>  create mode 100644 elf/dl-hwcaps_split.c
>  create mode 100644 elf/markermodMARKER-VALUE.c
>  create mode 100644 elf/stringtable.c
>  create mode 100644 elf/stringtable.h
>  create mode 100644 elf/stringtable_free.c
>  create mode 100644 elf/tst-dl-hwcaps_split.c
>  create mode 100644 elf/tst-glibc-hwcaps-cache.c
>  create mode 100644 elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf
>  create mode 100644 elf/tst-glibc-hwcaps-cache.root/postclean.req
>  create mode 100644 elf/tst-glibc-hwcaps-cache.script
>  create mode 100644 elf/tst-glibc-hwcaps-mask.c
>  create mode 100644 elf/tst-glibc-hwcaps-prepend-cache.c
>  create mode 100644 elf/tst-glibc-hwcaps-prepend-cache.root/postclean.req
>  create mode 100644 elf/tst-glibc-hwcaps-prepend.c
>  create mode 100644 elf/tst-glibc-hwcaps.c
>  create mode 100644 elf/tst-stringtable.c
>  create mode 100644 support/support_copy_file.c
>  create mode 100644 sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c
>  create mode 100644 sysdeps/powerpc/powerpc64/le/tst-glibc-hwcaps.c
>  create mode 100644 sysdeps/x86_64/dl-hwcaps-subdirs.c
>  create mode 100644 sysdeps/x86_64/tst-glibc-hwcaps.c
> 
> -- 
> Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
> Commercial register: Amtsgericht Muenchen, HRB 153243,
> Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
>
  
Florian Weimer Nov. 10, 2020, 10:41 a.m. UTC | #2
* Dan Horák:

>> I have dropped the s390x patch until I have located a suitable machine
>> on which to test it.  We also need to discuss how to achieve GCC
>> alignment there.
>
> Florian, what kind of machine do you need?

z15 with unrestricted user namespaces.  z/VM vs KVM should not matter
(but it would be nice to test with a typical z/VM setup too).

Thanks,
Florian
  
Florian Weimer Nov. 25, 2020, 3:46 p.m. UTC | #3
* Florian Weimer via Libc-alpha:

> Florian Weimer (11):
>   support: Add support_copy_file
>   elf: Introduce enum opt_format in the ldconfig implementation
>   elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
>   elf: Add endianness markup to ld.so.cache
>   elf: Add extension mechanism to ld.so.cache
>   elf: Implement a string table for ldconfig, with tail merging
>   elf: Implement tail merging of strings in ldconfig
>   elf: Process glibc-hwcaps subdirectories in ldconfig
>   elf: Add glibc-hwcaps subdirectory support to ld.so cache processing
>   x86_64: Add glibc-hwcaps support
>   powerpc64le: Add glibc-hwcaps support

Ping.  I'd like to move this forward.

Thanks,
Florian
  
H.J. Lu Nov. 25, 2020, 3:58 p.m. UTC | #4
On Wed, Nov 25, 2020 at 7:47 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> * Florian Weimer via Libc-alpha:
>
> > Florian Weimer (11):
> >   support: Add support_copy_file
> >   elf: Introduce enum opt_format in the ldconfig implementation
> >   elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
> >   elf: Add endianness markup to ld.so.cache
> >   elf: Add extension mechanism to ld.so.cache
> >   elf: Implement a string table for ldconfig, with tail merging
> >   elf: Implement tail merging of strings in ldconfig
> >   elf: Process glibc-hwcaps subdirectories in ldconfig
> >   elf: Add glibc-hwcaps subdirectory support to ld.so cache processing
> >   x86_64: Add glibc-hwcaps support
> >   powerpc64le: Add glibc-hwcaps support
>
> Ping.  I'd like to move this forward.
>

x86_64 bits look good to me.

Thanks.
  
Adhemerval Zanella Nov. 25, 2020, 5:20 p.m. UTC | #5
On 25/11/2020 12:46, Florian Weimer via Libc-alpha wrote:
> * Florian Weimer via Libc-alpha:
> 
>> Florian Weimer (11):
>>   support: Add support_copy_file
>>   elf: Introduce enum opt_format in the ldconfig implementation
>>   elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
>>   elf: Add endianness markup to ld.so.cache
>>   elf: Add extension mechanism to ld.so.cache
>>   elf: Implement a string table for ldconfig, with tail merging
>>   elf: Implement tail merging of strings in ldconfig
>>   elf: Process glibc-hwcaps subdirectories in ldconfig
>>   elf: Add glibc-hwcaps subdirectory support to ld.so cache processing
>>   x86_64: Add glibc-hwcaps support
>>   powerpc64le: Add glibc-hwcaps support
> 
> Ping.  I'd like to move this forward.

I will try to review this fully until the end this week.