[PATCH] D37314: CMake option to compile LLVM on 32bit systems with 32bit fpos_t
Eugene Zemtsov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 14:55:31 PDT 2017
eugene created this revision.
Herald added a subscriber: mgorny.
LLVM_FORCE_SMALLFILE is a new CMake option that allows use of 32 bit file position on 32 bit systems.
This option 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.
Repository:
rL LLVM
https://reviews.llvm.org/D37314
Files:
cmake/modules/HandleLLVMOptions.cmake
Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -234,7 +234,7 @@
# 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 )
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 AND (NOT LLVM_FORCE_SMALLFILE) )
add_definitions( -D_LARGEFILE_SOURCE )
add_definitions( -D_FILE_OFFSET_BITS=64 )
endif()
@@ -303,13 +303,13 @@
# 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 +370,7 @@
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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37314.113320.patch
Type: text/x-patch
Size: 1275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170830/8e61a2aa/attachment.bin>
More information about the llvm-commits
mailing list