[libcxx-commits] [libcxx] [libc++][Windows] Enable thread::hardware_concurrency to support more than 64 processors (PR #168229)

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 26 12:10:48 PST 2025


mstorsjo wrote:

> Where is ALL_PROCESSOR_GROUPS coming from? We are getting this error in Android:
> 
> ```
> [1883/1896] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/thread.cpp.obj
> FAILED: libcxx/src/CMakeFiles/cxx_static.dir/thread.cpp.obj 
> /b/f/w/src/git/out/stage2-install/bin/clang++ --sysroot=/b/f/w/src/git/out/sysroots/x86_64-w64-mingw32 -DLIBCXX_BUILDING_LIBCXXABI -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_FILE_OFFSET_BITS=64 -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS="" -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/f/w/src/git/out/llvm-project/libcxx/src -I/b/f/w/src/git/out/lib/win-libcxx-windows/include/x86_64-w64-windows-gnu/c++/v1 -I/b/f/w/src/git/out/lib/win-libcxx-windows/include/c++/v1 -I/b/f/w/src/git/out/llvm-project/libcxxabi/include -I/b/f/w/src/git/out/llvm-project/cmake/Modules/../../libc -ffile-prefix-map=/b/f/w/src/git/= -B/b/f/w/src/git/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/bin --target=x86_64-pc-windows-gnu -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 -D__MSVCRT_VERSION__=0x1400 -D_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT=1 --sysroot=/b/f/w/src/git/out/sysroots/x86_64-w64-mingw32 -stdlib=libc++ -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -ffunction-sections -fdata-sections -O3 -DNDEBUG -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wzero-length-array -Wdeprecated-redundant-constexpr-static-def -Wno-nullability-completeness -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -fvisibility-global-new-delete=force-hidden -fdebug-prefix-map=/b/f/w/src/git/out/lib/win-libcxx-windows/include/c++/v1=/b/f/w/src/git/out/llvm-project/libcxx/include -std=c++2b -MD -MT libcxx/src/CMakeFiles/cxx_static.dir/thread.cpp.obj -MF libcxx/src/CMakeFiles/cxx_static.dir/thread.cpp.obj.d -o libcxx/src/CMakeFiles/cxx_static.dir/thread.cpp.obj -c /b/f/w/src/git/out/llvm-project/libcxx/src/thread.cpp
> /[b/f/w/src/git/out/llvm-project/libcxx/src/thread.cpp:77](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/src/thread.cpp?l=77):56: error: use of undeclared identifier 'ALL_PROCESSOR_GROUPS'
>    77 |   return static_cast<unsigned>(GetActiveProcessorCount(ALL_PROCESSOR_GROUPS));
>       |                                                        ^~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> ```

It should be defined in `winnt.h`. In the case of mingw-w64, it's been available in the headers since 2013: https://github.com/mingw-w64/mingw-w64/commit/d38dbecb74ec9e38408a442b435bd9bca6207640

https://github.com/llvm/llvm-project/pull/168229


More information about the libcxx-commits mailing list