aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEugene Zemtsov <ezemtsov@google.com>2017-09-01 23:12:43 +0000
committerEugene Zemtsov <ezemtsov@google.com>2017-09-01 23:12:43 +0000
commit52a37ca13c3006eaa78c37ef3cb347c10aec5d63 (patch)
tree23ece8d2b75b3e9eabbfe110e5154807299d9a28 /cmake
parent99106502b7a82f6ed4c923a6cbdbbf90fd2b0486 (diff)
downloadllvm-52a37ca13c3006eaa78c37ef3cb347c10aec5d63.tar.gz
Disable 64bit file position on old 32 bit Androids.
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. Differential Revision: https://reviews.llvm.org/D37314 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 86806140023..17a8aca06cd 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -233,8 +233,12 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
# If building on a GNU specific 32-bit system, make sure off_t is 64 bits
-# so that off_t can stored offset > 2GB
-if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+# so that off_t can stored offset > 2GB.
+# Android until version N (API 24) doesn't support it.
+if (ANDROID AND (ANDROID_NATIVE_API_LEVEL LESS 24))
+ set(LLVM_FORCE_SMALLFILE_FOR_ANDROID TRUE)
+endif()
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT LLVM_FORCE_SMALLFILE_FOR_ANDROID)
add_definitions( -D_LARGEFILE_SOURCE )
add_definitions( -D_FILE_OFFSET_BITS=64 )
endif()
@@ -303,13 +307,13 @@ if( MSVC )
# especially so std::equal(nullptr, nullptr, nullptr) will not assert.
add_definitions("-D_DEBUG_POINTER_IMPL=")
endif()
-
+
include(ChooseMSVCCRT)
if( MSVC11 )
add_definitions(-D_VARIADIC_MAX=10)
endif()
-
+
# Add definitions that make MSVC much less annoying.
add_definitions(
# For some reason MS wants to deprecate a bunch of standard functions...
@@ -370,7 +374,7 @@ if( MSVC )
string(FIND "${upper_exe_flags} ${upper_module_flags} ${upper_shared_flags}"
"/INCREMENTAL" linker_flag_idx)
-
+
if (${linker_flag_idx} GREATER -1)
message(WARNING "/Brepro not compatible with /INCREMENTAL linking - builds will be non-deterministic")
else()