[packages/ceph] - build fixes for x32

baggins baggins at pld-linux.org
Sun Dec 22 12:26:30 CET 2024


commit 886a4d9a35e72fbd5978e0917768d9f4c986a19b
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Dec 22 12:28:06 2024 +0100

    - build fixes for x32

 ceph.spec   |   2 +
 types.patch |  11 ++++++
 x32.patch   | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+)
---
diff --git a/ceph.spec b/ceph.spec
index 27f2775..0689fa8 100644
--- a/ceph.spec
+++ b/ceph.spec
@@ -78,6 +78,7 @@ Patch11:	%{name}-system-xsimd.patch
 Patch12:	%{name}-gcc14.patch
 Patch13:	boost-1.86.patch
 Patch14:	boost-1.87.patch
+Patch15:	x32.patch
 URL:		https://ceph.io/
 %{?with_qatzip:BuildRequires:	QATzip-devel}
 %{?with_babeltrace:BuildRequires:	babeltrace-devel}
@@ -353,6 +354,7 @@ uruchamiania demonów.
 %patch -P 12 -p1
 %patch -P 13 -p1
 %patch -P 14 -p1
+%patch -P 15 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' \
 	src/{ceph-post-file.in,rbd-replay-many,rbdmap} \
diff --git a/types.patch b/types.patch
index 17eb6d6..8317be5 100644
--- a/types.patch
+++ b/types.patch
@@ -20,6 +20,17 @@
    };
    if (alloc[dev]) {
      alloc[dev]->foreach(iterated_allocation);
+--- ceph-16.2.7/src/tools/neorados.cc~	2021-12-07 17:15:49.000000000 +0100
++++ ceph-16.2.7/src/tools/neorados.cc	2022-02-12 22:23:25.836643956 +0100
+@@ -205,7 +205,7 @@
+ 
+   std::size_t off = 0;
+   ceph::buffer::list bl;
+-  while (auto toread = std::max(len - off, io_size)) {
++  while (auto toread = std::max(len - off, (uint64_t)io_size)) {
+     R::ReadOp op;
+     op.read(off, toread, &bl);
+     r.execute(obj, pool, std::move(op), nullptr, y[ec]);
 --- ceph-16.2.7/src/tools/cephfs_mirror/FSMirror.cc.orig	2021-12-07 17:15:49.000000000 +0100
 +++ ceph-16.2.7/src/tools/cephfs_mirror/FSMirror.cc	2022-02-12 22:30:46.487298972 +0100
 @@ -345,7 +345,7 @@
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..adac83c
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,124 @@
+--- ceph-19.2.0/src/cls/queue/cls_queue_src.cc~	2024-09-18 18:27:51.000000000 +0200
++++ ceph-19.2.0/src/cls/queue/cls_queue_src.cc	2024-12-22 12:12:49.383330632 +0100
+@@ -17,6 +17,12 @@
+ const uint64_t page_size = 4096;
+ const uint64_t large_chunk_size = 1ul << 22;
+ 
++#if defined(__x86_64__) && defined(__ILP32__)
++#define LONG_FORMAT "%llu"
++#else
++#define LONG_FORMAT "%lu"
++#endif
++
+ int queue_write_head(cls_method_context_t hctx, cls_queue_head& head)
+ {
+   bufferlist bl;
+@@ -129,10 +135,10 @@
+   head.tail.gen = head.front.gen = 0;
+   head.tail.offset = head.front.offset = head.max_head_size;
+   
+-  CLS_LOG(20, "INFO: init_queue_op queue actual size %lu", head.queue_size);
+-  CLS_LOG(20, "INFO: init_queue_op head size %lu", head.max_head_size);
++  CLS_LOG(20, "INFO: init_queue_op queue actual size "LONG_FORMAT"", head.queue_size);
++  CLS_LOG(20, "INFO: init_queue_op head size "LONG_FORMAT"", head.max_head_size);
+   CLS_LOG(20, "INFO: init_queue_op queue front offset %s", head.front.to_str().c_str());
+-  CLS_LOG(20, "INFO: init_queue_op queue max urgent data size %lu", head.max_urgent_data_size);
++  CLS_LOG(20, "INFO: init_queue_op queue max urgent data size "LONG_FORMAT"", head.max_urgent_data_size);
+ 
+   return queue_write_head(hctx, head);
+ }
+@@ -148,7 +154,7 @@
+ 
+   op_ret.queue_capacity = head.queue_size - head.max_head_size;
+ 
+-  CLS_LOG(20, "INFO: queue_get_capacity: size of queue is %lu", op_ret.queue_capacity);
++  CLS_LOG(20, "INFO: queue_get_capacity: size of queue is "LONG_FORMAT"", op_ret.queue_capacity);
+ 
+   return 0;
+ }
+@@ -194,7 +200,7 @@
+     encode(data_size, bl);
+     bl.claim_append(bl_data);
+   
+-    CLS_LOG(10, "INFO: queue_enqueue(): Total size to be written is %u and data size is %lu", bl.length(), data_size);
++    CLS_LOG(10, "INFO: queue_enqueue(): Total size to be written is %u and data size is "LONG_FORMAT"", bl.length(), data_size);
+ 
+     if (head.tail.offset >= head.front.offset) {
+       // check if data can fit in the remaining space in queue
+@@ -308,12 +314,12 @@
+   string last_marker;
+   do
+   {
+-    CLS_LOG(10, "INFO: queue_list_entries(): start_offset is %lu", start_offset);
++    CLS_LOG(10, "INFO: queue_list_entries(): start_offset is "LONG_FORMAT"", start_offset);
+   
+     bufferlist bl_chunk;
+     //Read chunk size at a time, if it is less than contiguous data size, else read contiguous data size
+     size_to_read = std::min(contiguous_data_size, large_chunk_size);
+-    CLS_LOG(10, "INFO: queue_list_entries(): size_to_read is %lu", size_to_read);
++    CLS_LOG(10, "INFO: queue_list_entries(): size_to_read is "LONG_FORMAT"", size_to_read);
+     if (size_to_read == 0) {
+       next_marker = head.tail;
+       op_ret.is_truncated = false;
+@@ -328,7 +334,7 @@
+ 
+     //If there is leftover data from previous iteration, append new data to leftover data
+     uint64_t entry_start_offset = start_offset - bl.length();
+-    CLS_LOG(20, "INFO: queue_list_entries(): Entry start offset accounting for leftover data is %lu", entry_start_offset);
++    CLS_LOG(20, "INFO: queue_list_entries(): Entry start offset accounting for leftover data is "LONG_FORMAT"", entry_start_offset);
+     bl.claim_append(bl_chunk);
+     bl_chunk = std::move(bl);
+ 
+@@ -339,7 +345,7 @@
+     auto it = bl_chunk.cbegin();
+     uint64_t size_to_process = bl_chunk.length();
+     do {
+-      CLS_LOG(10, "INFO: queue_list_entries(): index: %u, size_to_process: %lu", index, size_to_process);
++      CLS_LOG(10, "INFO: queue_list_entries(): index: %u, size_to_process: "LONG_FORMAT"", index, size_to_process);
+       cls_queue_entry entry;
+       ceph_assert(it.get_off() == index);
+       //Use the last marker saved in previous iteration as the marker for this entry
+@@ -383,7 +389,7 @@
+           CLS_LOG(10, "INFO: queue_list_entries: not enough data to read entry start and data size, breaking out!");
+           break;
+         }
+-        CLS_LOG(20, "INFO: queue_list_entries(): data size: %lu", data_size);
++        CLS_LOG(20, "INFO: queue_list_entries(): data size: "LONG_FORMAT"", data_size);
+         index += sizeof(uint64_t);
+         size_to_process -= sizeof(uint64_t);
+       }
+@@ -418,7 +424,7 @@
+       }
+     } while(index < bl_chunk.length());
+ 
+-    CLS_LOG(10, "INFO: num_ops: %lu and op.max is %lu, last_marker: %s and op.end_marker is %s\n",
++    CLS_LOG(10, "INFO: num_ops: "LONG_FORMAT" and op.max is "LONG_FORMAT", last_marker: %s and op.end_marker is %s\n",
+             num_ops, op.max, last_marker.c_str(), op.end_marker.c_str());
+ 
+     if (num_ops == op.max || (!op.end_marker.empty() && op.end_marker == last_marker)) {
+@@ -428,7 +434,7 @@
+         next_marker = cls_queue_marker{(entry_start_offset + index), gen};
+       }
+       CLS_LOG(10, "INFO: queue_list_entries(): either num_ops is same as op.max or last_marker is same as op.end_marker, "
+-                  "hence breaking out from outer loop with next offset: %lu", next_marker.offset);
++                  "hence breaking out from outer loop with next offset: "LONG_FORMAT"", next_marker.offset);
+       break;
+     }
+ 
+@@ -504,14 +510,14 @@
+       auto ret = cls_cxx_write_zero(hctx, head.max_head_size, len);
+       if (ret < 0) {
+         CLS_LOG(5, "INFO: queue_remove_entries: Failed to zero out entries");
+-        CLS_LOG(10, "INFO: queue_remove_entries: Start offset = %lu", head.max_head_size);
++        CLS_LOG(10, "INFO: queue_remove_entries: Start offset = "LONG_FORMAT"", head.max_head_size);
+         return ret;
+       }
+     }
+   } else if ((head.front.offset == end_marker.offset) && (head.front.gen == end_marker.gen)) {
+     //no-op
+   } else {
+-    CLS_LOG(0, "INFO: queue_remove_entries: Invalid end marker: offset = %s, gen = %lu", end_marker.to_str().c_str(), end_marker.gen);
++    CLS_LOG(0, "INFO: queue_remove_entries: Invalid end marker: offset = %s, gen = "LONG_FORMAT"", end_marker.to_str().c_str(), end_marker.gen);
+     return -EINVAL;
+   }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ceph.git/commitdiff/886a4d9a35e72fbd5978e0917768d9f4c986a19b



More information about the pld-cvs-commit mailing list