Skip to content

[AArch64][compiler-rt] Avoid use of libc header in sme-libc-routines #79454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

peterwaller-arm
Copy link
Contributor

@peterwaller-arm peterwaller-arm commented Jan 25, 2024

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.

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 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 is provided by the compiler's resource
headers and so should always be available.
@dtemirbulatov
Copy link
Contributor

LGTM. Thanks.

@peterwaller-arm peterwaller-arm merged commit 2e2b6b5 into llvm:main Jan 29, 2024
@peterwaller-arm peterwaller-arm deleted the avoid-stdlib-from-builtins branch January 29, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants