Skip to content

RTS GetTime.c is broken on Darwins that include clock_gettime

GHC fails to build on versions of Darwin which include clock_gettime.

On Darwin versions which include clock_gettime, the #ifdefs are structured to prefer using clock_gettime over the mach-specific time functions and structs; however, a couple of places in GetTime.c use the mach functions unconditionally even though the mach/mach_time.h header won't be included if clock_gettime is available.

The attached patch fixes this by checking HAVE_CLOCK_GETTIME first before checking if the OS is Darwin.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown/Multiple
Architecture Unknown/Multiple
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information