Hi Greg and all,

>From the lldm-dev thread below, I assume it is okay to ask you to review
the attached and commit on my behalf.

My main interest is really to get a more up-to-date llvmpipe mesa gallium driver
for my new graphics hardware. To keep the 32-bit mesa packages
in-sync with the 64-bit ones, I needed 32-bit llvm (and a more up-to-date one
than shipped by fedora 20) too; I don't really use 32-bit llvm directly to any 
extent.
That said, the rpm packaging system does
(after ./configure ... --disable-expensive-checks ...), as far as I see,
 make -k check ...
 make -C tools/clang/test ...
and abort on failures, so there is some assurance the compilation is correct.

The changes were made against llvm 3.4.x; part of it is already in trunk,
so I am preparing two patches (with the smaller trunk one not tested); both are 
fairly
self-evident anyhow.

Note that to finish the rpm packaging, there is an additional dependency: 
(https://bugzilla.redhat.com/show_bug.cgi?id=1144863)
That's just FYI, not really relevant to llvm development.

This is the trunk patch; the llvm 3.4.x patch to follow.

Hin-Tak

----
This is the set of changes I need to make to build 32-bit llvm on
fedora 20 x86_64 (to get 32-bit mesa llvmpipe Gallium drm driver), against
llvm 3.4.2.

Similar problems were apparently seen with Ubuntu 11.04 32bit and
Ubuntu 12.04 32-bit in the thread leading up to this post:

http://lists.cs.uiuc.edu/pipermail/lldb-dev/2013-February/001470.html

and was worked around, but didn't get addressed.

Part of the changes I need is already part of:

commit 6201a1a109e4c43ece8dbcc81571f1d095bca6d3
Author: Zachary Turner <[email protected]>
Date:   Wed Jul 2 17:24:07 2014 +0000

    Start converting usages of off_t to other types.

So I am preparing two patches, one for trunk and one for 3.4.x.

This is the for-trunk patch.
From 9e21310abb653760e0c27a0e82d15063e3858d1e Mon Sep 17 00:00:00 2001
From: Hin-Tak Leung <[email protected]>
Date: Sun, 21 Sep 2014 17:34:08 +0100
Subject: [PATCH] More conversions of off_t to lldb::offset_t for llvm trunk

This is the set of changes I need to make to build 32-bit llvm on
fedora 20 x86_64 (to get 32-bit mesa llvmpipe Gallium drm driver), against
llvm 3.4.2.

Similar problems were apparently seen with Ubuntu 11.04 32bit and
Ubuntu 12.04 32-bit in the thread leading up to this post:

http://lists.cs.uiuc.edu/pipermail/lldb-dev/2013-February/001470.html

and was worked around, but didn't get addressed.

Part of the changes I need is already part of:

commit 6201a1a109e4c43ece8dbcc81571f1d095bca6d3
Author: Zachary Turner <[email protected]>
Date:   Wed Jul 2 17:24:07 2014 +0000

    Start converting usages of off_t to other types.

So I am preparing two patches, one for trunk and one for 3.4.x.

This is the for-trunk patch.

Signed-off-by: Hin-Tak Leung <[email protected]>
Cc: Greg Clayton <[email protected]>
---
 include/lldb/Host/File.h        | 8 ++++----
 include/lldb/Host/FileSpec.h    | 4 ++--
 source/Host/common/File.cpp     | 8 ++++----
 source/Host/common/FileSpec.cpp | 8 ++++----
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 2738679..85a7c7a 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -299,8 +299,8 @@ public:
     /// @return
     ///     The resulting seek offset, or -1 on error.
     //------------------------------------------------------------------
-    off_t
-    SeekFromStart (off_t offset, Error *error_ptr = NULL);
+    lldb::offset_t
+    SeekFromStart (lldb::offset_t offset, Error *error_ptr = NULL);
     
     //------------------------------------------------------------------
     /// Seek to an offset relative to the current file position.
@@ -373,7 +373,7 @@ public:
     ///     failure.
     //------------------------------------------------------------------
     Error
-    Read (void *dst, size_t &num_bytes, off_t &offset);
+    Read (void *dst, size_t &num_bytes, lldb::offset_t &offset);
     
     //------------------------------------------------------------------
     /// Read bytes from a file from the specified file offset.
@@ -406,7 +406,7 @@ public:
     //------------------------------------------------------------------
     Error
     Read (size_t &num_bytes,
-          off_t &offset,
+          lldb::offset_t &offset,
           bool null_terminate,
           lldb::DataBufferSP &data_buffer_sp);
 
diff --git a/include/lldb/Host/FileSpec.h b/include/lldb/Host/FileSpec.h
index ef73bb2..19225b4 100644
--- a/include/lldb/Host/FileSpec.h
+++ b/include/lldb/Host/FileSpec.h
@@ -558,10 +558,10 @@ public:
     ///     pointer must be checked prior to using it.
     //------------------------------------------------------------------
     lldb::DataBufferSP
-    ReadFileContents (off_t offset = 0, size_t length = SIZE_MAX, Error *error_ptr = NULL) const;
+    ReadFileContents (lldb::offset_t offset = 0, size_t length = SIZE_MAX, Error *error_ptr = NULL) const;
 
     size_t
-    ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const;
+    ReadFileContents (lldb::offset_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const;
 
     
     //------------------------------------------------------------------
diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp
index 50513af..f11cbd8 100644
--- a/source/Host/common/File.cpp
+++ b/source/Host/common/File.cpp
@@ -437,8 +437,8 @@ File::GetFileSpec (FileSpec &file_spec) const
     return error;
 }
 
-off_t
-File::SeekFromStart (off_t offset, Error *error_ptr)
+lldb::offset_t
+File::SeekFromStart (lldb::offset_t offset, Error *error_ptr)
 {
     off_t result = 0;
     if (DescriptorIsValid())
@@ -683,7 +683,7 @@ File::Write (const void *buf, size_t &num_bytes)
 
 
 Error
-File::Read (void *buf, size_t &num_bytes, off_t &offset)
+File::Read (void *buf, size_t &num_bytes, lldb::offset_t &offset)
 {
 #ifndef _WIN32
     Error error;
@@ -724,7 +724,7 @@ File::Read (void *buf, size_t &num_bytes, off_t &offset)
 }
 
 Error
-File::Read (size_t &num_bytes, off_t &offset, bool null_terminate, DataBufferSP &data_buffer_sp)
+File::Read (size_t &num_bytes, lldb::offset_t &offset, bool null_terminate, DataBufferSP &data_buffer_sp)
 {
     Error error;
     
diff --git a/source/Host/common/FileSpec.cpp b/source/Host/common/FileSpec.cpp
index 7c5a5cc..ddb5dda 100644
--- a/source/Host/common/FileSpec.cpp
+++ b/source/Host/common/FileSpec.cpp
@@ -738,7 +738,7 @@ FileSpec::MemorySize() const
 
 
 size_t
-FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const
+FileSpec::ReadFileContents (lldb::offset_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const
 {
     Error error;
     size_t bytes_read = 0;
@@ -749,7 +749,7 @@ FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error
         error = file.Open(resolved_path, File::eOpenOptionRead);
         if (error.Success())
         {
-            off_t file_offset_after_seek = file_offset;
+            lldb::offset_t file_offset_after_seek = file_offset;
             bytes_read = dst_len;
             error = file.Read(dst, bytes_read, file_offset_after_seek);
         }
@@ -775,7 +775,7 @@ FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error
 // verified using the DataBuffer::GetByteSize() function.
 //------------------------------------------------------------------
 DataBufferSP
-FileSpec::ReadFileContents (off_t file_offset, size_t file_size, Error *error_ptr) const
+FileSpec::ReadFileContents (lldb::offset_t file_offset, size_t file_size, Error *error_ptr) const
 {
     Error error;
     DataBufferSP data_sp;
@@ -811,7 +811,7 @@ FileSpec::ReadFileContentsAsCString(Error *error_ptr)
         error = file.Open(resolved_path, File::eOpenOptionRead);
         if (error.Success())
         {
-            off_t offset = 0;
+            lldb::offset_t offset = 0;
             size_t length = SIZE_MAX;
             const bool null_terminate = true;
             error = file.Read (length, offset, null_terminate, data_sp);
-- 
1.9.3

_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to