We are seeing a build error on Linux with musl libc on ARM (JuliaPackaging/Yggdrasil#13550 (comment)) with --enable-armv8-cntvct-el0 because CLOCK_SGI_CYCLE is defined (for some reason) by the musl time.h header, so then cycle.h ends up trying to define ticks twice.
Probably at least two changes:
- In
cycle.h, move all of the implementations based on high-level functions like clock_gettime to go below the low-level cycle counters, so that the cycle counters are preferred.
- Don't use
CLOCK_SGI_CYCLE on non-SGI systems (i.e. on no modern systems)?
We are seeing a build error on Linux with musl libc on ARM (JuliaPackaging/Yggdrasil#13550 (comment)) with
--enable-armv8-cntvct-el0becauseCLOCK_SGI_CYCLEis defined (for some reason) by the musltime.hheader, so thencycle.hends up trying to definetickstwice.Probably at least two changes:
cycle.h, move all of the implementations based on high-level functions likeclock_gettimeto go below the low-level cycle counters, so that the cycle counters are preferred.CLOCK_SGI_CYCLEon non-SGI systems (i.e. on no modern systems)?