[Bug libc/27042] New: [alpha] anonymous union in struct stat confuses detection logic

mattst88 at gmail dot com sourceware-bugzilla@sourceware.org
Wed Dec 9 16:18:07 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=27042

            Bug ID: 27042
           Summary: [alpha] anonymous union in struct stat confuses
                    detection logic
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: mattst88 at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 13030
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13030&action=edit
dev-libs/glib-2.66.3 build failure

glibc's bits/stat.h header tricks the configure feature detection in at least
dev-libs/glib and app-arch/zstd (see bug 735818).

The issue is

#  define __ST_TIME(X)                         \
       __extension__ union {                   \
           struct timespec st_##X##tim;        \
           struct {                            \
               __time_t st_##X##time;          \
               unsigned long st_##X##timensec; \
           };                                  \
       }

... a neat trick using an anonymous union to provide st_mtimensec, et al.

glib's configuration results look like this on amd64:

Checking if "statx() test" compiles: YES 
Header <locale.h> has symbol "LC_MESSAGES" : YES 
Checking whether type "struct stat" has member "st_mtimensec" : NO 
Checking whether type "struct stat" has member "st_mtim.tv_nsec" : YES 
Checking whether type "struct stat" has member "st_atimensec" : NO 
Checking whether type "struct stat" has member "st_atim.tv_nsec" : YES 
Checking whether type "struct stat" has member "st_ctimensec" : NO 
Checking whether type "struct stat" has member "st_ctim.tv_nsec" : YES 

but like this on alpha:

Checking if "statx() test" compiles: YES 
Header <locale.h> has symbol "LC_MESSAGES" : YES 
Checking whether type "struct stat" has member "st_mtimensec" : YES 
Checking whether type "struct stat" has member "st_mtim.tv_nsec" : YES 
Checking whether type "struct stat" has member "st_atimensec" : YES 
Checking whether type "struct stat" has member "st_atim.tv_nsec" : YES 
Checking whether type "struct stat" has member "st_ctimensec" : YES 
Checking whether type "struct stat" has member "st_ctim.tv_nsec" : YES 

which ultimately causes the build to compile a path that doesn't work.
(Attached is the build failure snippet)


See downstream bug reports
https://bugs.gentoo.org/759001
https://bugs.gentoo.org/735818

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list