From 0032fae1797a28bf63a5d0d098a5cdd2b5ce24c0 Mon Sep 17 00:00:00 2001 From: Nitesh Jain Date: Mon, 24 Apr 2017 10:36:46 +0000 Subject: [PATCH] [LLVM][MIPS] Fix different definition of off_t in LLDB and LLVM. Reviewers: beanz Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste Differential Revision: https://reviews.llvm.org/D32125 llvm-svn: 301171 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 099d2eb..882d68e 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -222,6 +222,13 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) endif( LLVM_BUILD_32_BITS ) 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 ) + add_definitions( -D_LARGEFILE_SOURCE ) + add_definitions( -D_FILE_OFFSET_BITS=64 ) +endif() + if( XCODE ) # For Xcode enable several build settings that correspond to # many warnings that are on by default in Clang but are -- 2.7.4