public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC 0/9] Remove legacy platform bits and cleanups
@ 2024-06-07 11:42 Stefan Liebler
  2024-06-07 11:42 ` [RFC 1/9] x86: Remove HWCAP_START and HWCAP_COUNT Stefan Liebler
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Stefan Liebler @ 2024-06-07 11:42 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, devel, adhemerval.zanella, bergner, Stefan Liebler

This patch series is the result of:
"Question regarding platform-bits in ld.so.cache"
https://sourceware.org/pipermail/libc-alpha/2024-May/156793.html

According to the NEWS entry for glibc 2.37:
glibc commit "Add NEWS entry for legacy hwcaps removal"
https://sourceware.org/git/?p=glibc.git;a=commit;h=78d9a1620b840deb0880686e4159eaf70708866a
The dynamic linker no longer no longer loads shared objects from ... or
the subdirectory that corresponds to the AT_PLATFORM system name ...

According to Florian Weimer, it was an oversight and the usage of
_dl_string_platform(), _DL_PLATFORMS_COUNT and _DL_HWCAP_PLATFORM
should be removed in elf/dl-cache.c:search_cache().

This is done in the second patch of this series:
elf: Remove loading legacy hwcaps/platform entries in dynamic loader

The first patch is another oversight and HWCAP_START/HWCAP_COUNT on
x86 is not needed anymore after commit
ab40f20364f4a417a63dd51fdd943742070bfe96
"elf: Remove _dl_string_hwcap".

The remaining patches could cleanup even more things. But I've
currently marked this series as RFC as there are open questions.

- "elf: Remove _dl_string_platform"
_dl_string_platform() is now only used in the ld.so diagnostics output
on all architectures despite of powerpc where the result is stored in
tcb. Thus we could remove it everywhere else.

If it is okay for powerpc to remove the ld.so diagnostics output, the
arch-specific dl-procinfo.h files does not need _dl_string_platform()
anymore and we can just remove it.

If we keep the ld.so diagnostics output, we could just use the generic
macro-defintion in all the other arch-specific dl-procinfo.h files:
#define _dl_string_platform(str) (-1)


- "elf: Remove platform strings in dl-procinfo.c"
If _dl_string_platform() or the implementation is removed, the strings
are also not used anymore and can be removed. Of course not for powerpc.


- "elf: Remove _DL_HWCAP_PLATFORM"
Those macros are not used anymore after removal in
elf/dl-cache.c:search_cache(), _dl_string_platform().


- "elf: Remove _DL_FIRST_PLATFORM"
Those macros are not used anymore after removal in
_dl_string_platform().


- "elf: Remove _DL_PLATFORMS_COUNT"
Those macros are not used anymore after removal in
elf/dl-cache.c:search_cache() and _dl_string_platform().


- "elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask"
The environment variable LD_HWCAP_MASK / glibc-tunable
glibc.cpu.hwcap_mask is not used anymore after removal in
elf/dl-cache.c:search_cache() despite of sparc32 where it is used in
elf_machine_matches_host().

If sparc32 does not need it anymore, we can get rid of it at all.

Otherwise we could also move LD_HWCAP_MASK / tunable
glibc.cpu.hwcap_mask to be sparc32 specific?


- "elf: Remove HWCAP_IMPORTANT"
This is only dumped in the ld.so diagnostic output and was used as
default-value for LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask.


Stefan Liebler (9):
  x86: Remove HWCAP_START and HWCAP_COUNT
  elf: Remove loading legacy hwcaps/platform entries in dynamic loader
  elf: Remove _dl_string_platform
  elf: Remove platform strings in dl-procinfo.c
  elf: Remove _DL_HWCAP_PLATFORM
  elf: Remove _DL_FIRST_PLATFORM
  elf: Remove _DL_PLATFORMS_COUNT
  elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask
  elf: Remove HWCAP_IMPORTANT

 elf/dl-cache.c                                | 22 +------
 elf/dl-diagnostics.c                          |  3 -
 elf/dl-tunables.list                          |  7 ---
 elf/tst-env-setuid.c                          |  1 -
 manual/README.tunables                        | 12 ++--
 manual/tunables.texi                          | 11 ----
 sysdeps/alpha/dl-procinfo.c                   | 62 -------------------
 sysdeps/alpha/dl-procinfo.h                   | 24 -------
 sysdeps/csky/dl-procinfo.c                    | 62 -------------------
 sysdeps/csky/dl-procinfo.h                    | 23 -------
 sysdeps/generic/dl-procinfo.h                 |  8 ---
 sysdeps/generic/unsecvars.h                   |  1 -
 sysdeps/mips/dl-procinfo.c                    | 62 -------------------
 sysdeps/mips/dl-procinfo.h                    | 24 -------
 sysdeps/powerpc/dl-procinfo.h                 |  8 ---
 sysdeps/s390/dl-procinfo-s390.c               |  6 --
 sysdeps/s390/dl-procinfo.h                    | 29 ---------
 sysdeps/sparc/dl-procinfo.h                   | 10 ---
 sysdeps/sparc/sparc32/dl-machine.h            |  6 --
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h |  8 ---
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     |  7 ---
 sysdeps/x86/dl-hwcap.h                        | 25 --------
 sysdeps/x86/dl-procinfo.c                     | 21 +------
 sysdeps/x86/dl-procinfo.h                     | 22 -------
 sysdeps/x86_64/dl-procruntime.c               |  5 +-
 25 files changed, 13 insertions(+), 456 deletions(-)
 delete mode 100644 sysdeps/alpha/dl-procinfo.c
 delete mode 100644 sysdeps/csky/dl-procinfo.c
 delete mode 100644 sysdeps/mips/dl-procinfo.c

-- 
2.45.0


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-06-18  8:56 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07 11:42 [RFC 0/9] Remove legacy platform bits and cleanups Stefan Liebler
2024-06-07 11:42 ` [RFC 1/9] x86: Remove HWCAP_START and HWCAP_COUNT Stefan Liebler
2024-06-11 18:14   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 2/9] elf: Remove loading legacy hwcaps/platform entries in dynamic loader Stefan Liebler
2024-06-11 18:57   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 3/9] elf: Remove _dl_string_platform Stefan Liebler
2024-06-11 19:09   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 4/9] elf: Remove platform strings in dl-procinfo.c Stefan Liebler
2024-06-11 19:20   ` Adhemerval Zanella Netto
2024-06-12  7:32     ` [V2] " Stefan Liebler
2024-06-14 12:58       ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 5/9] elf: Remove _DL_HWCAP_PLATFORM Stefan Liebler
2024-06-11 19:28   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 6/9] elf: Remove _DL_FIRST_PLATFORM Stefan Liebler
2024-06-11 19:29   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 7/9] elf: Remove _DL_PLATFORMS_COUNT Stefan Liebler
2024-06-11 19:48   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 8/9] elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask Stefan Liebler
2024-06-11 20:04   ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 9/9] elf: Remove HWCAP_IMPORTANT Stefan Liebler
2024-06-11 20:07   ` Adhemerval Zanella Netto
2024-06-07 12:18 ` [RFC 0/9] Remove legacy platform bits and cleanups Florian Weimer
2024-06-10 13:23   ` Stefan Liebler
2024-06-10 14:03     ` Florian Weimer
2024-06-11 12:24       ` Stefan Liebler
2024-06-08 11:09 ` Florian Weimer
2024-06-10 13:36   ` Stefan Liebler
2024-06-11 12:13     ` Stefan Liebler
2024-06-12  7:50       ` Stefan Liebler
2024-06-18  8:55         ` Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).