All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/3] boost: fix compilation using soft float toolchains
Date: Mon, 29 Aug 2016 12:16:21 +0100	[thread overview]
Message-ID: <1472469381.8449.16.camel@andred.net> (raw)
In-Reply-To: <20160829110341.13100-3-git@andred.net>

Khem,

I expect that http://git.openembedded.org/openembedded-core/tree/meta/recipe
s-support/boost/boost/consider-hardfp.patch won't be needed for arm any more
with this patch applied (but am not in a position to test)

Cheers,
Andre'

On Mo, 2016-08-29 at 12:03 +0100, André Draszik wrote:
> In particular mips*-nf
> 
> Signed-off-by: André Draszik <git@andred.net>
> ---
>  .../boost/0002-config-gcc-BOOST_NO_FENV_H.patch    | 75
> ++++++++++++++++++++++
>  meta/recipes-support/boost/boost_1.61.0.bb         |  1 +
>  2 files changed, 76 insertions(+)
>  create mode 100644 meta/recipes-support/boost/boost/0002-config-gcc-
> BOOST_NO_FENV_H.patch
> 
> diff --git a/meta/recipes-support/boost/boost/0002-config-gcc-
> BOOST_NO_FENV_H.patch b/meta/recipes-support/boost/boost/0002-config-gcc-
> BOOST_NO_FENV_H.patch
> new file mode 100644
> index 0000000..55a0c07
> --- /dev/null
> +++ b/meta/recipes-support/boost/boost/0002-config-gcc-
> BOOST_NO_FENV_H.patch
> @@ -0,0 +1,75 @@
> +From c97b70d96b63ec116a486e3b599dd505d13f5478 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
> +Date: Wed, 24 Aug 2016 20:58:59 +0100
> +Subject: [PATCH 2/3] config: gcc: #define BOOST_NO_FENV_H on FPU-less
> arches
> +
> +gcc.compile.c++ <builddir>/boost/bin.v2/libs/test/build/gcc-
> 4.3.1/release/threading-multi/execution_monitor.o
> +
> +    "mipsel-poky-linux-musl-g++" "-mel" "-mabi=32" "-msoft-float" "-
> march=mips32r2" "-mips16" "-minterlink-compressed" "-mtune=24kec" "-mdsp"
> "-Wl,-O1" "-Wl,--as-needed" "-fstack-protector-strong" "-Wl,-z,relro,-
> z,now" "--sysroot=<sysroot>"  -ftemplate-depth-128 -O2 -pipe -g
> -feliminate-unused-debug-types -fdebug-prefix-
> map=<srcdir>=/usr/src/debug/boost/1.61.0-r0 -fdebug-prefix-
> map=<sysroot_host>= -fdebug-prefix-map=<sysroot>= -fstack-protector-strong 
> -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-
> security -fvisibility-inlines-hidden -O3 -finline-functions -Wno-inline
> -Wall -pedantic -pthread -fPIC -Wno-variadic-macros -DBOOST_ALL_NO_LIB=1
> -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1
> -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_TEST_DYN_LINK=1
> -DBOOST_TIMER_DYN_LINK=1 -DNDEBUG  -I"." -c -o
> "<builddir>/boost/bin.v2/libs/test/build/gcc-4.3.1/release/threading-
> multi/execution_monitor.o" "libs/test/src/execution_monitor.cpp"
> +
> +In file included from ./boost/test/impl/execution_monitor.ipp:31:0,
> +                 from libs/test/src/execution_monitor.cpp:16:
> +./boost/test/execution_monitor.hpp:491:27: error: 'FE_DIVBYZERO' was not
> declared in this scope
> +     BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
> +                           ^~~~~~~~~~~~
> +./boost/test/execution_monitor.hpp:492:27: error: 'FE_INEXACT' was not
> declared in this scope
> +     BOOST_FPE_INEXACT   = FE_INEXACT,
> +                           ^~~~~~~~~~
> +./boost/test/execution_monitor.hpp:493:27: error: 'FE_INVALID' was not
> declared in this scope
> +     BOOST_FPE_INVALID   = FE_INVALID,
> +                           ^~~~~~~~~~
> +./boost/test/execution_monitor.hpp:494:27: error: 'FE_OVERFLOW' was not
> declared in this scope
> +     BOOST_FPE_OVERFLOW  = FE_OVERFLOW,
> +                           ^~~~~~~~~~~
> +./boost/test/execution_monitor.hpp:495:27: error: 'FE_UNDERFLOW' was not
> declared in this scope
> +     BOOST_FPE_UNDERFLOW = FE_UNDERFLOW,
> +                           ^~~~~~~~~~~~
> +
> +The reason is that some (notably FPU-less) architectures,
> +including mips*-nf, don't define/implement some of the
> +floating point constants, even though fenv.h is
> +available.
> +
> +At least on MIPS, while FE_ALL_EXCEPT is #define'd, its
> +value is 0.
> +
> +A similar problem exists on FPU-less ARM machines.
> +
> +  https://svn.boost.org/trac/boost/ticket/11756
> +
> +Other projects have similar issues, e.g. pixman, and
> +apply similar work-arounds:
> +  https://lists.freedesktop.org/archives/pixman/2014-February/003172.html
> +
> +Signed-off-by: André Draszik <adraszik@tycoint.com>
> +---
> +Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756
> + boost/config/compiler/gcc.hpp | 18 ++++++++++++++++++
> + 1 file changed, 18 insertions(+)
> +
> +diff --git a/boost/config/compiler/gcc.hpp
> b/boost/config/compiler/gcc.hpp
> +index fbd3dd9..7c4fd06 100644
> +--- a/boost/config/compiler/gcc.hpp
> ++++ b/boost/config/compiler/gcc.hpp
> +@@ -262,6 +262,18 @@
> + #  define BOOST_NO_CXX14_BINARY_LITERALS
> + #endif
> + 
> ++// C++11 floating-point environment
> ++#if !defined(BOOST_NO_FENV_H)
> ++   // Some (notably FPU-less) architectures,
> ++   // including mips*-nf, don't define/implement some of
> ++   // the floating point constants, even though fenv.h
> ++   // is available.
> ++#  include <bits/fenv.h>
> ++#  if !defined(FE_ALL_EXCEPT) || (FE_ALL_EXCEPT == 0)
> ++#    define BOOST_NO_FENV_H
> ++#  endif
> ++#endif
> ++
> + // C++14 features in 4.9.0 and later
> + //
> + #if (BOOST_GCC_VERSION < 40900) || (__cplusplus < 201300)
> +-- 
> +2.9.3
> +
> diff --git a/meta/recipes-support/boost/boost_1.61.0.bb b/meta/recipes-
> support/boost/boost_1.61.0.bb
> index 41ff203..09137db 100644
> --- a/meta/recipes-support/boost/boost_1.61.0.bb
> +++ b/meta/recipes-support/boost/boost_1.61.0.bb
> @@ -6,4 +6,5 @@ SRC_URI += "\
>      file://consider-hardfp.patch \
>      file://boost-CVE-2012-2677.patch \
>      file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-
> includ.patch \
> +    file://0002-gcc-config-BOOST_NO_FENV_H.patch \
>  "


  reply	other threads:[~2016-08-29 11:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 11:03 [PATCH 0/3] boost mips16e and soft-float fixes André Draszik
2016-08-29 11:03 ` [PATCH 1/3] boost: fix a musl compilation warning André Draszik
2016-08-29 11:03 ` [PATCH 2/3] boost: fix compilation using soft float toolchains André Draszik
2016-08-29 11:16   ` André Draszik [this message]
2016-08-29 11:03 ` [PATCH 3/3] boost: fix MIPS16e compilation André Draszik
2016-08-29 11:55 ` [PATCH v2 0/3] boost mips16e and soft-float fixes André Draszik
2016-08-29 11:55   ` [PATCH v2 1/3] boost: fix a musl compilation warning André Draszik
2016-08-29 11:55   ` [PATCH v2 2/3] boost: fix compilation using soft float toolchains André Draszik
2016-08-29 11:55   ` [PATCH v2 3/3] boost: fix MIPS16e compilation André Draszik
2016-08-30 16:00   ` [PATCH v2 0/3] boost mips16e and soft-float fixes Richard Purdie
2016-08-30 16:05     ` André Draszik
2016-09-03  0:12 ` [PATCH v3 " André Draszik
2016-09-03  0:12   ` [PATCH v3 1/3] boost: fix a musl compilation warning André Draszik
2016-09-03  0:12   ` [PATCH v3 2/3] boost: fix mips soft float compilation André Draszik
2016-09-03  0:12   ` [PATCH v3 3/3] boost: fix MIPS16e compilation André Draszik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472469381.8449.16.camel@andred.net \
    --to=git@andred.net \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.