Skip to content

Commit 08116dc

Browse files
committed
Skip processor info on i386 mingw-w64 < 7
This will limit LLVM thread pools to a single thread on that target, but we don't use that functionality in rustc anyway. See also: llvm@8404aeb#commitcomment-37406150
1 parent eb5e571 commit 08116dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Support/Windows/Threading.inc

+6
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ struct ProcessorGroup {
139139

140140
template <typename F>
141141
static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
142+
#if !defined(_WIN64) && defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 7
143+
// `GetLogicalProcessorInformationEx@12` was only added to i386 mingw-w64 in v7.0.0
144+
// https://github.com/mingw-w64/mingw-w64/commit/24842d45e025db0d38fa2bbd932b95a83282efa2#diff-faf1d8a1556e75a84b7cef2e89512e79R634
145+
return false;
146+
#else
142147
DWORD Len = 0;
143148
BOOL R = ::GetLogicalProcessorInformationEx(Relationship, NULL, &Len);
144149
if (R || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
@@ -159,6 +164,7 @@ static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
159164
}
160165
free(Info);
161166
return true;
167+
#endif
162168
}
163169

164170
static ArrayRef<ProcessorGroup> getProcessorGroups() {

0 commit comments

Comments
 (0)