Skip to content

Commit 2e2b6b5

Browse files
[AArch64][compiler-rt] Avoid use of libc header in sme-libc-routines (llvm#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.
1 parent ef83894 commit 2e2b6b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/builtins/aarch64/sme-libc-routines.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <stdlib.h>
1+
#include <stddef.h>
22

33
// WARNING: When building the scalar versions of these functions you need to
44
// use the compiler flag "-mllvm -disable-loop-idiom-all" to prevent clang

0 commit comments

Comments
 (0)