Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759001 - sys-libs/glibc: alpha's bits/stat.h header causes problems
Summary: sys-libs/glibc: alpha's bits/stat.h header causes problems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/git/?p=glibc.g...
Whiteboard:
Keywords:
Depends on:
Blocks: 735818
  Show dependency tree
 
Reported: 2020-12-08 01:55 UTC by Matt Turner
Modified: 2021-01-05 02:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-libs/glib-2.66.3 build failure (t.t,2.33 KB, text/plain)
2020-12-08 01:55 UTC, Matt Turner
Details
0001-alpha-Remove-anonymous-union-in-struct-stat.patch (0001-alpha-Remove-anonymous-union-in-struct-stat.patch,1.72 KB, text/plain)
2020-12-08 01:56 UTC, Matt Turner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Turner gentoo-dev 2020-12-08 01:55:12 UTC
Created attachment 677200 [details]
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)
Comment 1 Matt Turner gentoo-dev 2020-12-08 01:56:23 UTC
Created attachment 677203 [details]
0001-alpha-Remove-anonymous-union-in-struct-stat.patch

I'm going to send this patch upstream, but I would appreciate a second set of eyes taking a look at it before I do so :)
Comment 2 Matt Turner gentoo-dev 2020-12-21 14:58:49 UTC
This is now upstream as $URL and will be in glibc-2.33. Can we please cherry-pick the patch to our patchset?
Comment 3 Larry the Git Cow gentoo-dev 2020-12-24 08:05:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50e2dbbcb63c7f35c03709c6ec791300466a27ec

commit 50e2dbbcb63c7f35c03709c6ec791300466a27ec
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-12-24 08:05:19 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-12-24 08:05:45 +0000

    sys-libs/glibc: 2.32: cut 5 patchset
    
    Two new patches:
    - tests-mcheck: New variable to run tests with MALLOC_CHECK_=3
    - alpha: Remove anonymous union in struct stat [BZ #27042]
    
    Closes: https://bugs.gentoo.org/759001
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-libs/glibc/Manifest             |    1 +
 sys-libs/glibc/glibc-2.32-r6.ebuild | 1513 +++++++++++++++++++++++++++++++++++
 2 files changed, 1514 insertions(+)
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-12-24 08:08:42 UTC
Should be in 2.32-r6. Thank you for follow-up!