Package: boost1.88
Version: 1.88.0-1
Severity: normal
X-Debbugs-CC: debian-h...@lists.debian.org
User: debian-h...@lists.debian.org
Usertags: hurd

I had a look at the build problem on Hurd reported on
<URL: https://buildd.debian.org/status/package.php?p=boost1.88 >, and
tracked down a fix.

The following patch got the package building.  I am quite unsure if the
disabling of SA_NOCLDWAIT have side effects affecting boost library
clients, while the other changes seem safe enough.

diff --git a/debian/patches/1000-hurd.patch b/debian/patches/1000-hurd.patch
new file mode 100644
index 00000000..8277502d
--- /dev/null
+++ b/debian/patches/1000-hurd.patch
@@ -0,0 +1,76 @@
+Description: Fixed build problems on GNU Hurd.
+ Disabled use of not implemented SA_NOCLDWAIT.
+ Corrected return value of fallback cmd() implementation.
+ Switched to Linux version of env() instead of trying to use MacOSX edition.
+Author: Petter Reinholdtsen <p...@debian.org>
+Forwarded: no
+Last-Update: 2025-05-01
+---
+Index: boost1.88-1.88.0/libs/asio/include/boost/asio/detail/socket_types.hpp
+===================================================================
+--- boost1.88-1.88.0.orig/libs/asio/include/boost/asio/detail/socket_types.hpp
++++ boost1.88-1.88.0/libs/asio/include/boost/asio/detail/socket_types.hpp
+@@ -414,7 +414,9 @@ const int max_iov_len = 16;
+ # endif
+ # define BOOST_ASIO_OS_DEF_SA_RESTART SA_RESTART
+ # define BOOST_ASIO_OS_DEF_SA_NOCLDSTOP SA_NOCLDSTOP
+-# define BOOST_ASIO_OS_DEF_SA_NOCLDWAIT SA_NOCLDWAIT
++# if defined(SA_NOCLDWAIT)
++#  define BOOST_ASIO_OS_DEF_SA_NOCLDWAIT SA_NOCLDWAIT
++# endif /* defined(SA_NOCLDWAIT) */
+ #endif
+ const int custom_socket_option_level = 0xA5100000;
+ const int enable_connection_aborted_option = 1;
+Index: boost1.88-1.88.0/libs/asio/include/boost/asio/signal_set_base.hpp
+===================================================================
+--- boost1.88-1.88.0.orig/libs/asio/include/boost/asio/signal_set_base.hpp
++++ boost1.88-1.88.0/libs/asio/include/boost/asio/signal_set_base.hpp
+@@ -65,7 +65,9 @@ public:
+     none = 0,
+     restart = BOOST_ASIO_OS_DEF(SA_RESTART),
+     no_child_stop = BOOST_ASIO_OS_DEF(SA_NOCLDSTOP),
++#if defined(SA_NOCLDWAIT)
+     no_child_wait = BOOST_ASIO_OS_DEF(SA_NOCLDWAIT),
++#endif /* defined(SA_NOCLDWAIT) */
+     dont_care = -1
+   };
+ 
+Index: boost1.88-1.88.0/libs/process/src/ext/cmd.cpp
+===================================================================
+--- boost1.88-1.88.0.orig/libs/process/src/ext/cmd.cpp
++++ boost1.88-1.88.0/libs/process/src/ext/cmd.cpp
+@@ -403,10 +403,10 @@ shell cmd(boost::process::v2::pid_type p
+ }
+ 
+ #else
+-filesystem::path cmd(boost::process::v2::pid_type, error_code & ec)
++shell cmd(boost::process::v2::pid_type, error_code & ec)
+ {
+   BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
+-  return "";
++  return {};
+ }
+ #endif
+ 
+Index: boost1.88-1.88.0/libs/process/src/ext/env.cpp
+===================================================================
+--- boost1.88-1.88.0.orig/libs/process/src/ext/env.cpp
++++ boost1.88-1.88.0/libs/process/src/ext/env.cpp
+@@ -246,7 +246,7 @@ env_view env(boost::process::v2::pid_typ
+       return {};
+ }
+ 
+-#elif (defined(__APPLE___) || defined(__MACH__)) && !TARGET_OS_IOS
++#elif (defined(__APPLE___) || defined(__MACH__)) && !TARGET_OS_IOS && 
!defined(__gnu_hurd__)
+ 
+ env_view env(boost::process::v2::pid_type pid, error_code & ec)
+ {
+@@ -309,7 +309,7 @@ env_view env(boost::process::v2::pid_typ
+     return ev;
+ }
+ 
+-#elif (defined(__linux__) || defined(__ANDROID__))
++#elif (defined(__linux__) || defined(__ANDROID__)) || defined(__gnu_hurd__)
+ 
+ env_view env(boost::process::v2::pid_type pid, error_code & ec)
+ {
diff --git a/debian/patches/series b/debian/patches/series
index 4f070ed4..53070e91 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ fix_extension.patch
 30.patch
 40.patch
 60.patch
+1000-hurd.patch
diff --git a/debian/rules b/debian/rules
index 88c0ab15..923055bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -150,7 +150,7 @@ JAM_OPT += pch=off
 endif
 
 # we dsable stacktrace from exceptions on some platforms due to possible 
memory leaks. See #1102107
-ifneq (,$(filter $(DEB_HOST_ARCH), i386 alpha hppa m68k sh4))
+ifneq (,$(filter $(DEB_HOST_ARCH), i386 alpha hppa m68k sh4 hurd-i386))
 JAM_OPT += boost.stacktrace.from_exception=off
 endif
 

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to