All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC] package/boost: fix powerpc uClibc build issue
@ 2015-05-15 17:00 Romain Naour
  2015-05-15 18:42 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2015-05-15 17:00 UTC (permalink / raw)
  To: buildroot

With powerpc target and uClibc toolchain the spirit library doesn't
build properly due to an invalid field access.

The "bits" field is intended only for internal use in
include/boost/math/special_functions/sign.hpp not from
include/boost/spirit/home/support/detail/sign.hpp.

Simply call (boost::math::changesign)(x) from
include/boost/spirit/home/support/detail/sign.hpp to fixes this.

Fixes:
http://autobuild.buildroot.net/results/be1/be1069e8528d299f487f431f7e2d793413ccbab8/

And many more.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
It's not clear why this issue is only trigged by powerpc
with uClibc toolchain.
Also, it's a pity that the spirit library doesn't use directly
math library instead of using a wrapper.
---
 .../boost/0002-spirit-fix-changesign-wrapper.patch | 69 ++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 package/boost/0002-spirit-fix-changesign-wrapper.patch

diff --git a/package/boost/0002-spirit-fix-changesign-wrapper.patch b/package/boost/0002-spirit-fix-changesign-wrapper.patch
new file mode 100644
index 0000000..f238549
--- /dev/null
+++ b/package/boost/0002-spirit-fix-changesign-wrapper.patch
@@ -0,0 +1,69 @@
+From 7d367aa89713995ccf5d8d3f03e27137bc254dc1 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Fri, 15 May 2015 18:46:04 +0200
+Subject: [PATCH] spirit: fix changesign wrapper
+
+With powerpc target and uClibc toolchain the spirit library doesn't
+build properly due to an invalid field access.
+
+The "bits" field is intended only for internal use in
+include/boost/math/special_functions/sign.hpp not from
+include/boost/spirit/home/support/detail/sign.hpp.
+
+This lead to the following build failure:
+
+In file included from ./boost/spirit/home/qi/numeric/detail/real_impl.hpp:22:0,
+                 from ./boost/spirit/home/qi/numeric/real.hpp:21,
+                 from ./boost/spirit/home/qi/numeric.hpp:17,
+                 from ./boost/spirit/include/qi_core.hpp:23,
+                 from libs/log/src/default_filter_factory.cpp:21:
+./boost/spirit/home/support/detail/sign.hpp: In instantiation of 'T boost::spirit::detail::changesign(T) [with T = long double]':
+./boost/spirit/home/qi/numeric/detail/real_impl.hpp:94:50:   required from here
+./boost/spirit/home/support/detail/sign.hpp:60:36: error:
+no type named 'bits' in 'traits_type {aka struct boost::math::detail::fp_traits_non_native<long double, boost::math::detail::extended_double_precision>}'
+         typename traits_type::bits a;
+
+Simply call (boost::math::changesign)(x) from include/boost/spirit/home/support/detail/sign.hpp
+to fixes this.
+
+Fixes:
+http://autobuild.buildroot.net/results/be1/be1069e8528d299f487f431f7e2d793413ccbab8/build-end.log
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ boost/spirit/home/support/detail/sign.hpp | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/boost/spirit/home/support/detail/sign.hpp b/boost/spirit/home/support/detail/sign.hpp
+index 7c1bfb0..a5fc7e1 100644
+--- a/boost/spirit/home/support/detail/sign.hpp
++++ b/boost/spirit/home/support/detail/sign.hpp
+@@ -15,7 +15,7 @@
+ 
+ #include <boost/config/no_tr1/cmath.hpp>
+ #include <boost/version.hpp>
+-#if BOOST_VERSION < 104000 
++#if BOOST_VERSION < 104000
+ #include <boost/spirit/home/support/detail/math/fpclassify.hpp>
+ #include <boost/spirit/home/support/detail/math/signbit.hpp>
+ #else
+@@ -55,13 +55,7 @@ namespace boost { namespace spirit { namespace detail
+ #if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+         return -x;
+ #else
+-        typedef typename math::detail::fp_traits<T>::type traits_type;
+-
+-        typename traits_type::bits a;
+-        traits_type::get_bits(x, a);
+-        a ^= traits_type::sign;
+-        traits_type::set_bits(x, a);
+-        return x;
++        return (boost::math::changesign)(x);
+ #endif
+     }
+ #endif
+-- 
+1.9.3
+
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [RFC] package/boost: fix powerpc uClibc build issue
  2015-05-15 17:00 [Buildroot] [RFC] package/boost: fix powerpc uClibc build issue Romain Naour
@ 2015-05-15 18:42 ` Thomas Petazzoni
  2015-05-15 19:22   ` Romain Naour
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2015-05-15 18:42 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Fri, 15 May 2015 19:00:07 +0200, Romain Naour wrote:
> With powerpc target and uClibc toolchain the spirit library doesn't
> build properly due to an invalid field access.
> 
> The "bits" field is intended only for internal use in
> include/boost/math/special_functions/sign.hpp not from
> include/boost/spirit/home/support/detail/sign.hpp.
> 
> Simply call (boost::math::changesign)(x) from
> include/boost/spirit/home/support/detail/sign.hpp to fixes this.
> 
> Fixes:
> http://autobuild.buildroot.net/results/be1/be1069e8528d299f487f431f7e2d793413ccbab8/
> 
> And many more.
> 
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ---
> It's not clear why this issue is only trigged by powerpc
> with uClibc toolchain.
> Also, it's a pity that the spirit library doesn't use directly
> math library instead of using a wrapper.

My opinion is that this patch is too tricky to be committed without
being checked by upstream Boost developers, especially since there is
no explanation as to why the problem occurs only on PowerPC.

I would prefer to disable boost-log on PowerPC/uClibc, as proposed by
the patch I submitted shortly after this one.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [RFC] package/boost: fix powerpc uClibc build issue
  2015-05-15 18:42 ` Thomas Petazzoni
@ 2015-05-15 19:22   ` Romain Naour
  0 siblings, 0 replies; 3+ messages in thread
From: Romain Naour @ 2015-05-15 19:22 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 15/05/2015 20:42, Thomas Petazzoni a ?crit :
> Dear Romain Naour,
> 
> On Fri, 15 May 2015 19:00:07 +0200, Romain Naour wrote:
>> With powerpc target and uClibc toolchain the spirit library doesn't
>> build properly due to an invalid field access.
>>
>> The "bits" field is intended only for internal use in
>> include/boost/math/special_functions/sign.hpp not from
>> include/boost/spirit/home/support/detail/sign.hpp.
>>
>> Simply call (boost::math::changesign)(x) from
>> include/boost/spirit/home/support/detail/sign.hpp to fixes this.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/be1/be1069e8528d299f487f431f7e2d793413ccbab8/
>>
>> And many more.
>>
>> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
>> ---
>> It's not clear why this issue is only trigged by powerpc
>> with uClibc toolchain.
>> Also, it's a pity that the spirit library doesn't use directly
>> math library instead of using a wrapper.
> 
> My opinion is that this patch is too tricky to be committed without
> being checked by upstream Boost developers, especially since there is
> no explanation as to why the problem occurs only on PowerPC.
> 
> I would prefer to disable boost-log on PowerPC/uClibc, as proposed by
> the patch I submitted shortly after this one.

I'm agree with your proposal and I'll wait for upstream comment on this patch:

http://sourceforge.net/p/spirit/mailman/message/34116604/

Best regards,
Romain

> Best regards,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-15 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15 17:00 [Buildroot] [RFC] package/boost: fix powerpc uClibc build issue Romain Naour
2015-05-15 18:42 ` Thomas Petazzoni
2015-05-15 19:22   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.