Re: [PATCH 1/1] Use types.h and not time_types.h in sockios.h
From: Geoffrey Le Gourriérec <hidden>
Date: 2021-01-24 16:39:23
On Sat, Jan 23, 2021 at 5:56 PM Geoffrey Le Gourriérec [off-list ref] wrote:quoted
I did a quick header dependency analysis starting from __kernel_time64_t (one of the offending types), but could "follow up" to linux/time_types.h as expected; so I fail to understand how this could break. What's even more confusing is linux/time_types.h includes linux/types.h itself.Could you try producing a preprocessed version of the source file using 'gcc -E' instead of 'gcc -c', using the same arguments as in the failing command? The output of that should help pinpoint what is going wrong.
Hi Arnd, Here is the preprocessed uclibc-1.0.37/libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.h : https://pastebin.com/ypWCZK83 Considering the following dependency chain: include/uapi/asm-generic/posix_types.h (__kernel_time64_t and __kernel_old_time_t defined here) -- included by: include/uapi/asm/posix_types_32.h (within #ifndef __ASM_SH_POSIX_TYPES_32_H) ...It looks like we do not enter the __ASM_SH_POSIX_TYPES_32_H include guard. Searching for that in the uclibc source code, I fall upon this header: https://repo.or.cz/uclibc-ng.git/blob/ab1dd83bec59c9e65c31efd6e887182948f627be:/libc/sysdeps/linux/sh/bits/kernel_types.h ...with a preliminary comment that seems quite explicit (I am not familiar at all with the subject, sorry if I'm perhaps stating the obvious): /* Note that we use the exact same include guard #define names * as asm/posix_types.h. This will avoid gratuitous conflicts * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ #if !defined __ASM_SH_POSIX_TYPES_H && !defined __ASM_SH_POSIX_TYPES_32_H #define __ASM_SH_POSIX_TYPES_H #define __ASM_SH_POSIX_TYPES_32_H
I'm fairly sure the patch you sent gets you back to the original problem: Since it avoids including linux/time_types.h, the compiler no longer sees the line that fails to build, but at the same time you can not actually use the SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD constants any more, as the structures will be undefined.
That is correct, my patch just fixes the symptom. I plan to come back to the Buildroot folks with a proper patch once we've figured something out. Thanks for your review, -- Geoffrey Le dim. 24 janv. 2021 à 11:56, Arnd Bergmann [off-list ref] a écrit :
On Sat, Jan 23, 2021 at 5:56 PM Geoffrey Le Gourriérec [off-list ref] wrote:quoted
I did a quick header dependency analysis starting from __kernel_time64_t (one of the offending types), but could "follow up" to linux/time_types.h as expected; so I fail to understand how this could break. What's even more confusing is linux/time_types.h includes linux/types.h itself.Could you try producing a preprocessed version of the source file using 'gcc -E' instead of 'gcc -c', using the same arguments as in the failing command? The output of that should help pinpoint what is going wrong. I'm fairly sure the patch you sent gets you back to the original problem: Since it avoids including linux/time_types.h, the compiler no longer sees the line that fails to build, but at the same time you can not actually use the SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD constants any more, as the structures will be undefined. Arnd