File tree 4 files changed +2
-13
lines changed
utils/gn/secondary/llvm/include/llvm/Config
4 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -274,8 +274,6 @@ if( LLVM_USING_GLIBC )
274
274
list (APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE" )
275
275
endif ()
276
276
# This check requires _GNU_SOURCE
277
- check_symbol_exists(sched_getaffinity sched.h HAVE_SCHED_GETAFFINITY)
278
- check_symbol_exists(CPU_COUNT sched.h HAVE_CPU_COUNT)
279
277
if (NOT PURE_WINDOWS)
280
278
if (LLVM_PTHREAD_LIB)
281
279
list (APPEND CMAKE_REQUIRED_LIBRARIES ${LLVM_PTHREAD_LIB} )
Original file line number Diff line number Diff line change 160
160
/* Define to 1 if you have the `setenv' function. */
161
161
#cmakedefine HAVE_SETENV ${HAVE_SETENV}
162
162
163
- /* Define to 1 if you have the `sched_getaffinity' function. */
164
- #cmakedefine HAVE_SCHED_GETAFFINITY ${HAVE_SCHED_GETAFFINITY}
165
-
166
- /* Define to 1 if you have the `CPU_COUNT' macro. */
167
- #cmakedefine HAVE_CPU_COUNT ${HAVE_CPU_COUNT}
168
-
169
163
/* Define to 1 if you have the `setrlimit' function. */
170
164
#cmakedefine HAVE_SETRLIMIT ${HAVE_SETRLIMIT}
171
165
Original file line number Diff line number Diff line change 38
38
#endif
39
39
40
40
#if defined(__linux__)
41
+ #include < sched.h> // For sched_getaffinity
41
42
#include < sys/syscall.h> // For syscall codes
42
43
#include < unistd.h> // For syscall()
43
44
#endif
@@ -271,7 +272,7 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) {
271
272
#include < thread>
272
273
273
274
int computeHostNumHardwareThreads () {
274
- #if defined(HAVE_SCHED_GETAFFINITY) && defined(HAVE_CPU_COUNT)
275
+ #ifdef __linux__
275
276
cpu_set_t Set;
276
277
if (sched_getaffinity (0 , sizeof (Set), &Set) == 0 )
277
278
return CPU_COUNT (&Set);
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ write_cmake_config("config") {
141
141
" HAVE_LSEEK64=1" ,
142
142
" HAVE_MALLINFO=1" ,
143
143
" HAVE_POSIX_FALLOCATE=1" ,
144
- " HAVE_SCHED_GETAFFINITY=1" ,
145
- " HAVE_CPU_COUNT=1" ,
146
144
" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1" ,
147
145
]
148
146
} else {
@@ -152,8 +150,6 @@ write_cmake_config("config") {
152
150
" HAVE_LSEEK64=" ,
153
151
" HAVE_MALLINFO=" ,
154
152
" HAVE_POSIX_FALLOCATE=" ,
155
- " HAVE_SCHED_GETAFFINITY=" ,
156
- " HAVE_CPU_COUNT=" ,
157
153
" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=" ,
158
154
]
159
155
}
You can’t perform that action at this time.
0 commit comments