Skip to content

Commit 155467e

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 b2653db commit 155467e

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

145145
template <typename F>
146146
static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
147+
#if !defined(_WIN64) && defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 7
148+
// `GetLogicalProcessorInformationEx@12` was only added to i386 mingw-w64 in v7.0.0
149+
// https://github.com/mingw-w64/mingw-w64/commit/24842d45e025db0d38fa2bbd932b95a83282efa2#diff-faf1d8a1556e75a84b7cef2e89512e79R634
150+
return false;
151+
#else
147152
DWORD Len = 0;
148153
BOOL R = ::GetLogicalProcessorInformationEx(Relationship, NULL, &Len);
149154
if (R || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
@@ -164,6 +169,7 @@ static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
164169
}
165170
free(Info);
166171
return true;
172+
#endif
167173
}
168174

169175
static ArrayRef<ProcessorGroup> getProcessorGroups() {

0 commit comments

Comments
 (0)