Message ID | 20240607114543.659306-1-stli@linux.ibm.com |
---|---|
Headers | show |
Series | Remove legacy platform bits and cleanups | expand |
* Stefan Liebler: > - "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(). Are you sure about that? It is used to update GLRO(dl_hwcap), and that _rtld_global_ro member is consulted in various places. Its value is also returned by getauxval (AT_HWCAP). Thanks, Florian
* 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
On 07.06.24 14:18, Florian Weimer wrote: > * Stefan Liebler: > >> - "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(). > > Are you sure about that? It is used to update GLRO(dl_hwcap), and that > _rtld_global_ro member is consulted in various places. Its value is > also returned by getauxval (AT_HWCAP). > > Thanks, > Florian > I've had a look, but did not found the place where this update happens. I've also tried out this: cat tst-LD_HWCAP_MASK.c #include <stdio.h> #include <stdlib.h> #include <sys/auxv.h> int main (int argc, char *argv[]) { printf ("LD_HWCAP_MASK=\"%s\" GLIBC_TUNABLES=\"%s\" %s\n" "=> getauxval(AT_HWCAP)= 0x%lx\n", getenv("LD_HWCAP_MASK") ?: "", getenv("GLIBC_TUNABLES") ?: "", argv[0], getauxval (AT_HWCAP)); return EXIT_SUCCESS; } LD_HWCAP_MASK="" GLIBC_TUNABLES="" ./tst-LD_HWCAP_MASK-s390x.old => getauxval(AT_HWCAP)= 0x7fffff LD_HWCAP_MASK="0x0" GLIBC_TUNABLES="" ./tst-LD_HWCAP_MASK-s390x.old => getauxval(AT_HWCAP)= 0x7fffff LD_HWCAP_MASK="0xFFFFFFFF" GLIBC_TUNABLES="" ./tst-LD_HWCAP_MASK-s390x.old => getauxval(AT_HWCAP)= 0x7fffff LD_HWCAP_MASK="" GLIBC_TUNABLES="glibc.cpu.hwcap_mask=0x0" ./tst-LD_HWCAP_MASK-s390x.old => getauxval(AT_HWCAP)= 0x7fffff LD_HWCAP_MASK="" GLIBC_TUNABLES="glibc.cpu.hwcap_mask=0xFFFFFFFF" ./tst-LD_HWCAP_MASK-s390x.old => getauxval(AT_HWCAP)= 0x7fffff There is the e.g. GLIBC_TUNABLES=glibc.cpu.hwcaps= which let you disable/enable the hwcaps used for glibc internal ifuncs. Before I've implemented GLIBC_TUNABLES=glibc.cpu.hwcaps= for s390x, I've asked on libc-alpha and Szabolcs Nagy answered this: (see full question/answer: Questions regarding manipulation of IFUNC selection and tunables like glibc.cpu.hwcap_mask https://sourceware.org/pipermail/libc-alpha/2022-August/141648.html ) iirc LD_HWCAP_MASK was purely for the old hwcap based lib path lookup. ... i think hwcap_mask was not for completely hiding hwcaps like that. Attached to the old question is also a program which dumps the hwcaps passed to s390x-ifunc-resolver. But it was also not changed by the environment variables. Please also have a look, if you find the update of GLRO(dl_hwcap). Thanks, Stefan
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
* Stefan Liebler:
> Please also have a look, if you find the update of GLRO(dl_hwcap).
I tright once more, even went back in Git history, and used hardware
watchpoints, but the code I imagined is just not there. So I think it's
okay to proceed with this (fix the MIPS issue 8-).
Thanks,
Florian
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
On 10.06.24 16:03, Florian Weimer wrote: > * Stefan Liebler: > >> Please also have a look, if you find the update of GLRO(dl_hwcap). > > I tright once more, even went back in Git history, and used hardware > watchpoints, but the code I imagined is just not there. So I think it's > okay to proceed with this (fix the MIPS issue 8-). > > Thanks, > Florian > Sounds great. Thanks for digging.
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
On 12.06.24 09:50, Stefan Liebler wrote: > 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 Adhemerval has also reviewed [V2] elf: Remove platform strings in dl-procinfo.c Thus I've committed the series. Thanks, Stefan