https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115105

            Bug ID: 115105
           Summary: Document "Reimplement GNU threads library on native
                    Windows" change on GCC 13 changes list
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: web
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pedro at palves dot net
  Target Milestone: ---

This change:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
commit 9149a5b7e0a66b7b94d5b7db3194a975d18dea2f
Author:     Eric Botcazou <botca...@adacore.com>
AuthorDate: Fri Dec 23 23:45:15 2022 +0000
Commit:     Jonathan Yong <10wa...@gmail.com>
CommitDate: Fri Dec 23 23:58:06 2022 +0000

    Reimplement GNU threads library on native Windows

    This reimplements the GNU threads library on native Windows (except for the
    Objective-C specific subset) using direct Win32 API calls, in lieu of the
    implementation based on semaphores.  This base implementations requires
    Windows XP/Server 2003, which was the default minimal setting of MinGW-W64
    until end of 2020.  This also adds the support required for the C++11
threads,
    using again direct Win32 API calls; this additional layer requires Windows
    Vista/Server 2008 and is enabled only if _WIN32_WINNT >= 0x0600.

    This also changes libstdc++ to pass -D_WIN32_WINNT=0x0600 but only when the
    switch --enable-libstdcxx-threads is passed, which means that C++11 threads
    are still disabled by default *unless* MinGW-W64 itself is configured for
    Windows Vista/Server 2008 or later by default (this has been the case in
    the development version since end of 2020, for earlier versions you can
    configure it --with-default-win32-winnt=0x0600 to get the same effect).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

which is present in GCC 13 according to "git tag --contains 9149a5b7e0a6", and
although seemingly quite important for mingw gcc, is not mentioned anywhere at
https://gcc.gnu.org/gcc-13/changes.html AFAICS.  Could that page be updated,
mentioning what this improved in GCC 13, in practice?

Maybe even add some detail to https://gcc.gnu.org/install/configure.html and/or
wherever else the thread models should be documented.

The patch landed after this discussion, AFAICT:

  https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604106.html

where somewhere downthread NightStrike said, and I agree:

 ~~~~
 FWIW, Eric's proposal makes more practical sense.  Right now, people
 ship many permutations of the compiler:
 x86, x64, x86+x64
 dw2, sjlj (rarely), seh
 win32, posix+winpthread

 This is not sustainable, and certain combinations are largely
 incompatible (...)
 ~~~~

AFAICT looking around for binary builds of mingw gcc in the interwebs, it's not
easy to find one that uses the win32 model, and I think it could be partially
explained by people not knowing that the win32 model has been improved
substantially and supports C++11 threads properly.

Reply via email to