[all-commits] [llvm/llvm-project] 2e2b6b: [AArch64][compiler-rt] Avoid use of libc header in...

Peter Waller via All-commits all-commits at lists.llvm.org
Mon Jan 29 03:07:15 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e2b6b53f5f63179b52168ee156df7c76b90bc71
      https://github.com/llvm/llvm-project/commit/2e2b6b53f5f63179b52168ee156df7c76b90bc71
  Author: Peter Waller <peter.waller at arm.com>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M compiler-rt/lib/builtins/aarch64/sme-libc-routines.c

  Log Message:
  -----------
  [AArch64][compiler-rt] Avoid use of libc header in sme-libc-routines (#79454)

The use of `#include <stdlib.h>` introduces a libc dependency. In many
build environments such a file can be found under e.g. /usr/include, but
this does not necessarily correspond to the libc in use, which may not
be available until after the builtins have been built.

So far as I understand, it's not valid to have a dependency on libc from
builtins; there are a handful of such includes in builtins, but they are
protected by ifdefs.

Instead, use <stddef.h>, which provides `size_t` and is provided by the
compiler's resource headers and so should always be available.




More information about the All-commits mailing list