[Lldb-commits] [lldb] r176595 - Fix Linux i386 build

Daniel Malea daniel.malea at intel.com
Wed Mar 6 16:48:53 PST 2013


Author: dmalea
Date: Wed Mar  6 18:48:53 2013
New Revision: 176595

URL: http://llvm.org/viewvc/llvm-project?rev=176595&view=rev
Log:
Fix Linux i386 build
- missing definitions were causing different definitions of type 'off_t', resulting in linker errors
- fix is to define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64


Modified:
    lldb/trunk/CMakeLists.txt
    lldb/trunk/Makefile

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=176595&r1=176594&r2=176595&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Wed Mar  6 18:48:53 2013
@@ -94,6 +94,14 @@ if( MSVC )
   )
 endif() 
 
+# If building on a 32-bit system, make sure off_t can store offsets > 2GB
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+  add_lldb_definitions(
+    -D_LARGEFILE_SOURCE
+    -D_FILE_OFFSET_BITS=64
+    )
+endif()
+
 set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
 

Modified: lldb/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/Makefile?rev=176595&r1=176594&r2=176595&view=diff
==============================================================================
--- lldb/trunk/Makefile (original)
+++ lldb/trunk/Makefile Wed Mar  6 18:48:53 2013
@@ -48,6 +48,11 @@ ifdef LLDB_VENDOR
 CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
 endif
 
+# If building on a 32-bit system, make sure off_t can store offsets > 2GB
+ifneq "$(HOST_ARCH)" "x86_64"
+CPP.Flags += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+endif
+
 # Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
 # work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
 # GCC's have false positive warnings with it on Linux (which prove a pain to





More information about the lldb-commits mailing list