Skip to content

Commit

Permalink
[mono] Add cmake check for HAVE_CLOCK_GETTIME (#88428)
Browse files Browse the repository at this point in the history
Fixes an issue with missing method names when perf is used together with BenchmarkDotNet using Mono on Linux due to incorrect event order of the fork events and the mmap2 events.
  • Loading branch information
saitama951 authored Jul 6, 2023
1 parent d1f0c79 commit a2c19cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mono/cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@
/* Enable WebCIL image loader */
#cmakedefine ENABLE_WEBCIL 1

/* define if clockgettime exists */
#cmakedefine HAVE_CLOCK_GETTIME 1

#if defined(ENABLE_LLVM) && defined(HOST_WIN32) && defined(TARGET_WIN32) && (!defined(TARGET_AMD64) || !defined(_MSC_VER))
#error LLVM for host=Windows and target=Windows is only supported on x64 MSVC build.
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/mono/cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ ac_check_funcs(
pthread_attr_setstacksize pthread_get_stackaddr_np
)

check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)

check_symbol_exists(madvise "sys/mman.h" HAVE_MADVISE)
check_symbol_exists(pthread_mutexattr_setprotocol "pthread.h" HAVE_DECL_PTHREAD_MUTEXATTR_SETPROTOCOL)
check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC)
Expand Down

0 comments on commit a2c19cd

Please sign in to comment.