From 9eaf760933410d1eb9fdd750275be9952bdce9aa Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 2 Feb 2022 18:36:49 -0800 Subject: [PATCH] Add patch to fix narrowing conversions on ppc64le https://github.com/boostorg/interval/issues/29 --- ....0-fix-narrowing-conversions-for-ppc.patch | 32 +++++++++++++++++++ boost.spec | 12 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 boost-1.76.0-fix-narrowing-conversions-for-ppc.patch diff --git a/boost-1.76.0-fix-narrowing-conversions-for-ppc.patch b/boost-1.76.0-fix-narrowing-conversions-for-ppc.patch new file mode 100644 index 0000000..42662dd --- /dev/null +++ b/boost-1.76.0-fix-narrowing-conversions-for-ppc.patch @@ -0,0 +1,32 @@ +From 0039878782516ea3313608f99f0d50e846151bc2 Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Mon, 31 Jan 2022 11:37:29 +0000 +Subject: [PATCH] Fix narrowing conversions for ppc + +These constants are too large for `long long` so are unsigned, +and then cannot be narrowed to the signed type. + +Fixes #29 +--- + .../numeric/interval/detail/ppc_rounding_control.hpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/boost/numeric/interval/detail/ppc_rounding_control.hpp b/include/boost/numeric/interval/detail/ppc_rounding_control.hpp +index 87fe8ee..99f9986 100644 +--- a/include/boost/numeric/interval/detail/ppc_rounding_control.hpp ++++ b/include/boost/numeric/interval/detail/ppc_rounding_control.hpp +@@ -28,10 +28,10 @@ typedef union { + double dmode; + } rounding_mode_struct; + +-static const rounding_mode_struct mode_upward = { 0xFFF8000000000002LL }; +-static const rounding_mode_struct mode_downward = { 0xFFF8000000000003LL }; +-static const rounding_mode_struct mode_to_nearest = { 0xFFF8000000000000LL }; +-static const rounding_mode_struct mode_toward_zero = { 0xFFF8000000000001LL }; ++static const rounding_mode_struct mode_upward = { (::boost::long_long_type)0xFFF8000000000002LL }; ++static const rounding_mode_struct mode_downward = { (::boost::long_long_type)0xFFF8000000000003LL }; ++static const rounding_mode_struct mode_to_nearest = { (::boost::long_long_type)0xFFF8000000000000LL }; ++static const rounding_mode_struct mode_toward_zero = { (::boost::long_long_type)0xFFF8000000000001LL }; + + struct ppc_rounding_control + { diff --git a/boost.spec b/boost.spec index 400890e..18744b5 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.76.0 -Release: 8%{?dist} +Release: 9%{?dist} License: Boost and MIT and Python # Replace each . with _ in %%{version} @@ -165,6 +165,11 @@ Patch102: boost-1.76.0-random-test.patch # fixes ppc64le issue https://github.com/boostorg/multiprecision/issues/419 Patch103: boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch +# PR https://github.com/boostorg/interval/pull/30 +# Fixes narrowing conversions for ppc - +# https://github.com/boostorg/interval/issues/29 +Patch104: boost-1.76.0-fix-narrowing-conversions-for-ppc.patch + %bcond_with tests %bcond_with docs_generated @@ -690,6 +695,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch101 -p1 %patch102 -p1 %patch103 -p2 +%patch104 -p2 %build %set_build_flags @@ -1291,6 +1297,10 @@ fi %{_mandir}/man1/b2.1* %changelog +* Wed Feb 2 2022 Thomas Rodgers - 1.76.0-9 +- Add patch to fix narrowing conversions on ppc64le + https://github.com/boostorg/interval/issues/29 + * Tue Feb 1 2022 Laurent Rineau - 1.76.0-8 - Add patch to fix Boost Multiprecision on ppc64le https://github.com/boostorg/multiprecision/issues/419