Skip to content

Commit

Permalink
Merge pull request #6274 from shamisp/topic/v1.10.x/timer_check
Browse files Browse the repository at this point in the history
UCS: A fix for cross compilation support in configure - v1.10.x
  • Loading branch information
yosefe authored Feb 5, 2021
2 parents 4861030 + 416253f commit 8b32765
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ucs/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,16 @@ AS_IF([test "x$with_cache_line_size" != xno],[
case ${host} in
aarch64*)
AC_MSG_CHECKING([support for CNTVCT_EL0 on aarch64])
AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[#include <stdint.h>]],
[[uint64_t tmp; asm volatile("mrs %0, cntvct_el0" : "=r" (tmp));]])],
[AC_MSG_RESULT([yes])]
[AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])],
[AC_MSG_RESULT([no])]
[AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])]
);;
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]],
[[uint64_t tmp; asm volatile("mrs %0, cntvct_el0" : "=r" (tmp));
]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])],
[AC_MSG_RESULT([no])
AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])],
[AC_MSG_RESULT([no - cross-compiling detected])
AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])]
);;
*)
# HW timer is supported for all other architectures
AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])
Expand Down

0 comments on commit 8b32765

Please sign in to comment.