[flang-commits] [flang] [Flang] `TIME_UTC` is not available on AIX7.2. Using POSIX alternative `clock_gettime` instead. (PR #98915)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Mon Jul 15 11:20:52 PDT 2024


DanielCChen wrote:

> `clock_gettime` becomes active if `CLOCKID_ELAPSED_TIME` is set (if walltime requested) or `CLOCK_CPU_TIME` is set (if CPU time requested). Does AIX also support this? Because then the path with `timespec_get` should not be triggered.

AIX has both `CLOCK_PROCESS_CPUTIME_ID` and `CLOCK_THREAD_CPUTIME_ID`. I see that it should fall into `ifdef CLOCKID_CPU_TIME` block.
However, the build failed at the compile time because `TIME_UTC` does not exist in `time.h` on AIX 7.2. Since it is a fallback path, I should just check `ifndef _AIX` . 

https://github.com/llvm/llvm-project/pull/98915


More information about the flang-commits mailing list