[PATCH] D116366: [Support] Add MemoryBuffer::dontNeedIfMmap
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 07:26:56 PST 2022
daltenty added a comment.
In D116366#3215212 <https://reviews.llvm.org/D116366#3215212>, @aganea wrote:
> @zibi @daltenty Is `madvise` not available on AIX, or is it a specific version of the OS that doesn't have it? The doc suggests it is available: https://www.ibm.com/docs/en/aix/7.1?topic=m-madvise-subroutine
> Is that specific machine missing a header? Perhaps `HAVE_SYS_MMAN_H` isn't defined? @simon_tatham
>
> Unless any of you have a way to quickly test a solution, short term should we just `#ifndef _AIX` the call to `madvise`?
> @zibi @daltenty Is madvise not available on AIX, or is it a specific version of the OS that doesn't have it? The doc suggests it is available: https://www.ibm.com/docs/en/aix/7.1?topic=m-madvise-subroutine
Sorry you're right, the header on AIX does normally have it available under the default _ALL_SOURCE feature test macro. Unfortunately the CMake sets _XOPEN_SOURCE=700 (i.e. XOPEN/POSIX compat) when building LLVM on AIX because of other conflicting symbols when we use _ALL_SOURCE.
I think we should still prefer the `posix_madvise` solution here for AIX, since it's more portable in general. For z/OS we can introduce a guard as proposed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116366/new/
https://reviews.llvm.org/D116366
More information about the llvm-commits
mailing list