[all-commits] [llvm/llvm-project] efd71d: [libc] Allow time conversions to compile on bare m...

Simon Tatham via All-commits all-commits at lists.llvm.org
Wed Aug 7 01:11:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: efd71d921396c71adb2362d91fd9cdfbac21abc2
      https://github.com/llvm/llvm-project/commit/efd71d921396c71adb2362d91fd9cdfbac21abc2
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2024-08-07 (Wed, 07 Aug 2024)

  Changed paths:
    M libc/config/baremetal/arm/entrypoints.txt
    M libc/config/baremetal/riscv/entrypoints.txt
    M libc/src/time/time_utils.h

  Log Message:
  -----------
  [libc] Allow time conversions to compile on bare metal (#102014)

The `<time.h>` functions `asctime`, `gmtime`, `mktime` and their `_r`
variants are purely computational functions which convert between well
defined time representations and/or strings. There's no reason these
shouldn't be available in bare-metal builds of the library as well as
hosted ones: even if the library has no way to find out the time in
POSIX format, it might still see POSIX-style `time_t` values in input
data (e.g. network protocols) and need to interpret them.

The only obstacle to this was that the `out_of_range()` helper function
set `errno` to `EOVERFLOW`, which fails in a bare-metal build because
the extra POSIX error values aren't defined, including `EOVERFLOW`. So
I've made that assignment conditional on `EOVERFLOW` being defined.

Fixes #85556.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list