[Bug 293859] C++11's call_once requires -lstdthreads for linking

[email protected] Mon, 16 Mar 2026 16:26:07 +0000
Newsgroups gmane.os.freebsd.devel.standards
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293859

            Bug ID: 293859
           Summary: C++11's call_once requires -lstdthreads for linking
           Product: Base System
           Version: 15.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: standards
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: [email protected]
          Reporter: [email protected]
            Blocks: 292622

Greetings,

OpenEXR 3.4.7 has been released recently and switched effectively from using a
wrapped pthreads_once to a C11/C++11 standard [std::]call_once().  

On FreeBSD, this requires linking with -lstdthreads (which is documented in our
manual page), but this seems a nonstandard requirement -- apparently this has
caught other applications, too (see
<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292622>).

Can we please find a way on FreeBSD to
- either tell the toolchain to auto-link this library if either C++11's <mutex>
header or C11's <threads.h> header is defined (that's what Microsoft and
Boost.org seem to do, where headers specify what libraries to add to the link),
- or make sure the standard libraries (C/C++) do not require -lstdthreads?


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292622
[Bug 292622] textproc/link-grammar: ld-elf.so.1:
/usr/local/lib/liblink-grammar.so.5: Undefined symbol "call_once"
-- 
You are receiving this mail because:
You are the assignee for the bug.