nitesh.jain created this revision. Herald added subscribers: arichardson, mgorny.
Fix is to define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. This fix will cause llvm::sys::fs::file_size() to return correct object size. Repository: rL LLVM https://reviews.llvm.org/D32125 Files: CMakeLists.txt Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -458,6 +458,12 @@ option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF) endif() +# If building on a 32-bit system, make sure off_t can store offsets > 2GB +if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) + add_definitions( -D_LARGEFILE_SOURCE ) + add_definitions( -D_FILE_OFFSET_BITS=64 ) +endif() + # Define the default arguments to use with 'lit', and an option for the user to # override. set(LIT_ARGS_DEFAULT "-sv")
Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -458,6 +458,12 @@ option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF) endif() +# If building on a 32-bit system, make sure off_t can store offsets > 2GB +if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) + add_definitions( -D_LARGEFILE_SOURCE ) + add_definitions( -D_FILE_OFFSET_BITS=64 ) +endif() + # Define the default arguments to use with 'lit', and an option for the user to # override. set(LIT_ARGS_DEFAULT "-sv")
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits