boost mips16e and soft-float fixes
cover boost mips16e and soft-float fixes
Hi,
These patches fix a few issues, see patches for details. All patches have been submitted upstream.
Cheers,
André
PATCH 1/3 boost: fix a musl compilation warning
--- ...detail-socket_types.hpp-fix-poll.h-includ.patch | 46 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 47 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch
meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 40192301130dcd913aa6d9cb9dba9e5f8dbd9d16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 21:01:43 +0100 +Subject: [PATCH 1/3] use POSIX poll.h instead of sys/poll.h + +POSIX specifies that <poll.h> is the correct header to +include for poll() + http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html +whereas <sys/poll.h> is only needed for ancient glibc (<2.3), +so let's follow POSIX instead. + +As a side-effect, this silences a warning when compiling +against the musl C-library: + +In file included from ./boost/asio/detail/socket_types.hpp:61:0, + from ./boost/asio/ip/address_v4.hpp:21, + from ./boost/asio/ip/address.hpp:21, + from libs/log/src/init_from_settings.cpp:65: +<sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] + #warning redirecting incorrect #include <sys/poll.h> to <poll.h> + ^~~~~~~ + +etc. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/12419 + boost/asio/detail/socket_types.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/asio/detail/socket_types.hpp b/boost/asio/detail/socket_types.hpp +index e8c7109..7e65d3c 100644 +--- a/boost/asio/detail/socket_types.hpp ++++ b/boost/asio/detail/socket_types.hpp +@@ -58,7 +58,7 @@ + #else + # include <sys/ioctl.h> + # if !defined(__SYMBIAN32__) +-# include <sys/poll.h> ++# include <poll.h> + # endif + # include <sys/types.h> + # include <sys/stat.h> +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -5,4 +5,5 @@ SRC_URI += "\ file://arm-intrinsics.patch \ file://consider-hardfp.patch \ file://boost-CVE-2012-2677.patch \ + file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ "
Signature · 1 line
2.9.3
PATCH 2/3 boost: fix compilation using soft float toolchains
In reply to André DraszikIn particular mips*-nf
--- .../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
meta/recipes-support/boost/boost/0002-config-gcc-BOOST_NO_FENV_H.patch new file +75 -0
@@ -0,0 +1,75 @@ +From c97b70d96b63ec116a486e3b599dd505d13f5478 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +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 <[email protected]> +--- +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 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -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 \ "
Signature · 1 line
2.9.3
Re: [PATCH 2/3] boost: fix compilation using soft float toolchains
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'
Quoted 129 lines · André Draszik
In particular mips*-nf
Signed-off-by André Draszik <[email protected]>---
.../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
(quoted diff) +0
-0BOOST_NO_FENV_H.patch b/meta/recipes-support/boost/boost/0002-config-gcc- BOOST_NO_FENV_H.patch
new file mode 100644
index 0000000..55a0c07meta/recipes-support/boost/boost/0002-config-gcc- new file +0
-0BOOST_NO_FENV_H.patch
meta/recipes-support/boost/boost/0002-config-gcc- new file +4
-0@@ -0,0 +1,75 @@ +From c97b70d96b63ec116a486e3b599dd505d13f5478 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 20:58:59 +0100 +Subject: [PATCH 2/3] config: gcc: #define BOOST_NO_FENV_H on FPU-lessarches
meta/recipes-support/boost/boost/0002-config-gcc- new file +2
-0+ +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-inlinemeta/recipes-support/boost/boost/0002-config-gcc- new file +0
-4-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"meta/recipes-support/boost/boost/0002-config-gcc- new file +4
-0+ +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 notdeclared 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,
+ ^~~~~~~~~~~~meta/recipes-support/boost/boost/0002-config-gcc- new file +24
-0+ +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 <[email protected]> +--- +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.hppb/boost/config/compiler/gcc.hpp
meta/recipes-support/boost/boost/0002-config-gcc- new file +25
-0+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 +meta/recipes- renamed from meta/recipes-support/boost/boost_1.61.0.bb +0
-0support/boost/boost_1.61.0.bb
index 41ff203..09137db 100644meta/recipes-support/boost/boost_1.61.0.bb +0
-0@@ -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 \
"
PATCH 3/3 boost: fix MIPS16e compilation
In reply to André Draszikuse g++ 4.1+ __sync intrinsics instead of incompatible hand-written assembly
--- ...ips-assembly-doesn-t-compile-in-mips16e-m.patch | 57 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 58 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch new file +57 -0
@@ -0,0 +1,57 @@ +From 4f19d72ca94418431e068cfd4ffb96ed9b289f6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 17:34:59 +0100 +Subject: [PATCH 3/3] smart_ptr: mips assembly doesn't compile in mips16e mode + +gcc.compile.c++ <builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.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 -pthread -fPIC -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -I"." -c -o "<builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o" "libs/date_time/src/gregorian/greg_month.cpp" + +{standard input}: Assembler messages: +{standard input}:17603: Warning: the `dsp' extension requires MIPS32 revision 2 or greater +{standard input}:17604: Error: unrecognized opcode `ll $3,4($16)' +{standard input}:17606: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:17734: Error: unrecognized opcode `ll $3,8($16)' +{standard input}:17736: Error: unrecognized opcode `sc $2,8($16)' +{standard input}:18084: Error: unrecognized opcode `ll $3,4($4)' +{standard input}:18086: Error: unrecognized opcode `sc $2,4($4)' +{standard input}:18318: Error: unrecognized opcode `ll $3,8($4)' +{standard input}:18320: Error: unrecognized opcode `sc $2,8($4)' +{standard input}:19921: Error: unrecognized opcode `ll $3,4($2)' +{standard input}:19923: Error: unrecognized opcode `sc $3,4($2)' +{standard input}:20199: Error: unrecognized opcode `ll $4,4($16)' +{standard input}:20201: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:23392: Error: unrecognized opcode `ll $4,8($16)' +{standard input}:23394: Error: unrecognized opcode `sc $2,8($16)' +...failed updating 1 target... + +boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +contains hand-written MIPS assembly, which is not compatible +with the MIPS16e instruction set. + +By not using this file in MIPS16e mode, we fallback to using +g++ 4.1+ __sync intrinsics (__sync_fetch_and_add() and +__sync_val_compare_and_swap()) which are working fine. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Sumbitted https://svn.boost.org/trac/boost/ticket/12418 + boost/smart_ptr/detail/sp_counted_base.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp +index 0addf07..0995ca8 100644 +--- a/boost/smart_ptr/detail/sp_counted_base.hpp ++++ b/boost/smart_ptr/detail/sp_counted_base.hpp +@@ -65,7 +65,7 @@ + #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp> + +-#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) ++#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp> + + #elif defined( BOOST_SP_HAS_SYNC ) +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -7,4 +7,5 @@ SRC_URI += "\ 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 \ + file://0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch \ "
Signature · 1 line
2.9.3
v2 cover boost mips16e and soft-float fixes
In reply to André DraszikAn error crept into the previous series :-(, fixed now.
PATCH v2 1/3 boost: fix a musl compilation warning
--- ...detail-socket_types.hpp-fix-poll.h-includ.patch | 46 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 47 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch
meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 40192301130dcd913aa6d9cb9dba9e5f8dbd9d16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 21:01:43 +0100 +Subject: [PATCH 1/3] use POSIX poll.h instead of sys/poll.h + +POSIX specifies that <poll.h> is the correct header to +include for poll() + http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html +whereas <sys/poll.h> is only needed for ancient glibc (<2.3), +so let's follow POSIX instead. + +As a side-effect, this silences a warning when compiling +against the musl C-library: + +In file included from ./boost/asio/detail/socket_types.hpp:61:0, + from ./boost/asio/ip/address_v4.hpp:21, + from ./boost/asio/ip/address.hpp:21, + from libs/log/src/init_from_settings.cpp:65: +<sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] + #warning redirecting incorrect #include <sys/poll.h> to <poll.h> + ^~~~~~~ + +etc. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/12419 + boost/asio/detail/socket_types.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/asio/detail/socket_types.hpp b/boost/asio/detail/socket_types.hpp +index e8c7109..7e65d3c 100644 +--- a/boost/asio/detail/socket_types.hpp ++++ b/boost/asio/detail/socket_types.hpp +@@ -58,7 +58,7 @@ + #else + # include <sys/ioctl.h> + # if !defined(__SYMBIAN32__) +-# include <sys/poll.h> ++# include <poll.h> + # endif + # include <sys/types.h> + # include <sys/stat.h> +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -5,4 +5,5 @@ SRC_URI += "\ file://arm-intrinsics.patch \ file://consider-hardfp.patch \ file://boost-CVE-2012-2677.patch \ + file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ "
Signature · 1 line
2.9.3
PATCH v2 2/3 boost: fix compilation using soft float toolchains
In reply to André DraszikIn particular mips*-nf
--- .../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
meta/recipes-support/boost/boost/0002-config-gcc-BOOST_NO_FENV_H.patch new file +75 -0
@@ -0,0 +1,75 @@ +From c97b70d96b63ec116a486e3b599dd505d13f5478 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +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 <[email protected]> +--- +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 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -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-config-gcc-BOOST_NO_FENV_H.patch \ "
Signature · 1 line
2.9.3
PATCH v2 3/3 boost: fix MIPS16e compilation
In reply to André Draszikuse g++ 4.1+ __sync intrinsics instead of incompatible hand-written assembly
--- ...ips-assembly-doesn-t-compile-in-mips16e-m.patch | 57 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 58 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch new file +57 -0
@@ -0,0 +1,57 @@ +From 4f19d72ca94418431e068cfd4ffb96ed9b289f6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 17:34:59 +0100 +Subject: [PATCH 3/3] smart_ptr: mips assembly doesn't compile in mips16e mode + +gcc.compile.c++ <builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.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 -pthread -fPIC -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -I"." -c -o "<builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o" "libs/date_time/src/gregorian/greg_month.cpp" + +{standard input}: Assembler messages: +{standard input}:17603: Warning: the `dsp' extension requires MIPS32 revision 2 or greater +{standard input}:17604: Error: unrecognized opcode `ll $3,4($16)' +{standard input}:17606: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:17734: Error: unrecognized opcode `ll $3,8($16)' +{standard input}:17736: Error: unrecognized opcode `sc $2,8($16)' +{standard input}:18084: Error: unrecognized opcode `ll $3,4($4)' +{standard input}:18086: Error: unrecognized opcode `sc $2,4($4)' +{standard input}:18318: Error: unrecognized opcode `ll $3,8($4)' +{standard input}:18320: Error: unrecognized opcode `sc $2,8($4)' +{standard input}:19921: Error: unrecognized opcode `ll $3,4($2)' +{standard input}:19923: Error: unrecognized opcode `sc $3,4($2)' +{standard input}:20199: Error: unrecognized opcode `ll $4,4($16)' +{standard input}:20201: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:23392: Error: unrecognized opcode `ll $4,8($16)' +{standard input}:23394: Error: unrecognized opcode `sc $2,8($16)' +...failed updating 1 target... + +boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +contains hand-written MIPS assembly, which is not compatible +with the MIPS16e instruction set. + +By not using this file in MIPS16e mode, we fallback to using +g++ 4.1+ __sync intrinsics (__sync_fetch_and_add() and +__sync_val_compare_and_swap()) which are working fine. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Sumbitted https://svn.boost.org/trac/boost/ticket/12418 + boost/smart_ptr/detail/sp_counted_base.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp +index 0addf07..0995ca8 100644 +--- a/boost/smart_ptr/detail/sp_counted_base.hpp ++++ b/boost/smart_ptr/detail/sp_counted_base.hpp +@@ -65,7 +65,7 @@ + #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp> + +-#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) ++#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp> + + #elif defined( BOOST_SP_HAS_SYNC ) +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -7,4 +7,5 @@ SRC_URI += "\ file://boost-CVE-2012-2677.patch \ file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ file://0002-config-gcc-BOOST_NO_FENV_H.patch \ + file://0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch \ "
Signature · 1 line
2.9.3
Quoted 1 line · André Draszik
An error crept into the previous series :-(, fixed now.
bitbake boost-native blew up in my local build with these applied :(
| 1472572721.0863695: "g++" -ftemplate-depth-128 -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m64 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_DLL -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -D__STDC_CONSTANT_MACROS -I"." -c -o "/media/build1/poky/build/tmp/work/x86_64-linux/boost-native/1.61.0-r0/boost_1_61_0/x86_64-linux/boost/bin.v2/libs/log/build/gcc-4.3.1/release/log-api-unix/threading-multi/text_file_backend.o" "libs/log/src/text_file_backend.cpp" | 1472572721.0863695: | 1472572721.0863695: In file included from ./boost/config/compiler/gcc.hpp:271:0, | 1472572721.0863695: from ./boost/config.hpp:39, | 1472572721.0863695: from ./boost/log/detail/config.hpp:34, | 1472572721.0863695: from libs/log/src/text_file_backend.cpp:16: | 1472572721.0863695: /usr/include/x86_64-linux-gnu/bits/fenv.h:19:3: error: #error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | 1472572721.0863695: # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | 1472572721.0863695: ^ | 1472572721.0863695: ...failed updating 68 targets...
and many similar errors.
Cheers,
Richard
Quoted 27 lines · Richard Purdie
1472572721.0863695: "g++" -ftemplate-depth-128
Quoted 26 lines
(quoted diff) +0
-13-isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m64 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_DLL -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -D__STDC_CONSTANT_MACROS -I"." -c -o"/media/build1/poky/build/tmp/work/x86_64-linux/boost-native/1.61.0- r0/boost_1_61_0/x86_64-linux/boost/bin.v2/libs/log/build/gcc-
4.3.1/release/log-api-unix/threading-multi/text_file_backend.o" "libs/log/src/text_file_backend.cpp"
1472572721.0863695:
1472572721.0863695: In file included from ./boost/config/compiler/gcc.hpp:271:0, 1472572721.0863695: from ./boost/config.hpp:39, 1472572721.0863695: from ./boost/log/detail/config.hpp:34,
1472572721.0863695: from libs/log/src/text_file_backend.cpp:16:
1472572721.0863695:/usr/include/x86_64-linux-gnu/bits/fenv.h:19:3:
Quoted 8 lines
Quoted 6 lines
error: #error "Never use <
bits/fenv.h> directly; include <fenv.h> instead."
1472572721.0863695: # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
1472572721.0863695: ^
1472572721.0863695: ...failed updating 68 targets...and many similar errors.
I will send a version 3, taking in some comments from the boost bug tracker as well.
Sorry for that!
Andre'
v3 cover boost mips16e and soft-float fixes
In reply to André Draszikv3 changes:
patch 2/3 completely redone, should not break in -native
anymore, better standards compliance
patch 3/3 has been merged, so is actually a backport now
PATCH v3 1/3 boost: fix a musl compilation warning
Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/12419
--- ...detail-socket_types.hpp-fix-poll.h-includ.patch | 49 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch
meta/recipes-support/boost/boost/0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 40192301130dcd913aa6d9cb9dba9e5f8dbd9d16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 21:01:43 +0100 +Subject: [PATCH 1/4] use POSIX poll.h instead of sys/poll.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +POSIX specifies that <poll.h> is the correct header to +include for poll() + http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html +whereas <sys/poll.h> is only needed for ancient glibc (<2.3), +so let's follow POSIX instead. + +As a side-effect, this silences a warning when compiling +against the musl C-library: + +In file included from ./boost/asio/detail/socket_types.hpp:61:0, + from ./boost/asio/ip/address_v4.hpp:21, + from ./boost/asio/ip/address.hpp:21, + from libs/log/src/init_from_settings.cpp:65: +<sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] + #warning redirecting incorrect #include <sys/poll.h> to <poll.h> + ^~~~~~~ + +etc. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/12419 + boost/asio/detail/socket_types.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/asio/detail/socket_types.hpp b/boost/asio/detail/socket_types.hpp +index e8c7109..7e65d3c 100644 +--- a/boost/asio/detail/socket_types.hpp ++++ b/boost/asio/detail/socket_types.hpp +@@ -58,7 +58,7 @@ + #else + # include <sys/ioctl.h> + # if !defined(__SYMBIAN32__) +-# include <sys/poll.h> ++# include <poll.h> + # endif + # include <sys/types.h> + # include <sys/stat.h> +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -5,4 +5,5 @@ SRC_URI += "\ file://arm-intrinsics.patch \ file://consider-hardfp.patch \ file://boost-CVE-2012-2677.patch \ + file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ "
Signature · 1 line
2.9.3
PATCH v3 2/3 boost: fix mips soft float compilation
In reply to André DraszikUpstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756
--- ...execution_monitor.hpp-fix-mips-soft-float.patch | 145 +++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 146 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch
meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch new file +145 -0
@@ -0,0 +1,145 @@ +From 5c349a1c391c9ce171a1c80f5164fae764f27dba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 20:58:59 +0100 +Subject: [PATCH 2/4] boost/test/execution_monitor.hpp: fix mips soft float +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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. + +The key point is: + A fully standards conforming fenv.h does not have to + define any FE_* macros, and if it does define them, + then it defines macros only for the FP exceptions it + actually supports. + +So correct usage requires a triple check: +1) Check BOOST_NO_FENV_H to see if the header is supported. +2) Include the header and then check FE_ALL_EXCEPT to see + if any FP exceptions are supported. +3) Before using the individual FE_* macros, you need to + check for their existence too as not all may be + supported. + +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 + +Architectures are notably also allowed to define FE_ALL_EXCEPT to 0! +Keeping this in mind, and knowing that the compiler will eliminate +code that can't be executed, we can change BOOST_FPE_ALL to be 0 for +the case of compiling using Clang and/or fenv.h being unavailable +as well, which allows simplification of the #ifdef's in +execution_monitor.ipp a bit. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756 + boost/test/execution_monitor.hpp | 26 +++++++++++++++++++++++++- + boost/test/impl/execution_monitor.ipp | 10 ++++++++-- + 2 files changed, 33 insertions(+), 3 deletions(-) + +diff --git a/boost/test/execution_monitor.hpp b/boost/test/execution_monitor.hpp +index 0eee497..44fe59d 100644 +--- a/boost/test/execution_monitor.hpp ++++ b/boost/test/execution_monitor.hpp +@@ -486,15 +486,39 @@ enum masks { + BOOST_FPE_ALL = MCW_EM, + #elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) \ + || defined(__ARM_PCS) +- BOOST_FPE_ALL = 1, ++ BOOST_FPE_ALL = 0, + #else ++#if defined(FE_DIVBYZERO) + BOOST_FPE_DIVBYZERO = FE_DIVBYZERO, ++#else ++ BOOST_FPE_DIVBYZERO = 0, ++#endif ++#if defined(FE_INEXACT) + BOOST_FPE_INEXACT = FE_INEXACT, ++#else ++ BOOST_FPE_INEXACT = 0, ++#endif ++#if defined(FE_INVALID) + BOOST_FPE_INVALID = FE_INVALID, ++#else ++ BOOST_FPE_INVALID = 0, ++#endif ++#if defined(FE_OVERFLOW) + BOOST_FPE_OVERFLOW = FE_OVERFLOW, ++#else ++ BOOST_FPE_OVERFLOW = 0, ++#endif ++#if defined(FE_UNDERFLOW) + BOOST_FPE_UNDERFLOW = FE_UNDERFLOW, ++#else ++ BOOST_FPE_UNDERFLOW = 0, ++#endif + ++#if defined(FE_ALL_EXCEPT) + BOOST_FPE_ALL = FE_ALL_EXCEPT, ++#else ++ BOOST_FPE_ALL = 0, ++#endif + #endif + BOOST_FPE_INV = BOOST_FPE_ALL+1 + }; +diff --git a/boost/test/impl/execution_monitor.ipp b/boost/test/impl/execution_monitor.ipp +index f7fc8ea..d1088b9 100644 +--- a/boost/test/impl/execution_monitor.ipp ++++ b/boost/test/impl/execution_monitor.ipp +@@ -1381,7 +1381,10 @@ enable( unsigned mask ) + #endif + + return ~old_cw & BOOST_FPE_ALL; +-#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H) ++#elif defined(__GLIBC__) && defined(__USE_GNU) ++ if (BOOST_FPE_ALL == 0) ++ /* Not Implemented */ ++ return 0; + feclearexcept(BOOST_FPE_ALL); + int res = feenableexcept( mask ); + return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res; +@@ -1418,7 +1421,10 @@ disable( unsigned mask ) + #endif + + return ~old_cw & BOOST_FPE_ALL; +-#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H) ++#elif defined(__GLIBC__) && defined(__USE_GNU) ++ if (BOOST_FPE_ALL == 0) ++ /* Not Implemented */ ++ return BOOST_FPE_INV; + feclearexcept(BOOST_FPE_ALL); + int res = fedisableexcept( mask ); + return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res; +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -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-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch \ "
Signature · 1 line
2.9.3
PATCH v3 3/3 boost: fix MIPS16e compilation
In reply to André DraszikBackport upstream patch to use g++ 4.1+ __sync intrinsics instead of incompatible hand-written assembly when compiling for MIPS16e
Upstream-Status: Backport https://svn.boost.org/trac/boost/ticket/12418
--- ...ips-assembly-doesn-t-compile-in-mips16e-m.patch | 60 ++++++++++++++++++++++ meta/recipes-support/boost/boost_1.61.0.bb | 1 + 2 files changed, 61 insertions(+) create mode 100644 meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch new file +60 -0
@@ -0,0 +1,60 @@ +From 4f19d72ca94418431e068cfd4ffb96ed9b289f6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 24 Aug 2016 17:34:59 +0100 +Subject: [PATCH 3/4] smart_ptr: mips assembly doesn't compile in mips16e mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gcc.compile.c++ <builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.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 -pthread -fPIC -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -I"." -c -o "<builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o" "libs/date_time/src/gregorian/greg_month.cpp" + +{standard input}: Assembler messages: +{standard input}:17603: Warning: the `dsp' extension requires MIPS32 revision 2 or greater +{standard input}:17604: Error: unrecognized opcode `ll $3,4($16)' +{standard input}:17606: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:17734: Error: unrecognized opcode `ll $3,8($16)' +{standard input}:17736: Error: unrecognized opcode `sc $2,8($16)' +{standard input}:18084: Error: unrecognized opcode `ll $3,4($4)' +{standard input}:18086: Error: unrecognized opcode `sc $2,4($4)' +{standard input}:18318: Error: unrecognized opcode `ll $3,8($4)' +{standard input}:18320: Error: unrecognized opcode `sc $2,8($4)' +{standard input}:19921: Error: unrecognized opcode `ll $3,4($2)' +{standard input}:19923: Error: unrecognized opcode `sc $3,4($2)' +{standard input}:20199: Error: unrecognized opcode `ll $4,4($16)' +{standard input}:20201: Error: unrecognized opcode `sc $2,4($16)' +{standard input}:23392: Error: unrecognized opcode `ll $4,8($16)' +{standard input}:23394: Error: unrecognized opcode `sc $2,8($16)' +...failed updating 1 target... + +boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +contains hand-written MIPS assembly, which is not compatible +with the MIPS16e instruction set. + +By not using this file in MIPS16e mode, we fallback to using +g++ 4.1+ __sync intrinsics (__sync_fetch_and_add() and +__sync_val_compare_and_swap()) which are working fine. + +Signed-off-by: André Draszik <[email protected]> +--- +Upstream-Status: Backport https://svn.boost.org/trac/boost/ticket/12418 + boost/smart_ptr/detail/sp_counted_base.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp +index 0addf07..0995ca8 100644 +--- a/boost/smart_ptr/detail/sp_counted_base.hpp ++++ b/boost/smart_ptr/detail/sp_counted_base.hpp +@@ -65,7 +65,7 @@ + #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp> + +-#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) ++#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 ) + # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp> + + #elif defined( BOOST_SP_HAS_SYNC ) +-- +2.9.3 +
meta/recipes-support/boost/boost_1.61.0.bb +1 -0
@@ -7,4 +7,5 @@ SRC_URI += "\ file://boost-CVE-2012-2677.patch \ file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ file://0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch \ + file://0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch \ "
Signature · 1 line
2.9.3