File tree Expand file tree Collapse file tree 4 files changed +2
-13
lines changed
utils/gn/secondary/llvm/include/llvm/Config Expand file tree Collapse file tree 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 )
274274 list (APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE" )
275275endif ()
276276# 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 )
279277if (NOT PURE_WINDOWS)
280278 if (LLVM_PTHREAD_LIB)
281279 list (APPEND CMAKE_REQUIRED_LIBRARIES ${LLVM_PTHREAD_LIB} )
Original file line number Diff line number Diff line change 160160/* Define to 1 if you have the `setenv' function. */
161161#cmakedefine HAVE_SETENV ${HAVE_SETENV}
162162
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-
169163/* Define to 1 if you have the `setrlimit' function. */
170164#cmakedefine HAVE_SETRLIMIT ${HAVE_SETRLIMIT}
171165
Original file line number Diff line number Diff line change 3838#endif
3939
4040#if defined(__linux__)
41+ #include < sched.h> // For sched_getaffinity
4142#include < sys/syscall.h> // For syscall codes
4243#include < unistd.h> // For syscall()
4344#endif
@@ -271,7 +272,7 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) {
271272#include < thread>
272273
273274int computeHostNumHardwareThreads () {
274- #if defined(HAVE_SCHED_GETAFFINITY) && defined(HAVE_CPU_COUNT)
275+ #ifdef __linux__
275276 cpu_set_t Set;
276277 if (sched_getaffinity (0 , sizeof (Set), &Set) == 0 )
277278 return CPU_COUNT (&Set);
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ write_cmake_config("config") {
141141 " HAVE_LSEEK64=1" ,
142142 " HAVE_MALLINFO=1" ,
143143 " HAVE_POSIX_FALLOCATE=1" ,
144- " HAVE_SCHED_GETAFFINITY=1" ,
145- " HAVE_CPU_COUNT=1" ,
146144 " HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1" ,
147145 ]
148146 } else {
@@ -152,8 +150,6 @@ write_cmake_config("config") {
152150 " HAVE_LSEEK64=" ,
153151 " HAVE_MALLINFO=" ,
154152 " HAVE_POSIX_FALLOCATE=" ,
155- " HAVE_SCHED_GETAFFINITY=" ,
156- " HAVE_CPU_COUNT=" ,
157153 " HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=" ,
158154 ]
159155 }
You can’t perform that action at this time.
0 commit comments