Skip to content

Commit a2c19cd

Browse files
authored
[mono] Add cmake check for HAVE_CLOCK_GETTIME (#88428)
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.
1 parent d1f0c79 commit a2c19cd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/mono/cmake/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,9 @@
957957
/* Enable WebCIL image loader */
958958
#cmakedefine ENABLE_WEBCIL 1
959959

960+
/* define if clockgettime exists */
961+
#cmakedefine HAVE_CLOCK_GETTIME 1
962+
960963
#if defined(ENABLE_LLVM) && defined(HOST_WIN32) && defined(TARGET_WIN32) && (!defined(TARGET_AMD64) || !defined(_MSC_VER))
961964
#error LLVM for host=Windows and target=Windows is only supported on x64 MSVC build.
962965
#endif

src/mono/cmake/configure.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ ac_check_funcs(
115115
pthread_attr_setstacksize pthread_get_stackaddr_np
116116
)
117117

118+
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
119+
118120
check_symbol_exists(madvise "sys/mman.h" HAVE_MADVISE)
119121
check_symbol_exists(pthread_mutexattr_setprotocol "pthread.h" HAVE_DECL_PTHREAD_MUTEXATTR_SETPROTOCOL)
120122
check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC)

0 commit comments

Comments
 (0)