Skip to content

Commit 3f365d8

Browse files
cuvipernikic
authored andcommitted
[rust] 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 7ef0fa9 commit 3f365d8

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
@@ -142,6 +142,11 @@ struct ProcessorGroup {
142142

143143
template <typename F>
144144
static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
145+
#if !defined(_WIN64) && defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 7
146+
// `GetLogicalProcessorInformationEx@12` was only added to i386 mingw-w64 in v7.0.0
147+
// https://github.com/mingw-w64/mingw-w64/commit/24842d45e025db0d38fa2bbd932b95a83282efa2#diff-faf1d8a1556e75a84b7cef2e89512e79R634
148+
return false;
149+
#else
145150
DWORD Len = 0;
146151
BOOL R = ::GetLogicalProcessorInformationEx(Relationship, NULL, &Len);
147152
if (R || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
@@ -162,6 +167,7 @@ static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
162167
}
163168
free(Info);
164169
return true;
170+
#endif
165171
}
166172

167173
static ArrayRef<ProcessorGroup> getProcessorGroups() {

0 commit comments

Comments
 (0)