[Bug 293859] C11's call_once requires nonstandard library -lstdthreads for linking

[email protected] Tue, 17 Mar 2026 21:50:22 +0000
Newsgroups gmane.os.freebsd.devel.standards
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293859

--- Comment #7 from Matthias Andree <[email protected]> ---
(In reply to Konstantin Belousov from comment #3)
| The program you provided uses the C std facilities, and this requires
-lstdthreads.
| This library is going to stay separate.

So, assuming that's the direction, do we add automatic linking of
libstdthreads.* 

- if <threads.h> is #included?

- if the program or shared object is linked against -lpthread (that's what
POSIX's requires if the compiler is invoked via the c17 utility)


Similar discussions were led in the GCC context around whether it should
automatically link -latomic, and support seems to have landed late 2025. I am
aware we usually use clang. And we do have --as-needed in case we link
automatically.

-- 
You are receiving this mail because:
You are the assignee for the bug.