git: 472c967ee011 - main - net-p2p/rtorrent: Really unbreak i386
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 08 Jul 2026 09:58:05 UTC
The branch main has been updated by eduardo:
URL: https://cgit.FreeBSD.org/ports/commit/?id=472c967ee01166890c2d0b2792fb757c00f0863a
commit 472c967ee01166890c2d0b2792fb757c00f0863a
Author: Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2026-07-08 09:53:12 +0000
Commit: Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2026-07-08 09:53:12 +0000
net-p2p/rtorrent: Really unbreak i386
Apply upstream patch that fixes command_base t_pod align static asserts
that caused i386 build to fail.
Fixes: 917ab14124a2 ("net-p2p/rtorrent: Unbreak i386")
---
net-p2p/rtorrent/Makefile | 2 -
net-p2p/rtorrent/files/patch-Fix-i386 | 76 +++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/net-p2p/rtorrent/Makefile b/net-p2p/rtorrent/Makefile
index ccd3fb17f69e..7f7b357d03b4 100644
--- a/net-p2p/rtorrent/Makefile
+++ b/net-p2p/rtorrent/Makefile
@@ -11,8 +11,6 @@ LICENSE= GPLv2 GPLv3
LICENSE_COMB= dual
LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING
-BROKEN_i386= error: static assertion failed; see also: https://github.com/rakshasa/rtorrent/issues/1859
-
LIB_DEPENDS= libtorrent.so:net-p2p/libtorrent
TEST_DEPENDS= cppunit>0:devel/cppunit
diff --git a/net-p2p/rtorrent/files/patch-Fix-i386 b/net-p2p/rtorrent/files/patch-Fix-i386
new file mode 100644
index 000000000000..b230f2c24582
--- /dev/null
+++ b/net-p2p/rtorrent/files/patch-Fix-i386
@@ -0,0 +1,76 @@
+From 959448acdab8e84cc70f5a50c62dab73dd8dc07d Mon Sep 17 00:00:00 2001
+From: Jari Sundell <sundell.software@gmail.com>
+Date: Wed, 8 Jul 2026 10:15:56 +0200
+Subject: [PATCH] Fixed command_base t_pod align static asserts.
+
+---
+ src/rpc/command.h | 31 +++++++++++++++----------------
+ 1 file changed, 15 insertions(+), 16 deletions(-)
+
+diff --git src/rpc/command.h src/rpc/command.h
+index a4aa6acb4..4c9a652e1 100644
+--- src/rpc/command.h
++++ src/rpc/command.h
+@@ -55,12 +55,11 @@ struct rt_triple : private std::pair<T1, T2> {
+ base_type(src.first, src.second), third(src.third) {}
+ };
+
+-typedef rt_triple<int, void*, void*> target_type;
+-
+ class command_base;
+
+-typedef const torrent::Object (*command_base_call_type)(command_base*, target_type, const torrent::Object&);
+-typedef std::function<torrent::Object (target_type, const torrent::Object&)> base_function;
++using target_type = rt_triple<int, void*, void*>;
++using base_function = std::function<torrent::Object (target_type, const torrent::Object&)>;
++using command_base_call_type = const torrent::Object (command_base*, target_type, const torrent::Object&);
+
+ template <typename tmpl> struct command_base_is_valid {};
+ template <command_base_call_type tmpl_func> struct command_base_is_type {};
+@@ -84,17 +83,18 @@ class command_base {
+
+ typedef const torrent::Object (*download_pair_slot) (command_base*, core::Download*, core::Download*, const torrent::Object&);
+
+- static const int target_generic = 0;
+- static const int target_any = 1;
+- static const int target_download = 2;
+- static const int target_peer = 3;
+- static const int target_tracker = 4;
+- static const int target_file = 5;
+- static const int target_file_itr = 6;
++ static constexpr int target_generic = 0;
++ static constexpr int target_any = 1;
++ static constexpr int target_download = 2;
++ static constexpr int target_peer = 3;
++ static constexpr int target_tracker = 4;
++ static constexpr int target_file = 5;
++ static constexpr int target_file_itr = 6;
++ static constexpr int target_download_pair = 7;
+
+- static const int target_download_pair = 7;
++ static constexpr unsigned int max_arguments = 10;
+
+- static const unsigned int max_arguments = 10;
++ static constexpr std::size_t optimal_alignment = std::max(alignof(std::max_align_t), alignof(base_function));
+
+ struct stack_type {
+ torrent::Object* begin() { return reinterpret_cast<torrent::Object*>(buffer); }
+@@ -169,8 +169,7 @@ class command_base {
+ template <typename T>
+ void set_function(T s, [[maybe_unused]] int value = command_base_is_valid<T>::value) {
+ static_assert(sizeof(T) <= sizeof(t_pod), "t_pod storage overflow");
+- static_assert(alignof(std::max_align_t) % alignof(T) == 0, "t_pod alignment insufficient for type");
+- static_assert(alignof(std::max_align_t) >= alignof(T), "t_pod structural capacity mismatch");
++ static_assert(optimal_alignment >= alignof(T), "t_pod alignment insufficient for type");
+
+ if (m_dest_helper)
+ m_dest_helper(t_pod);
+@@ -200,7 +199,7 @@ class command_base {
+ using copy_fn_t = void (*)(void* dest, const void* src);
+ using dest_fn_t = void (*)(void* ptr);
+
+- alignas(std::max_align_t) char t_pod[sizeof(base_function)];
++ alignas(optimal_alignment) char t_pod[sizeof(base_function)];
+
+ copy_fn_t m_copy_helper;
+ dest_fn_t m_dest_helper;