summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2016-09-03 01:12:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-05 11:56:01 +0100
commit7e712e1831f8dd807cd634339fdffc5369da7f0a (patch)
treef732a83f703484f112ab4456783a6f4620fc6636
parent02d82eacc793cff197142fa0ffb265a09e7a9bc3 (diff)
downloadpoky-7e712e1831f8dd807cd634339fdffc5369da7f0a.tar.gz
boost: fix mips soft float compilation
Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756 (From OE-Core rev: 3e40a1d230a9c6f169f78c990b428019f321d90b) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch145
-rw-r--r--meta/recipes-support/boost/boost_1.61.0.bb1
2 files changed, 146 insertions, 0 deletions
diff --git a/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch b/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch
new file mode 100644
index 0000000000..569c987336
--- /dev/null
+++ b/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch
@@ -0,0 +1,145 @@
1From 5c349a1c391c9ce171a1c80f5164fae764f27dba Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
3Date: Wed, 24 Aug 2016 20:58:59 +0100
4Subject: [PATCH 2/4] boost/test/execution_monitor.hpp: fix mips soft float
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9gcc.compile.c++ <builddir>/boost/bin.v2/libs/test/build/gcc-4.3.1/release/threading-multi/execution_monitor.o
10
11 "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"
12
13In file included from ./boost/test/impl/execution_monitor.ipp:31:0,
14 from libs/test/src/execution_monitor.cpp:16:
15./boost/test/execution_monitor.hpp:491:27: error: 'FE_DIVBYZERO' was not declared in this scope
16 BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
17 ^~~~~~~~~~~~
18./boost/test/execution_monitor.hpp:492:27: error: 'FE_INEXACT' was not declared in this scope
19 BOOST_FPE_INEXACT = FE_INEXACT,
20 ^~~~~~~~~~
21./boost/test/execution_monitor.hpp:493:27: error: 'FE_INVALID' was not declared in this scope
22 BOOST_FPE_INVALID = FE_INVALID,
23 ^~~~~~~~~~
24./boost/test/execution_monitor.hpp:494:27: error: 'FE_OVERFLOW' was not declared in this scope
25 BOOST_FPE_OVERFLOW = FE_OVERFLOW,
26 ^~~~~~~~~~~
27./boost/test/execution_monitor.hpp:495:27: error: 'FE_UNDERFLOW' was not declared in this scope
28 BOOST_FPE_UNDERFLOW = FE_UNDERFLOW,
29 ^~~~~~~~~~~~
30
31The reason is that some (notably FPU-less) architectures,
32including mips*-nf, don't define/implement some of the
33floating point constants, even though fenv.h is
34available.
35
36The key point is:
37 A fully standards conforming fenv.h does not have to
38 define any FE_* macros, and if it does define them,
39 then it defines macros only for the FP exceptions it
40 actually supports.
41
42So correct usage requires a triple check:
431) Check BOOST_NO_FENV_H to see if the header is supported.
442) Include the header and then check FE_ALL_EXCEPT to see
45 if any FP exceptions are supported.
463) Before using the individual FE_* macros, you need to
47 check for their existence too as not all may be
48 supported.
49
50https://svn.boost.org/trac/boost/ticket/11756
51
52Other projects have similar issues, e.g. pixman, and
53apply similar work-arounds:
54 https://lists.freedesktop.org/archives/pixman/2014-February/003172.html
55
56Architectures are notably also allowed to define FE_ALL_EXCEPT to 0!
57Keeping this in mind, and knowing that the compiler will eliminate
58code that can't be executed, we can change BOOST_FPE_ALL to be 0 for
59the case of compiling using Clang and/or fenv.h being unavailable
60as well, which allows simplification of the #ifdef's in
61execution_monitor.ipp a bit.
62
63Signed-off-by: André Draszik <adraszik@tycoint.com>
64---
65Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756
66 boost/test/execution_monitor.hpp | 26 +++++++++++++++++++++++++-
67 boost/test/impl/execution_monitor.ipp | 10 ++++++++--
68 2 files changed, 33 insertions(+), 3 deletions(-)
69
70diff --git a/boost/test/execution_monitor.hpp b/boost/test/execution_monitor.hpp
71index 0eee497..44fe59d 100644
72--- a/boost/test/execution_monitor.hpp
73+++ b/boost/test/execution_monitor.hpp
74@@ -486,15 +486,39 @@ enum masks {
75 BOOST_FPE_ALL = MCW_EM,
76 #elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) \
77 || defined(__ARM_PCS)
78- BOOST_FPE_ALL = 1,
79+ BOOST_FPE_ALL = 0,
80 #else
81+#if defined(FE_DIVBYZERO)
82 BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
83+#else
84+ BOOST_FPE_DIVBYZERO = 0,
85+#endif
86+#if defined(FE_INEXACT)
87 BOOST_FPE_INEXACT = FE_INEXACT,
88+#else
89+ BOOST_FPE_INEXACT = 0,
90+#endif
91+#if defined(FE_INVALID)
92 BOOST_FPE_INVALID = FE_INVALID,
93+#else
94+ BOOST_FPE_INVALID = 0,
95+#endif
96+#if defined(FE_OVERFLOW)
97 BOOST_FPE_OVERFLOW = FE_OVERFLOW,
98+#else
99+ BOOST_FPE_OVERFLOW = 0,
100+#endif
101+#if defined(FE_UNDERFLOW)
102 BOOST_FPE_UNDERFLOW = FE_UNDERFLOW,
103+#else
104+ BOOST_FPE_UNDERFLOW = 0,
105+#endif
106
107+#if defined(FE_ALL_EXCEPT)
108 BOOST_FPE_ALL = FE_ALL_EXCEPT,
109+#else
110+ BOOST_FPE_ALL = 0,
111+#endif
112 #endif
113 BOOST_FPE_INV = BOOST_FPE_ALL+1
114 };
115diff --git a/boost/test/impl/execution_monitor.ipp b/boost/test/impl/execution_monitor.ipp
116index f7fc8ea..d1088b9 100644
117--- a/boost/test/impl/execution_monitor.ipp
118+++ b/boost/test/impl/execution_monitor.ipp
119@@ -1381,7 +1381,10 @@ enable( unsigned mask )
120 #endif
121
122 return ~old_cw & BOOST_FPE_ALL;
123-#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
124+#elif defined(__GLIBC__) && defined(__USE_GNU)
125+ if (BOOST_FPE_ALL == 0)
126+ /* Not Implemented */
127+ return 0;
128 feclearexcept(BOOST_FPE_ALL);
129 int res = feenableexcept( mask );
130 return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
131@@ -1418,7 +1421,10 @@ disable( unsigned mask )
132 #endif
133
134 return ~old_cw & BOOST_FPE_ALL;
135-#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
136+#elif defined(__GLIBC__) && defined(__USE_GNU)
137+ if (BOOST_FPE_ALL == 0)
138+ /* Not Implemented */
139+ return BOOST_FPE_INV;
140 feclearexcept(BOOST_FPE_ALL);
141 int res = fedisableexcept( mask );
142 return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
143--
1442.9.3
145
diff --git a/meta/recipes-support/boost/boost_1.61.0.bb b/meta/recipes-support/boost/boost_1.61.0.bb
index 41ff203272..de482ee4f4 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 += "\
6 file://consider-hardfp.patch \ 6 file://consider-hardfp.patch \
7 file://boost-CVE-2012-2677.patch \ 7 file://boost-CVE-2012-2677.patch \
8 file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \ 8 file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \
9 file://0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch \
9" 10"