From: Sanjam Panda <36253777+saitama951@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:21:28 +0000 (+0530) Subject: [mono] Add cmake check for HAVE_CLOCK_GETTIME (#88428) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~1197 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2c19cd005a1130ba7f921e0264287cfbfa8513c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [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. --- diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index d9ed866..6a12eb5 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -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 diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index d85e488..fb9df16 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -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)