public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.ibm.com>
To: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>,
	Javier Pello <devel@otheo.eu>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	bergner@linux.ibm.com
Subject: Re: [RFC 0/9] Remove legacy platform bits and cleanups
Date: Wed, 12 Jun 2024 09:50:28 +0200	[thread overview]
Message-ID: <f11f09d7-f0df-4f6c-baaa-cbbf836ec850@linux.ibm.com> (raw)
In-Reply-To: <8c9ab3f3-5404-4878-8d84-4bd7aef7d1a1@linux.ibm.com>

On 11.06.24 14:13, Stefan Liebler wrote:
> On 10.06.24 15:36, Stefan Liebler wrote:
>> On 08.06.24 13:09, Florian Weimer wrote:
>>> * 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
>>>
>>> This series fails to build on MIPS with:
>>>
>>> mips64-glibc-linux-gnu-gcc -mabi=32 ldconfig.c -c -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wp,-U_FORTIFY_SOURCE -Wstrict-prototypes -Wold-style-definition -fmath-errno -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64   -fPIE    -Wa,-execstack -D'SYSCONFDIR="/etc"' -D'LIBDIR="/usr/lib"' -D'SLIBDIR="/lib"'       -I../include -I/home/bmg/build/glibcs/mips-linux-gnu/glibc/elf  -I/home/bmg/build/glibcs/mips-linux-gnu/glibc  -I../sysdeps/unix/sysv/linux/mips/mips32/fpu  -I../sysdeps/unix/sysv/linux/mips/mips32  -I../sysdeps/unix/sysv/linux/mips  -I../sysdeps/mips/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/mips/mips32  -I../sysdeps/unix/mips  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/mips/mips32/fpu  -I../sysdeps/mips/mips32  -I../sysdeps/mips/ieee754  -I../sysdeps/mips/include -I../sysdeps/mips  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/wordsize-32  -I../sysdeps/mips/fpu  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /home/bmg/build/glibcs/mips-linux-gnu/glibc/libc-modules.h -DMODULE_NAME=ldconfig -include ../include/libc-symbols.h  -DPIC     -DTOP_NAMESPACE=glibc -o /home/bmg/build/glibcs/mips-linux-gnu/glibc/elf/ldconfig.o -MD -MP -MF /home/bmg/build/glibcs/mips-linux-gnu/glibc/elf/ldconfig.o.dt -MT /home/bmg/build/glibcs/mips-linux-gnu/glibc/elf/ldconfig.o
>>> In file included from ../sysdeps/generic/ldsodefs.h:643,
>>>                  from ../sysdeps/mips/ldsodefs.h:82,
>>>                  from ../sysdeps/gnu/ldsodefs.h:46,
>>>                  from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
>>>                  from ../sysdeps/unix/sysv/linux/mips/ldsodefs.h:22,
>>>                  from ../sysdeps/mips/dl-procinfo.h:22,
>>>                  from /home/bmg/build/glibcs/mips-linux-gnu/glibc/dl-tunable-list.h:6,
>>>                  from ../elf/dl-tunables.h:48,
>>>                  from ./dl-hwcaps.h:25,
>>>                  from ldconfig.c:44:
>>> ../sysdeps/unix/sysv/linux/dl-vdso-setup.c:62:22: error: ‘_dl_vdso_clock_getres’ defined but not used [-Werror=unused-variable]
>>>    62 | PROCINFO_CLASS int (*_dl_vdso_clock_getres) (clockid_t,
>>>       |                      ^~~~~~~~~~~~~~~~~~~~~
>>> ../sysdeps/unix/sysv/linux/dl-vdso-setup.c:53:22: error: ‘_dl_vdso_gettimeofday’ defined but not used [-Werror=unused-variable]
>>>    53 | PROCINFO_CLASS int (*_dl_vdso_gettimeofday) (struct timeval *, void *) RELRO;
>>>       |                      ^~~~~~~~~~~~~~~~~~~~~
>>> ../sysdeps/unix/sysv/linux/dl-vdso-setup.c:49:22: error: ‘_dl_vdso_clock_gettime64’ defined but not used [-Werror=unused-variable]
>>>    49 | PROCINFO_CLASS int (*_dl_vdso_clock_gettime64) (clockid_t,
>>>       |                      ^~~~~~~~~~~~~~~~~~~~~~~~
>>> ../sysdeps/unix/sysv/linux/dl-vdso-setup.c:45:22: error: ‘_dl_vdso_clock_gettime’ defined but not used [-Werror=unused-variable]
>>>    45 | PROCINFO_CLASS int (*_dl_vdso_clock_gettime) (clockid_t,
>>>       |                      ^~~~~~~~~~~~~~~~~~~~~~
>>> cc1: all warnings being treated as errors
>>> make[3]: *** [../o-iterator.mk:9: /home/bmg/build/glibcs/mips-linux-gnu/glibc/elf/ldconfig.o] Error 1
>>> make[3]: Leaving directory '/home/bmg/src/glibc/elf'
>>> make[3]: *** Waiting for unfinished jobs....
>>> make[2]: *** [Makefile:484: elf/others] Error 2
>>> make[1]: *** [Makefile:9: all] Error 2
>>>
>>> Florian
>>>
>> Hi Florian,
>>
>> thanks for the info. I've take a look. Seems to be related to the
>> removed sysdeps/mips/dl-procinfo.c with those undefs at the end:
>> #undef PROCINFO_DECL
>> #undef PROCINFO_CLASS
>>
>> Bye,
>> Stefan
> 
> Okay, we have this chain:
> - elf/ldconfig.c:
> #define PROCINFO_CLASS static
> #include <dl-hwcaps.h>
> -> elf/dl-hwcaps.h
> -> elf/dl-tunables.h
> -> <build>/dl-tunable-list.h
> -> sysdeps/mips/dl-procinfo.h:
> -> sysdeps/unix/sysv/linux/mips/ldsodefs.h
> -> sysdeps/unix/sysv/linux/ldsodefs.h:
> -> sysdeps/gnu/ldsodefs.h
> -> sysdeps/mips/ldsodefs.h
> -> sysdeps/generic/ldsodefs.h:
> ...
> #include <dl-procinfo.c>
> ...
> # define PROCINFO_DECL
> # ifndef PROCINFO_CLASS
> #  define PROCINFO_CLASS EXTERN
> # endif
> # include <dl-vdso-setup.c>
> ...
> 
> Before my patch, sysdeps/mips/dl-procinfo.c contains those undefs at the
> end:
> #undef PROCINFO_DECL
> #undef PROCINFO_CLASS
> With my patch, the empty sysdeps/generic/dl-procinfo.c is used.
> 
> Thus we end up in:
> static int (*_dl_vdso_...) (...) RELRO;
> vs before:
> extern int (*_dl_vdso_...) (...) RELRO;
> 
> The latter builds fine, while the former produces the "defined but not
> used" warnings.
> 
> 
> Thus I will adjust my patch to keep sysdeps/mips/dl-procinfo.c with only
> something like this:
> /* Note:
>    When compiling elf/ldconfig.c, PROCINFO_CLASS is defined to static.
>    This dl-procinfo.c is included in sysdeps/generic/ldsodefs.h.
>    Afterwards, if not yet defined, PROCINFO_CLASS is defined to EXTERN
>    just before dl-vdso-setup.c is included.  A "static" _dl_vdso_xyz
>    function prototype would lead to gcc warnings/errors: defined but
>    not used.  */
> #undef PROCINFO_DECL
> #undef PROCINFO_CLASS
> 
> 
> My patch also removes sysdeps/alpha/dl-procinfo.c and
> sysdeps/csky/dl-procinfo.c with those #undef's at the end. But alpha and
> csky do not define the vdso HAVE_XYZ_VSYSCALL macros and thus do not end
> up with those errors.
> (At the end of dl-vdso-setup.c, PROCINFO_DECL and PROCINFO_CLASS are
> also undefined)
> 
> I run build-many-glibcs.py from scratch which lasts some time.
> Afterwards I'll send a V2 series.
> 
> Thanks,
> Stefan

I've successfully run build-many-glibcs.py from scratch - all PASSed -
and I send a V2 with the MIPS-fix:
[V2] elf: Remove platform strings in dl-procinfo.c
https://sourceware.org/pipermail/libc-alpha/2024-June/157391.html

Adhemerval has already reviewed the remaining patches. As soon as this
V2 is also reviewed, I can push the series.

Thanks,
Stefan

  reply	other threads:[~2024-06-12  7:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 11:42 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 [this message]
2024-06-18  8:55         ` Stefan Liebler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f11f09d7-f0df-4f6c-baaa-cbbf836ec850@linux.ibm.com \
    --to=stli@linux.ibm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=bergner@linux.ibm.com \
    --cc=devel@otheo.eu \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).