Bug 2405428 - glibc: Mesa C11 shim conflict with glibc C23 support.
Summary: glibc: Mesa C11 shim conflict with glibc C23 support.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: rawhide
Hardware: Unspecified
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: Dave Airlie
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-21 19:10 UTC by Mikhail
Modified: 2026-03-18 04:25 UTC (History)
29 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-11-17 07:15:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
bad - build.log (125.50 KB, text/plain)
2025-10-21 19:12 UTC, Mikhail
no flags Details
good - build.log (416.21 KB, application/zip)
2025-10-21 19:13 UTC, Mikhail
no flags Details

Description Mikhail 2025-10-21 19:10:05 UTC
Regression window (glibc):
- Last known good: glibc-2.42.9000-5.fc44  → Mesa builds OK (Rawhide x86_64 still has -5).
- First bad:       glibc-2.42.9000-6.fc44  → Mesa FTBFS.
- Still bad:       glibc-2.42.9000-7.fc44  → Mesa FTBFS (seen on i386).

Scope: reproducible on all arches that updated to glibc ≥ 2.42.9000-6.fc44.

How I verified:
- mock x86_64 uses glibc-2.42.9000-5.fc44 → build succeeds.
- mock i386 pulls glibc-2.42.9000-7.fc44 → build fails with the same error.
- Locally exposed glibc-2.42.9000-6.fc44 to x86_64 via a repo → same FTBFS as on i386.

Error excerpt:
src/c11/threads.h:121:25: error: conflicting types for 'once_flag'; have 'pthread_once_t' (aka 'int')
.../bits/types/once_flag.h:24:21: note: previous declaration of 'once_flag'

Observation:
glibc ≥ 2.42 exposes C11 thread types (e.g. 'once_flag'), while Mesa's C11 shim also defines them,
leading to a header-level redefinition conflict.

Comment 1 Mikhail 2025-10-21 19:12:11 UTC
Created attachment 2110373 [details]
bad - build.log

Comment 2 Mikhail 2025-10-21 19:13:21 UTC
Created attachment 2110374 [details]
good - build.log

Comment 3 Carlos O'Donell 2025-10-21 23:56:43 UTC
(In reply to Mikhail from comment #0)
> Error excerpt:
> src/c11/threads.h:121:25: error: conflicting types for 'once_flag'; have
> 'pthread_once_t' (aka 'int')
> .../bits/types/once_flag.h:24:21: note: previous declaration of 'once_flag'

Interesting.

Mesa is compiling with -std=c11.

As of October 1st glibc is providing these for C23 and so for C11 they also show up in stdlib.h.

~~~
commit a7ddbf456d97ac8d1aa7afd735e196a1488bd874
Author: Joseph Myers <josmyers>
Date:   Wed Oct 1 15:15:15 2025 +0000

    Add once_flag, ONCE_FLAG_INIT and call_once to stdlib.h for C23
    
    C23 adds once_flag, ONCE_FLAG_INIT and call_once to stdlib.h (in C11
    they were only in threads.h, in C23 they are in both headers; this
    change came from N2840).  Implement this change, with a
    bits/types/once_flag.h header for the common type and initializer
    definitions.
    
    Note that there's an omnibus bug (bug 33001) that covers more than
    just these missing definitions.
    
    This doesn't seem a significant enough feature to be worth mentioning
    in NEWS.
    
    ISO C is not concerned with whether functions are in libc or
    libpthread, but POSIX links this to what header they are declared in,
    so functions declared in stdlib.h are supposed to be in libc.
    However, the current edition of POSIX is based on C17; hopefully Hurd
    glibc will have completed the merge of libpthread into libc (in
    particular, moving call_once) well before a future edition of POSIX
    based on C23 (or a later version of ISO C) is released.
    
    Tested for x86_64 and x86.
~~~

Joseph, Is there anything we want to do for source-level compatibility?

> Observation:
> glibc ≥ 2.42 exposes C11 thread types (e.g. 'once_flag'), while Mesa's C11
> shim also defines them,
> leading to a header-level redefinition conflict.

Mesa's C11 shim may need reworking as C23 support arrives.

Comment 5 Joseph Myers 2025-10-22 11:58:49 UTC
This build log is using -D_GNU_SOURCE, so it's expected that new symbols from any standard (in this case: pre-existing symbols now added to another header) will appear. As this is apparently a shim for C11 threads support, using glibc's version of C11 threads.h (supported since glibc 2.28) might be an option (I don't know if that would affect API or ABI compatibility for Mesa at all).

Comment 6 Arjun Shankar 2025-10-31 13:47:43 UTC
Moving to mesa for evaluation and possibly follow up upstream work.

Comment 7 Bojan Smojver 2025-11-04 23:21:03 UTC
Possibly tripped up latest FF build in rawhide: https://koji.fedoraproject.org/koji/buildinfo?buildID=2852168

Comment 8 José Expósito 2025-11-17 07:15:23 UTC
Closing this bug as the issues was solved upstream by Dave Airlie and it is incorporated in Fedora:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38298

Comment 9 Red Hat Bugzilla 2026-03-18 04:25:03 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days or the product is inactive and locked


Note You need to log in before you can comment on or make changes to this bug.