This is needed for building LLVM on Android with new NDK (newer than r15c) and API level < 24. Android C library (Bionic) didn't have support for 64 bit file position until Android N.
Details
Diff Detail
Event Timeline
I would add in the commit description that this is Linux/Android specific. For the reference, 32bit systems like BSD ship with 64bit off_t always.
https://reviews.llvm.org/D35648 does something similar. If this is just for building compiler-rt runtimes, we can defer to that patch. This way we can just remove the exception for Android once the NDK defaults to something past API level 24, rather than support a build configuration for ever.
I need this for LLDB support on Android. It's going to be a long while till LLDB can default to API level 24.
Aah, ok. So https://reviews.llvm.org/D35648 doesn't cover your use case. Can we just say "AND (NOT ANDROID)" instead of a new CMake option?
Aah, ok. So https://reviews.llvm.org/D35648 doesn't cover your use case. Can we just say "AND (NOT ANDROID)" instead of a new CMake option?
Sure we can. I just wanted it to be a bit more flexible.
Pirama: shall I remove remove_definitions(-D_FILE_OFFSET_BITS=64) in https://reviews.llvm.org/D35648? Or we don't want FILE_OFFSET_BITS=64 for runtimes no matter what ANDROID_NATIVE_API_LEVEL is.
LGTM for Android, but I'll let other reviewers formally accept it, in case they have build-system centric comments.
We should remove the line you mention above once this change goes in.
Could somebody please take another look at this change? It would help us fix an internal build with the latest NDK.