[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 15:10:27 PDT 2017


eugene updated this revision to Diff 113324.
eugene added a comment.

Added comment


https://reviews.llvm.org/D37314

Files:
  cmake/modules/HandleLLVMOptions.cmake


Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -233,8 +233,10 @@
 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.
+# LLVM_FORCE_SMALLFILE allows to override it if 64 bit off_t is not supported
+# by the target system, like Android before version N (API 24).
+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 +305,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 +372,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.113324.patch
Type: text/x-patch
Size: 1514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170830/dc8dad77/attachment.bin>


More information about the llvm-commits mailing list