From 31795b9bf82e7b51f2f836e48bb143f57d87c33e Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Thu, 9 Oct 2025 10:10:40 -0400 Subject: [PATCH] Add Boost.JSON patch for detecting endianness (RHEL-116553) Resolves: RHEL-116553 --- boost-1.75.0-json-endian.patch | 41 ++++++++++++++++++++++++++++++++++ boost.spec | 10 ++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 boost-1.75.0-json-endian.patch diff --git a/boost-1.75.0-json-endian.patch b/boost-1.75.0-json-endian.patch new file mode 100644 index 0000000..e0c9cca --- /dev/null +++ b/boost-1.75.0-json-endian.patch @@ -0,0 +1,41 @@ +From 8ad666f05367c185598816a3153e05a976ffe920 Mon Sep 17 00:00:00 2001 +From: Dmitry Arkhipov +Date: Thu, 9 Jun 2022 18:59:42 +0300 +Subject: [PATCH] deduce endianness of the platform + +--- + boost/json/detail/config.hpp | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/include/boost/json/detail/config.hpp b/include/boost/json/detail/config.hpp +index 398f789..62a65d1 100644 +--- a/boost/json/detail/config.hpp ++++ b/boost/json/detail/config.hpp +@@ -250,6 +250,24 @@ + # endif + #endif + ++ ++#if ! defined(BOOST_JSON_BIG_ENDIAN) && ! defined(BOOST_JSON_LITTLE_ENDIAN) ++// Copied from Boost.Endian ++# if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ++# define BOOST_JSON_LITTLE_ENDIAN ++# elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++# define BOOST_JSON_BIG_ENDIAN ++# elif defined(__LITTLE_ENDIAN__) ++# define BOOST_JSON_LITTLE_ENDIAN ++# elif defined(__BIG_ENDIAN__) ++# define BOOST_JSON_BIG_ENDIAN ++# elif defined(_MSC_VER) || defined(__i386__) || defined(__x86_64__) ++# define BOOST_JSON_LITTLE_ENDIAN ++# else ++# error The Boost.JSON library could not determine the endianness of this platform. Define either BOOST_JSON_BIG_ENDIAN or BOOST_JSON_LITTLE_ENDIAN. ++# endif ++#endif ++ + BOOST_JSON_NS_BEGIN + namespace detail { + +-- +2.51.0.463.g79cf913ea9 + diff --git a/boost.spec b/boost.spec index 3f4d2d0..571d431 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.75.0 -Release: 12%{?dist} +Release: 13%{?dist} License: Boost and MIT and Python # Replace each . with _ in %%{version} @@ -165,6 +165,10 @@ Patch98: boost-1.75-asio-fix.patch # https://github.com/boostorg/filesystem/issues/254 Patch99: boost-1.75.0-copy_file-exdev.patch +# https://issues.redhat.com/browse/RHEL-116553 +# https://github.com/boostorg/json/issues/717 +Patch100: boost-1.75.0-json-endian.patch + %bcond_with tests %bcond_with docs_generated @@ -691,6 +695,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch -P95 -p1 %patch -P98 -p1 %patch -P99 -p1 +%patch -P100 -p1 %build %set_build_flags @@ -1296,6 +1301,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Thu Oct 9 2025 Patrick Palka - 1.75.0-13 +- Add Boost.JSON patch for detecting endianness (RHEL-116553) + * Tue Jul 8 2025 Patrick Palka - 1.75.0-12 - Fix the CMake config file for openmpi and mpich (RHEL-97588)