Boost C++ Libraries: Ticket #11756: boost.Test: non standards compliant use of FE_* macros (unable to compile boost test library on FPU-less arches) https://svn.boost.org/trac10/ticket/11756 <p> In file included from ./boost/test/unit_test_monitor.hpp:18:0, </p> <blockquote> <p> from ./boost/test/impl/unit_test_monitor.ipp:20, from libs/test/src/unit_test_monitor.cpp:16: </p> </blockquote> <p> ./boost/test/execution_monitor.hpp:492:27: error: 'FE_DIVBYZERO' was not declared in this scope ./boost/test/execution_monitor.hpp:493:27: error: 'FE_INEXACT' was not declared in this scope ./boost/test/execution_monitor.hpp:494:27: error: 'FE_INVALID' was not declared in this scope ./boost/test/execution_monitor.hpp:495:27: error: 'FE_OVERFLOW' was not declared in this scope ./boost/test/execution_monitor.hpp:496:27: error: 'FE_UNDERFLOW' was not declared in this scope ./boost/test/execution_monitor.hpp:498:27: error: 'FE_ALL_EXCEPT' was not declared in this scope </p> <p> these constants are not defined in fenv.h version 1.58 was compiled successfully </p> <p> bartek@homesrv:~/builds/boost_1_59_0$ mips-openwrt-linux-g++ -v Reading specs from /work/openwrt-sdk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.6.3/specs COLLECT_GCC=mips-openwrt-linux-g++ COLLECT_LTO_WRAPPER=/work/openwrt-sdk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/../libexec/gcc/mips-openwrt-linux-uclibc/4.6.3/lto-wrapper Target: mips-openwrt-linux-uclibc Configured with: /work/openwrt/build_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/gcc-linaro-4.6-2012.02/configure --prefix=/work/openwrt/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=mips-openwrt-linux-uclibc --with-gnu-ld --enable-target-optspace --disable-libgomp --disable-libmudflap --disable-multilib --disable-nls --with-host-libstdcxx=-lstdc++ --with-float=soft --with-gmp=/work/openwrt/staging_dir/host --with-mpfr=/work/openwrt/staging_dir/host --disable-decimal-float --with-mips-plt --with-mpc=/work/openwrt/staging_dir/host --disable-libssp --disable-<span class="underline">cxa_atexit --with-headers=/work/openwrt/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include --enable-languages=c,c++ --enable-shared --enable-threads --with-slibdir=/work/openwrt/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib --enable-lto --with-libelf=/work/openwrt/staging_dir/host --disable-tls Thread model: posix gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) </span></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11756 Trac 1.4.3 viboes Thu, 29 Oct 2015 10:36:46 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11756#comment:1 https://svn.boost.org/trac10/ticket/11756#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Gennadiy Rozental</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">test</span> </li> </ul> Ticket joerg.krause@… Tue, 15 Dec 2015 20:27:43 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:2</guid> <description> <p> Same with Buildroot, e.g. <a class="ext-link" href="http://autobuild.buildroot.net/results/28d/28db2fc2d6bffeb7c842fbcce2eeaf89ae5f8b01/build-end.log"><span class="icon">​</span>http://autobuild.buildroot.net/results/28d/28db2fc2d6bffeb7c842fbcce2eeaf89ae5f8b01/build-end.log</a>. </p> <p> The problem is, that some architectures, currently do not implement FE_DIVBYZERO, even though they have &lt;fenv.h&gt; and feenableexcept(). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 13 Jan 2016 12:07:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:3</guid> <description> <p> I do not have access to those platforms. Do you know by chance if those "deficiencies" are described in the boost.config project? </p> <p> <a href="http://www.boost.org/doc/libs/1_60_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects">http://www.boost.org/doc/libs/1_60_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects</a> </p> <p> especially the macro </p> <pre class="wiki">BOOST_NO_FENV_H </pre> </description> <category>Ticket</category> </item> <item> <author>bartosz.krasinski@…</author> <pubDate>Wed, 13 Jan 2016 20:48:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:4</guid> <description> <p> Hi </p> <p> here is search result: </p> <p> bartek@homesrv:~/builds/boost_1_59_0$ grep -rnw . -e "BOOST_NO_FENV_H" ./libs/config/test/all/Jamfile.v2:394:test-suite "BOOST_NO_FENV_H" : ./libs/config/test/config_info.cpp:1073: PRINT_MACRO(BOOST_NO_FENV_H); ./libs/config/test/boost_no_fenv_h.ipp:9:// MACRO: BOOST_NO_FENV_H ./libs/config/test/no_fenv_h_pass.cpp:9:// Test file for macro BOOST_NO_FENV_H ./libs/config/test/no_fenv_h_pass.cpp:11:// BOOST_NO_FENV_H should be defined. ./libs/config/test/no_fenv_h_pass.cpp:23:#ifndef BOOST_NO_FENV_H ./libs/config/test/config_test.cpp:380:#ifndef BOOST_NO_FENV_H ./libs/config/test/config_test.cpp:1611: std::cerr &lt;&lt; "Failed test for BOOST_NO_FENV_H at: " &lt;&lt; <span class="underline">FILE</span> &lt;&lt; ":" &lt;&lt; <span class="underline">LINE</span> &lt;&lt; std::endl; ./libs/config/test/no_fenv_h_fail.cpp:9:// Test file for macro BOOST_NO_FENV_H ./libs/config/test/no_fenv_h_fail.cpp:11:// BOOST_NO_FENV_H should not be defined. ./libs/config/test/no_fenv_h_fail.cpp:23:#ifdef BOOST_NO_FENV_H ./libs/config/doc/html/boost_config/boost_macro_reference.html:293: &lt;code class="computeroutput"&gt;&lt;span class="identifier"&gt;BOOST_NO_FENV_H&lt;/span&gt;&lt;/code&gt; ./libs/config/doc/macro_reference.qbk:74:[[`BOOST_NO_FENV_H`][Platform, Standard library][ </p> <table class="wiki"> <tr>./boost/math/tools/config.hpp:339:#if ((defined(<span class="underline">linux</span>) &amp;&amp; !defined(<span class="underline">UCLIBC</span>) &amp;&amp; !defined(BOOST_MATH_HAVE_FIXED_GLIBC)) <td> defined(<span class="underline">QNX</span>) </td><td> defined(<span class="underline">IBMCPP</span>)) &amp;&amp; !defined(BOOST_NO_FENV_H) </td></tr></table> <p> ./boost/test/execution_monitor.hpp:63:#if !defined(BOOST_NO_FENV_H) </p> <table class="wiki"> <tr>./boost/test/execution_monitor.hpp:489:#elif defined(BOOST_NO_FENV_H) <td> defined(BOOST_CLANG) </td></tr></table> <p> ./boost/test/impl/execution_monitor.ipp:1382:#elif defined(<span class="underline">GLIBC</span>) &amp;&amp; defined(<span class="underline">USE_GNU) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; !defined(BOOST_NO_FENV_H) ./boost/test/impl/execution_monitor.ipp:1419:#elif defined(</span>GLIBC<span class="underline">) &amp;&amp; defined(</span>USE_GNU) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; !defined(BOOST_NO_FENV_H) ./boost/detail/fenv.hpp:10:#if defined(BOOST_NO_FENV_H) ./boost/config/platform/cygwin.hpp:43:#define BOOST_NO_FENV_H ./boost/config/compiler/intel.hpp:497:# define BOOST_NO_FENV_H ./boost/config/compiler/visualc.hpp:47:# define BOOST_NO_FENV_H </p> <p> when i added mentioned macro: BOOST_NO_FENV_H to the boost/config/user.hpp header then i successfully built following libraries (in comparision to the previous build - without this macro): </p> <p> libbost_unit_test_framework.a libbost_test_exec_monitor.a libbost_prge_xec_monitor.a </p> <p> of course for openwrt-linux-mips platform </p> <p> thanks for clue </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 13 Jan 2016 21:33:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:5</guid> <description> <p> Thank you for your feedback, </p> <p> Boost.Test relies on Boost.Config for the proper configuration of the <code>BOOST_NO_FENV_H</code> macro. From your message, it looks like this macro is not properly defined for your platform <code>openwrt-linux-mips</code>, and if you define it manually, Boost.Test properly compiles. </p> <p> Have I understood properly? </p> </description> <category>Ticket</category> </item> <item> <author>bartosz.krasinski@…</author> <pubDate>Wed, 13 Jan 2016 21:42:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:6</guid> <description> <p> Yes, exactly </p> <p> It is because, i guess, first of all i build bootstrap in x86_64. </p> <p> ./bootstrap.sh </p> <p> next i build boost for x86_64 and x86 platforms (debian) </p> <p> ./b2 link=static variant=release --prefix=/work/libextern/boost-x86 address-model=32 cxxflags=-fPIC install </p> <p> once again, thanks bartek </p> <p> ./b2 link=static variant=release --prefix=/work/libextern/boost-x64 address-model=64 cxxflags=-fPIC install </p> <p> finally i create boost.config.jam file, in which i place: </p> <p> using gcc : mips : "mips-openwrt-linux-g++" ; </p> <p> and i build boost for mips: </p> <p> ./b2 toolset=gcc-mips link=static variant=release --prefix=/work/libextern/boost-mips cxxflags=-fPIC --user-config=user.config.jam install </p> <p> maybe I missed something that boost build system did not recognized correctly mips platform but now i will add manually mentioned macro and it is enough for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 13 Jan 2016 21:48:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:7</guid> <description> <p> I will transfer the issue to Boost.Config then. Thanks </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 13 Jan 2016 21:49:10 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/11756#comment:8 https://svn.boost.org/trac10/ticket/11756#comment:8 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">test</span> → <span class="trac-field-new">config</span> </li> </ul> Ticket joerg.krause@… Wed, 13 Jan 2016 22:20:58 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:9</guid> <description> <p> Boost detects a fenv.h system header and assumes it defines FE_DIVBYZERO and friends. The involved toolchains does have this system header, but they do not define these macros, e.g. the mipsel toolchain from Buildroot (fenv.h includes tr1/cfenv): </p> <div class="wiki-code"><div class="code"><pre><span class="cm">/** @file tr1/cfenv</span> <span class="cm"> * This is a TR1 C++ Library header. </span> <span class="cm"> */</span> <span class="cp">#ifndef _GLIBCXX_TR1_CFENV</span> <span class="cp">#define _GLIBCXX_TR1_CFENV 1</span> <span class="cp">#pragma GCC system_header</span> <span class="cp">#include</span> <span class="cpf">&lt;bits/c++config.h&gt;</span><span class="cp"></span> <span class="cp">#if _GLIBCXX_HAVE_FENV_H</span> <span class="cp"># include &lt;fenv.h&gt;</span> <span class="cp">#endif</span> <span class="cp">#ifdef _GLIBCXX_USE_C99_FENV_TR1</span> <span class="cp">#undef feclearexcept</span> <span class="cp">#undef fegetexceptflag</span> <span class="cp">#undef feraiseexcept</span> <span class="cp">#undef fesetexceptflag</span> <span class="cp">#undef fetestexcept</span> <span class="cp">#undef fegetround</span> <span class="cp">#undef fesetround</span> <span class="cp">#undef fegetenv</span> <span class="cp">#undef feholdexcept</span> <span class="cp">#undef fesetenv</span> <span class="cp">#undef feupdateenv</span> <span class="n">namespace</span> <span class="n">std</span> <span class="nf">_GLIBCXX_VISIBILITY</span><span class="p">(</span><span class="k">default</span><span class="p">)</span> <span class="p">{</span> <span class="n">namespace</span> <span class="n">tr1</span> <span class="p">{</span> <span class="c1">// types</span> <span class="n">using</span> <span class="o">::</span><span class="n">fenv_t</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fexcept_t</span><span class="p">;</span> <span class="c1">// functions</span> <span class="n">using</span> <span class="o">::</span><span class="n">feclearexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetexceptflag</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feraiseexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetexceptflag</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fetestexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetround</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetround</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetenv</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feholdexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetenv</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feupdateenv</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> <span class="cp">#endif </span><span class="c1">// _GLIBCXX_USE_C99_FENV_TR1</span> <span class="cp">#endif </span><span class="c1">// _GLIBCXX_TR1_CFENV</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Mon, 29 Aug 2016 10:06:30 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/11756 https://svn.boost.org/trac10/ticket/11756 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-config-BOOST_NO_FENV_H.patch</span> </li> </ul> <p> gcc: #define BOOST_NO_FENV_H on FPU-less arches </p> Ticket André Draszik <git@…> Mon, 29 Aug 2016 10:08:33 GMT summary changed https://svn.boost.org/trac10/ticket/11756#comment:10 https://svn.boost.org/trac10/ticket/11756#comment:10 <ul> <li><strong>summary</strong> <span class="trac-field-old">Unable to compile boost test library on openwrt - mips</span> → <span class="trac-field-new">boost.Config doesn't detect FPU-less arches (Unable to compile boost test library on FPU-less arches)</span> </li> </ul> Ticket André Draszik <git@…> Mon, 29 Aug 2016 10:12:45 GMT type changed https://svn.boost.org/trac10/ticket/11756#comment:11 https://svn.boost.org/trac10/ticket/11756#comment:11 <ul> <li><strong>type</strong> <span class="trac-field-old">Support Requests</span> → <span class="trac-field-new">Patches</span> </li> </ul> Ticket John Maddock Mon, 29 Aug 2016 12:17:20 GMT owner, component changed https://svn.boost.org/trac10/ticket/11756#comment:12 https://svn.boost.org/trac10/ticket/11756#comment:12 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Gennadiy Rozental</span> </li> <li><strong>component</strong> <span class="trac-field-old">config</span> → <span class="trac-field-new">test</span> </li> </ul> <p> Sorry to ping this back to Boost.Test, but I believe this is a misunderstanding of how fenv.h works. The key point is: </p> <p> <em>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.</em> </p> <p> So correct usage requires a triple check: </p> <p> 1) Check BOOST_NO_FENV_H to see if the header is supported. </p> <p> 2) Include the header and then check FE_ALL_EXCEPT to see if <em>any</em> FP exceptions are supported. </p> <p> 3) Before using the individual FE_* macros, you need to check for their existence too as not all may be supported. </p> <p> And finally.... the standard also permits other FE_* macros if there are exceptions supported other than the standard set. There's no standard way to tell what these might be, but their presence can be inferred by checking FE_ALL_EXCEPT against the bitwise or of the other FE_* macros. </p> Ticket André Draszik <git@…> Tue, 30 Aug 2016 08:51:49 GMT attachment set https://svn.boost.org/trac10/ticket/11756 https://svn.boost.org/trac10/ticket/11756 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-execution_monitor-fix-soft-float-issues.patch</span> </li> </ul> <p> fix FE_* usage in test (based on previous comment) </p> Ticket André Draszik <git@…> Tue, 30 Aug 2016 11:31:01 GMT summary changed https://svn.boost.org/trac10/ticket/11756#comment:13 https://svn.boost.org/trac10/ticket/11756#comment:13 <ul> <li><strong>summary</strong> <span class="trac-field-old">boost.Config doesn't detect FPU-less arches (Unable to compile boost test library on FPU-less arches)</span> → <span class="trac-field-new">boost.Test: non standards compliant use of FE_* macros (unable to compile boost test library on FPU-less arches)</span> </li> </ul> Ticket John Maddock Tue, 30 Aug 2016 12:23:38 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:14</guid> <description> <p> That doesn't quite get it: if fenv.h is available, but FE_DIVBYZERO is unset then BOOST_FPE_DIVBYZERO is also left unset (for example), where as it should be set to a stub value I guess (1 or 0).... except a quick grep of the source suggests these are unused anyway? Which just leaves BOOST_FPE_ALL which definitely needs to be in #if...#else block, so I suggest something more like: </p> <pre class="wiki">#ifdef FE_DIVBYZERO BOOST_FPE_DIVBYZERO = FE_DIVBYZERO, #else BOOST_FPE_DIVBYZERO = 0, #endif #ifdef FE_INEXACT BOOST_FPE_INEXACT = FE_INEXACT, #else BOOST_FPE_INEXACT = 0, #endif #ifdef FE_INVALID BOOST_FPE_INVALID = FE_INVALID, #else BOOST_FPE_INVALID = 0, #endif #ifdef FE_OVERFLOW BOOST_FPE_OVERFLOW = FE_OVERFLOW, #else BOOST_FPE_OVERFLOW = 0, #endif #ifdef FE_UNDERFLOW BOOST_FPE_UNDERFLOW = FE_UNDERFLOW, #else BOOST_FPE_UNDERFLOW = 0, #endif #ifdef FE_ALL_EXCEPT BOOST_FPE_ALL = FE_ALL_EXCEPT, #else BOOST_FPE_ALL = 1, #endif </pre> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Tue, 30 Aug 2016 12:55:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:15</guid> <description> <p> Based on your previous comment: </p> <blockquote class="citation"> <p> Include the header and then check FE_ALL_EXCEPT to see if any FP exceptions are supported </p> </blockquote> <p> I understood that if fenv.h is available, then FE_ALL_EXCEPT can have *any* value. In my case, it is defined, but it's defined to 0, since no exceptions are supported. Hence I had a check for this. This is now gone, and with this version BOOST_FPE_ALL would be == 0, too. </p> <p> Hence I think it should be checking </p> <p> #ifdef FE_ALL_EXCEPT &amp;&amp; (FE_ALL_EXCEPT != 0) </p> <blockquote> <p> BOOST_FPE_ALL = FE_ALL_EXCEPT, </p> </blockquote> <p> #else </p> <blockquote> <p> BOOST_FPE_ALL = 1, </p> </blockquote> <p> #endif </p> <p> instead ? </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Tue, 30 Aug 2016 14:39:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:16</guid> <description> <p> On the other hand, does it really make sense to set BOOST_FPE_ALL to 1 if exceptions are not supported in the implementation? Wouldn't this be better? </p> <pre class="wiki">#ifdef FE_ALL_EXCEPT BOOST_FPE_ALL = FE_ALL_EXCEPT, #else BOOST_FPE_ALL = 0, #endif </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 30 Aug 2016 16:54:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:17</guid> <description> <p> Yes it does make more sense for BOOST_FPE_ALL to be 0 in that case - I just followed existing practice for the case where there is no fenv.h as I wasn't sure what effect a zero value might have in the code's assumptions. I think the library authors will have to figure that one out. </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Fri, 02 Sep 2016 23:51:19 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/11756 https://svn.boost.org/trac10/ticket/11756 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-execution_monitor-fix-soft-float-issues.2.patch</span> </li> </ul> <p> fix FE_* usage in test (updated again based on johnmaddock's tips) </p> Ticket André Draszik <git@…> Fri, 02 Sep 2016 23:54:24 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:18</guid> <description> <p> Thanks! </p> <p> I've had another look and I think this is a good version now. This works well for me on my target device as well as on my host machine. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 01 Oct 2016 06:59:02 GMT</pubDate> <title>owner, milestone changed https://svn.boost.org/trac10/ticket/11756#comment:19 https://svn.boost.org/trac10/ticket/11756#comment:19 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> Ticket Raffi Enficiaud Wed, 19 Oct 2016 09:47:37 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:20</guid> <description> <p> I am looking at this right now, and it is running fine on branch <code>origin/topic/11756-floatingpoint-exception-macros</code>. However, I am just thinking: </p> <ul><li>In case <code>fenv.h</code> is not found, does it mean that floating point exception is just not supported? </li><li>Does this mean the same as <code>FE_ALL_EXCEPT</code> not defined? </li></ul><p> I am just thinking of making this distinction together with the use of <code>BOOST_FPE_OFF</code>. </p> <p> I also would like to have a better coverage of this. On your platform, what happens when you divide by 0 with and without your patch applied? </p> <p> Thanks, </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Thu, 27 Oct 2016 09:38:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:21</guid> <description> <p> Thanks. I can't really answer your questions regarding missing fenv.h / FE_ALL_EXCEPT and BOOST_FPE_OFF. A standards compliant env should provide both, but of course FE_ALL_EXCEPT may be 0. </p> <blockquote> <p> <a class="ext-link" href="http://pubs.opengroup.org/onlinepubs/009695399/basedefs/fenv.h.html"><span class="icon">​</span>http://pubs.opengroup.org/onlinepubs/009695399/basedefs/fenv.h.html</a> <a class="ext-link" href="http://en.cppreference.com/w/cpp/numeric/fenv/FE_exceptions"><span class="icon">​</span>http://en.cppreference.com/w/cpp/numeric/fenv/FE_exceptions</a> </p> </blockquote> <p> I am not an expert on boost so I need some more information on what you want me to test please. Without my patch it doesn't compile on my platform. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 01 Nov 2016 08:58:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:22</guid> <description> <p> In develop, merged at rev cbbacca13083eaacd9c2d197524540ff9e37bade </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 02 Nov 2016 01:07:14 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/11756#comment:23 https://svn.boost.org/trac10/ticket/11756#comment:23 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Raffi Enficiaud Tue, 08 Nov 2016 22:44:42 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:24</guid> <description> <p> Merged to master (rev cd74a43a784bff0d9c4768fa26f5f1f2b1359014) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 11 Dec 2016 18:54:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11756#comment:25 https://svn.boost.org/trac10/ticket/11756#comment:25 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket smetz Tue, 03 Jan 2017 09:40:01 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:26</guid> <description> <p> Hi, this modification generates a buid error for Intel compilers (version 11.0 in my case). </p> <p> Indeed, for Intel compilers BOOST_NO_FENV_H is set as true, and compiler will not find fe* functions in execution_monitor.ipp lines 1382 and 1422. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 03 Jan 2017 09:50:24 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/11756#comment:27 https://svn.boost.org/trac10/ticket/11756#comment:27 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket Raffi Enficiaud Tue, 03 Jan 2017 09:52:48 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:28</guid> <description> <p> Hi smetz, </p> <p> Is this visible now on the regression board? I have no access to neither the Intel nor the "FPU-less" machines. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>smetz</dc:creator> <pubDate>Tue, 03 Jan 2017 10:55:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:29 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:29</guid> <description> <p> It doesn't appear in the regression board for the moment. This regression appeared in the boost 1.63 version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 03 Jan 2017 13:08:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:30 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:30</guid> <description> <p> Maybe you just have to come back on some modifications: </p> <p> in boost/test/impl/execution_monitor.ipp lines 1378 and 1418, change: </p> <pre class="wiki">#elif defined(__GLIBC__) &amp;&amp; defined(__USE_GNU) </pre><p> by </p> <pre class="wiki">#elif defined(__GLIBC__) &amp;&amp; defined(__USE_GNU) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; !defined(BOOST_NO_FENV_H) </pre><p> This works on my side with the Intel compiler. But I'm not sure that this will not introduce a new regression for the CLang compiler, I don't know if CLang support floatingpoint exceptions. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 30 Jan 2017 21:11:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:31</guid> <description> <p> Hi there, </p> <p> It would be handy if you can give a try to branch <code>topic/11756-non-standards-fpexception-intel</code>. Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 30 Jan 2017 21:11:24 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/11756#comment:32 https://svn.boost.org/trac10/ticket/11756#comment:32 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.63.0</span> → <span class="trac-field-new">Boost 1.64.0</span> </li> </ul> Ticket Raffi Enficiaud Sat, 04 Feb 2017 20:05:17 GMT <link>https://svn.boost.org/trac10/ticket/11756#comment:33 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:33</guid> <description> <p> Ping? </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Mon, 06 Feb 2017 09:50:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:34</guid> <description> <p> The suggested fix in topic/11756-non-standards-fpexception-intel breaks non-glibc builds (musl-libc in my case): </p> <pre class="wiki">gcc.compile.c++ [...]/mipsel-poky-linux-musl/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 -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 "[...]/mipsel-poky-linux-musl/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 libs/test/src/execution_monitor.cpp:16:0: ./boost/test/impl/execution_monitor.ipp: In function 'unsigned int boost::fpe::enable(unsigned int)': ./boost/test/impl/execution_monitor.ipp:1387:36: error: 'feenableexcept' was not declared in this scope ./boost/test/impl/execution_monitor.ipp: In function 'unsigned int boost::fpe::disable(unsigned int)': ./boost/test/impl/execution_monitor.ipp:1428:37: error: 'fedisableexcept' was not declared in this scope </pre><p> Those two #ifdefs can not be made the same as as in execution_monitor.hpp, as the header file only does standard posix stuff, wheres the implementation uses the non-POSIX, non-standard-C APIs feenableexcept() and fedisableexcept(), which are only available when using glibc. </p> <p> IOW, the test for __GLIBC__ and __USE_GNU must remain, and I think the two tests should go back to the original version: </p> <pre class="wiki">-#elif defined(__GLIBC__) &amp;&amp; defined(__USE_GNU) +#elif defined(__GLIBC__) &amp;&amp; defined(__USE_GNU) &amp;&amp; !(defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG)) </pre><p> sorry for that. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 06 Feb 2017 10:10:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:35 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:35</guid> <description> <p> Thanks for the quick feedback. Ok for the report, but to me the good solution is to be coherent with whatever is done to define the enum: </p> <pre class="wiki">namespace fpe { enum masks { BOOST_FPE_OFF = 0, #ifdef BOOST_SEH_BASED_SIGNAL_HANDLING /* *** */ BOOST_FPE_DIVBYZERO = EM_ZERODIVIDE, BOOST_FPE_INEXACT = EM_INEXACT, BOOST_FPE_INVALID = EM_INVALID, BOOST_FPE_OVERFLOW = EM_OVERFLOW, BOOST_FPE_UNDERFLOW = EM_UNDERFLOW|EM_DENORMAL, BOOST_FPE_ALL = MCW_EM, #elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) /* *** */ BOOST_FPE_ALL = BOOST_FPE_OFF, #else /* *** */ // ... </pre><p> So maybe a proper macro that says if there is nothing available and gathering the scenario where any of the <code>BOOST_NO_FENV_H</code>, <code>BOOST_CLANG</code>, <code>__USE_GNU</code> etc is defined (or not). </p> <p> What do you think? </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Mon, 06 Feb 2017 10:58:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:36 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:36</guid> <description> <p> Hm, not sure. On one hand I agree being coherent would be nice, but on the other hand it already isn't (and probably can't be) when you also take Windows &amp; Visual Studio into account in the implementation. It would seem that there are always going to be different implementations based on the compilation environment (Windows CE / MSVC / Posix / Non-Posix Unices / gcc / clang / fenv / no-fenv). </p> <p> Maybe I'm wrong. It does appear that the whole floating point support is a bit of a mess and hard to get right in a portable way, though. </p> <p> Happy to test a patch :-) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 27 Feb 2017 08:29:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:37</guid> <description> <p> Hi there again, </p> <p> I moved the FPE logic in the macro <code></code><code>BOOST_TEST_FPE_SUPPORT_WITHOUT_SEH__</code><code></code> . It would be cool if you can test the branch again. </p> <p> The way I see this is that there is only 3 options in the code that should be handled: </p> <ul><li>no fpe </li><li>seh based fpe </li><li>implementation based on fenv (and in that case, not all platforms support all signals) </li></ul><p> All in all, I think that moving this switch to 2 configuration macros make the code easier to understand and to maintain. </p> <p> Let me know the result of your tests. 1.64 will be closing soon, it would be good to have your feedback asap :) </p> <p> Thanks, Raffi </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Fri, 03 Mar 2017 18:41:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:38 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:38</guid> <description> <p> Kind ping :) </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Mon, 06 Mar 2017 18:03:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:39 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:39</guid> <description> <p> This still doesn't work (same as in comment 34): </p> <div class="wiki-code"><div class="code"><pre>In file included from libs/test/src/execution_monitor.cpp:16:0: ./boost/test/impl/execution_monitor.ipp: In <span class="k">function</span> <span class="s1">&#39;unsigned int boost::fpe::enable(unsigned int)&#39;</span>: ./boost/test/impl/execution_monitor.ipp:1384:36: error: <span class="s1">&#39;feenableexcept&#39;</span> was not declared in this scope int <span class="nv">res</span> <span class="o">=</span> feenableexcept<span class="o">(</span> mask <span class="o">)</span><span class="p">;</span> ^ ./boost/test/impl/execution_monitor.ipp: In <span class="k">function</span> <span class="s1">&#39;unsigned int boost::fpe::disable(unsigned int)&#39;</span>: ./boost/test/impl/execution_monitor.ipp:1419:37: error: <span class="s1">&#39;fedisableexcept&#39;</span> was not declared in this scope int <span class="nv">res</span> <span class="o">=</span> fedisableexcept<span class="o">(</span> mask <span class="o">)</span><span class="p">;</span> </pre></div></div><p> This still goes into the wrong branch when not using glibc - we use the musl C library and gcc, so <span class="underline">GLIBC</span> is *not* defined (and therefore the non-posix, non-standard GNU APIs feenableexcept() and fedisableexcept() are not available), but at the same BOOST_NO_FENV_H and BOOST_CLANG are not defined, either. Hence the test in execution_monitor.hpp doesn't work: </p> <div class="wiki-code"><div class="code"><pre> <span class="cp">#if !defined(BOOST_NO_FENV_H) &amp;&amp; !defined(BOOST_CLANG) || \</span> <span class="cp"> (defined(__GLIBC__) &amp;&amp; defined(__USE_GNU))</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Wed, 08 Mar 2017 14:52:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:40</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11756#comment:37" title="Comment 37">comment 37</a>: </p> <blockquote class="citation"> <p> The way I see this is that there is only 3 options in the code that should be handled: </p> <ul><li>no fpe </li><li>seh based fpe </li><li>implementation based on fenv (and in that case, not all platforms support all signals) </li></ul></blockquote> <p> Basically, there should be 3 options for defining the interface in .hpp, but 4 options based on the compilation environment for the .ipp: </p> <ol><li>no fpe </li><li>seh based fpe </li><li>implementation based on fenv (and in that case, not all platforms support all signals) <ol class="loweralpha"><li>using standard C/C++ APIs </li><li>using non-standard glibc extensions (feenableexcept() etc.) </li></ol></li></ol><p> Which is what I meant in <a class="ticket" href="https://svn.boost.org/trac10/ticket/11756#comment:34" title="Comment 34">comment 34</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 09 Mar 2017 12:20:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:41 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:41</guid> <description> <p> Ok, now I think I understood the problem: </p> <ul><li>the <code></code><code>feenableexcept/fedisableexcept</code><code></code> are not standard, those are <code></code>GLIBC<code></code> extensions </li><li>having fenv does not ensure that those 2 functions are in there, for having those function, we should be ensured that we are indeed compiling with GLIBC </li><li>however, for anything outside this and SEH based extensions, there is no easy way to mask floating point exceptions </li></ul><p> So, I suggest the following: </p> <ul><li>The macro indicating that the floating point exception settings is supported becomes <code></code><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code><code></code> and is defined like this: </li></ul><pre class="wiki">#if defined(BOOST_SEH_BASED_SIGNAL_HANDLING) &amp;&amp; !defined(UNDER_CE) //! Indicates tha the floating point exception handling is supported //! through SEH #define BOOST_TEST_FPE_SUPPORT_WITH_SEH__ #elif !defined(BOOST_SEH_BASED_SIGNAL_HANDLING) &amp;&amp; !defined(UNDER_CE) #if !defined(BOOST_NO_FENV_H) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; \ (defined(__GLIBC__) &amp;&amp; defined(__USE_GNU)) //! Indicates that floating point exception handling is supported for the //! non SEH version of it, for the GLIBC extensions only #define BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__ #endif #endif </pre><ul><li>the branch taking the <code></code><code>feenableexcept/fedisableexcept</code><code></code> is guarded by this macro </li><li>the branch taking the SEH extension is not affected </li><li>all the rest is falls back to the "unsupported" branch (returning <code></code><code>BOOST_FPE_OFF/BOOST_FPE_INV</code><code></code>). In particular, I do not see how to support <strong>3.a</strong> from your comment. </li></ul><p> Does this sound correct? </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Thu, 09 Mar 2017 13:55:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:42 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:42</guid> <description> <p> Yes, looks right. </p> <p> As for 3.a from my comment, I don't think there's an easy way to support it either. Googling a little bit it probably is possible, but that's out of scope for this issue here. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 09 Mar 2017 14:43:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:43 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:43</guid> <description> <p> Good, can you then please test again the branch <code></code><code>topic/11756-non-standards-fpexception-intel</code><code></code>? </p> <p> Many thanks! </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Thu, 09 Mar 2017 16:23:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:44 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:44</guid> <description> <p> That seems to work, at least it compiles in all cases I care about :-) </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jörg Krause</dc:creator> <pubDate>Sat, 11 Mar 2017 09:19:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:45 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:45</guid> <description> <p> We recently bumped the boost version from 1.61.0 to 1.63.0 in Buildroot. Now, we get build errors for two architectures which were compiling successfully before: SH4 and OR1K. Both use a uclibc-toolchain. </p> <pre class="wiki">In file included from libs/test/src/execution_monitor.cpp:16:0: ./boost/test/impl/execution_monitor.ipp: In function 'unsigned int boost::fpe::enable(unsigned int)': ./boost/test/impl/execution_monitor.ipp:1382:32: error: 'feclearexcept' was not declared in this scope feclearexcept(BOOST_FPE_ALL); ^ ./boost/test/impl/execution_monitor.ipp:1383:36: error: 'feenableexcept' was not declared in this scope int res = feenableexcept( mask ); ^ ./boost/test/impl/execution_monitor.ipp: In function 'unsigned int boost::fpe::disable(unsigned int)': ./boost/test/impl/execution_monitor.ipp:1422:32: error: 'feclearexcept' was not declared in this scope feclearexcept(BOOST_FPE_ALL); ^ ./boost/test/impl/execution_monitor.ipp:1423:37: error: 'fedisableexcept' was not declared in this scope int res = fedisableexcept( mask ); </pre><p> I've checked out the branch <code>topic/11756-non-standards-fpexception-intel</code> of the test module, it does not build either. </p> <p> At least, the SH4 toolchain does not have fenv.h. I did not checked to OR1K toolchain, yet. </p> <p> Here are some macros I've checked using the branch 11756: </p> <ul><li><code>BOOST_NO_FENV_H</code> <em>is defined</em> </li><li><code>BOOST_SEH_BASED_SIGNAL_HANDLING</code> <em>is not defined</em> </li><li><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code> <em>is defined</em> </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 10:02:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:46 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:46</guid> <description> <p> Hi Jörg, </p> <p> Thanks for looking at this as well! The macro definitions you report are weird: </p> <pre class="wiki"> #if !defined(BOOST_NO_FENV_H) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; \ (defined(__GLIBC__) &amp;&amp; defined(__USE_GNU)) //! Indicates that floating point exception handling is supported for the //! non SEH version of it, for the GLIBC extensions only #define BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__ #endif </pre><p> this means that if <code></code><code>BOOST_NO_FENV_H</code><code></code> is defined, then <code></code><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code><code></code> cannot be defined. Are you on revision <code></code><code>6f0d88ca9db00b449a795afa3218b815fe8c01b0</code><code></code> ? (I forced pushed like 1 hour ago) </p> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 10:42:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:47 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:47</guid> <description> <p> No, I am on revision <code>c0fb4b1c21865d2096fbee2f3c77026f5a743180</code>. </p> <p> Sorry, the macro definitions I posted are wrong. This is the correct ones: </p> <ul><li><code>BOOST_NO_FENV_H</code> <em>is not defined</em> </li><li><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code> <em>is defined</em> </li></ul><p> Note, this is the content of output/host/opt/ext-toolchain/sh4-buildroot-linux-uclibc/include/c++/5.4.0/fenv.h: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#ifndef _GLIBCXX_FENV_H</span> <span class="cp">#define _GLIBCXX_FENV_H 1</span> <span class="cp">#pragma GCC system_header</span> <span class="cp">#include</span> <span class="cpf">&lt;bits/c++config.h&gt;</span><span class="cp"></span> <span class="cp">#if _GLIBCXX_HAVE_FENV_H</span> <span class="cp"># include_next &lt;fenv.h&gt;</span> <span class="cp">#endif</span> <span class="cp">#if __cplusplus &gt;= 201103L</span> <span class="cp">#if _GLIBCXX_USE_C99_FENV_TR1</span> <span class="cp">#undef feclearexcept</span> <span class="cp">#undef fegetexceptflag</span> <span class="cp">#undef feraiseexcept</span> <span class="cp">#undef fesetexceptflag</span> <span class="cp">#undef fetestexcept</span> <span class="cp">#undef fegetround</span> <span class="cp">#undef fesetround</span> <span class="cp">#undef fegetenv</span> <span class="cp">#undef feholdexcept</span> <span class="cp">#undef fesetenv</span> <span class="cp">#undef feupdateenv</span> <span class="n">namespace</span> <span class="n">std</span> <span class="p">{</span> <span class="c1">// types</span> <span class="n">using</span> <span class="o">::</span><span class="n">fenv_t</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fexcept_t</span><span class="p">;</span> <span class="c1">// functions</span> <span class="n">using</span> <span class="o">::</span><span class="n">feclearexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetexceptflag</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feraiseexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetexceptflag</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fetestexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetround</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetround</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fegetenv</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feholdexcept</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">fesetenv</span><span class="p">;</span> <span class="n">using</span> <span class="o">::</span><span class="n">feupdateenv</span><span class="p">;</span> <span class="p">}</span> <span class="c1">// namespace</span> <span class="cp">#endif </span><span class="c1">// _GLIBCXX_USE_C99_FENV_TR1</span> <span class="cp">#endif </span><span class="c1">// C++11</span> <span class="cp">#endif </span><span class="c1">// _GLIBCXX_FENV_H</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 13:54:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:48 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:48</guid> <description> <p> Hi, </p> <p> Thanks for the update. You said in comment 45 that SH4 does not have fenv. Does that still hold true? If yes, then <code></code><code>BOOST_NO_FENV_H</code><code></code> should be defined. </p> <p> I would kindly ask to test the following 2 revisions: </p> <ul><li><code></code><code>02f9a561bc8003cb38fcc5b0863482459a38ea4f</code><code></code> (18 October 2016) </li><li><code></code><code>eec86d1fbe68aea190ce05a080d20e1569fb82a9</code><code></code> (24 August 2016) </li></ul><p> It looks to me that <code></code><code>BOOST_NO_FENV_H</code><code></code> is not properly set. </p> <p> Also, what are the status of the following two defines, for those two architectures: </p> <ul><li><code></code><code>__GLIBC__</code><code></code> </li><li><code></code><code>__USE_GNU</code><code></code> </li></ul><p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 14:39:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:49 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:49</guid> <description> <p> Sorry about by confusion about fenv.h. The toolchain tarball include the C++ Library header file fenv.h in sh4-buildroot-linux-uclibc/include/c++/5.4.0/, but it does not have a fenv.h in sysroot. I guess the later is generated somehow, right? (I've compared with another arm musl-toolchain which does have fenv.h in sysroot). </p> <hr /> <p> I've compiled the following example with the SH4 C++ compiler: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;cfenv&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;cmath&gt;</span><span class="cp"></span> <span class="cp">#pragma STDC FENV_ACCESS ON</span> <span class="k">volatile</span> <span class="kt">double</span> <span class="n">zero</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">;</span> <span class="c1">// volatile not needed where FENV_ACCESS is supported</span> <span class="k">volatile</span> <span class="kt">double</span> <span class="n">one</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">;</span> <span class="c1">// volatile not needed where FENV_ACCESS is supported</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">feclearexcept</span><span class="p">(</span><span class="n">FE_ALL_EXCEPT</span><span class="p">);</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;1.0/0.0 = &quot;</span> <span class="o">&lt;&lt;</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">zero</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="k">if</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">fetestexcept</span><span class="p">(</span><span class="n">FE_DIVBYZERO</span><span class="p">))</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;division by zero reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;divsion by zero not reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="n">std</span><span class="o">::</span><span class="n">feclearexcept</span><span class="p">(</span><span class="n">FE_ALL_EXCEPT</span><span class="p">);</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;1.0/10 = &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">one</span><span class="o">/</span><span class="mi">10</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="k">if</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">fetestexcept</span><span class="p">(</span><span class="n">FE_INEXACT</span><span class="p">))</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;inexact result reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;inexact result not reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="n">std</span><span class="o">::</span><span class="n">feclearexcept</span><span class="p">(</span><span class="n">FE_ALL_EXCEPT</span><span class="p">);</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;sqrt(-1) = &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">sqrt</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="k">if</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">fetestexcept</span><span class="p">(</span><span class="n">FE_INVALID</span><span class="p">))</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;invalid result reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;invalid result not reported</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> </pre></div></div><p> Invoking the cross-compiler: </p> <div class="wiki-code"><div class="code"><pre>buildroot <span class="o">)</span> output/host/usr/bin/sh4-linux-g++ -std<span class="o">=</span>c++11 main.cc main.cc: In <span class="k">function</span> ‘int main<span class="o">()</span>’: main.cc:12:5: error: ‘feclearexcept’ is not a member of ‘std’ std::feclearexcept<span class="o">(</span>FE_ALL_EXCEPT<span class="o">)</span><span class="p">;</span> ^ main.cc:12:24: error: ‘FE_ALL_EXCEPT’ was not declared in this scope std::feclearexcept<span class="o">(</span>FE_ALL_EXCEPT<span class="o">)</span><span class="p">;</span> ^ main.cc:14:8: error: ‘fetestexcept’ is not a member of ‘std’ <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_DIVBYZERO<span class="o">))</span> <span class="o">{</span> ^ main.cc:14:26: error: ‘FE_DIVBYZERO’ was not declared in this scope <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_DIVBYZERO<span class="o">))</span> <span class="o">{</span> ^ main.cc:20:5: error: ‘feclearexcept’ is not a member of ‘std’ std::feclearexcept<span class="o">(</span>FE_ALL_EXCEPT<span class="o">)</span><span class="p">;</span> ^ main.cc:22:8: error: ‘fetestexcept’ is not a member of ‘std’ <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_INEXACT<span class="o">))</span> <span class="o">{</span> ^ main.cc:22:26: error: ‘FE_INEXACT’ was not declared in this scope <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_INEXACT<span class="o">))</span> <span class="o">{</span> ^ main.cc:28:5: error: ‘feclearexcept’ is not a member of ‘std’ std::feclearexcept<span class="o">(</span>FE_ALL_EXCEPT<span class="o">)</span><span class="p">;</span> ^ main.cc:30:8: error: ‘fetestexcept’ is not a member of ‘std’ <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_INVALID<span class="o">))</span> <span class="o">{</span> ^ main.cc:30:26: error: ‘FE_INVALID’ was not declared in this scope <span class="k">if</span><span class="o">(</span>std::fetestexcept<span class="o">(</span>FE_INVALID<span class="o">))</span> <span class="o">{</span> </pre></div></div><hr /> <p> Commit 02f9a561bc8003cb38fcc5b0863482459a38ea4f (18 October 2016) produces the following error: </p> <div class="wiki-code"><div class="code"><pre>from libs/test/src/execution_monitor.cpp:16: ./boost/test/execution_monitor.hpp:503:27: error: ‘FE_DIVBYZERO’ was not declared in this scope <span class="nv">BOOST_FPE_DIVBYZERO</span> <span class="o">=</span> FE_DIVBYZERO, ^ ./boost/test/execution_monitor.hpp:504:27: error: ‘FE_INEXACT’ was not declared in this scope <span class="nv">BOOST_FPE_INEXACT</span> <span class="o">=</span> FE_INEXACT, ^ ./boost/test/execution_monitor.hpp:505:27: error: ‘FE_INVALID’ was not declared in this scope <span class="nv">BOOST_FPE_INVALID</span> <span class="o">=</span> FE_INVALID, ^ ./boost/test/execution_monitor.hpp:506:27: error: ‘FE_OVERFLOW’ was not declared in this scope <span class="nv">BOOST_FPE_OVERFLOW</span> <span class="o">=</span> FE_OVERFLOW, ^ ./boost/test/execution_monitor.hpp:507:27: error: ‘FE_UNDERFLOW’ was not declared in this scope <span class="nv">BOOST_FPE_UNDERFLOW</span> <span class="o">=</span> FE_UNDERFLOW, ^ ./boost/test/execution_monitor.hpp:509:27: error: ‘FE_ALL_EXCEPT’ was not declared in this scope <span class="nv">BOOST_FPE_ALL</span> <span class="o">=</span> FE_ALL_EXCEPT, </pre></div></div><hr /> <p> Whereas commit eec86d1fbe68aea190ce05a080d20e1569fb82a9 (24 August 2016) produces the same error as reported in comment 45. </p> <hr /> <p> For SH4: </p> <ul><li><code>__GLIBC__</code> is defined </li><li><code>__USE_GNU</code> is defined </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 16:20:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:50 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:50</guid> <description> <p> Thanks for the quick reply. </p> <p> Something troubles me a bit: you said earlier that things were working fine with boost 1.61. Since then, all the changes to the FPE were the following: </p> <ul><li>the macros <code></code><code>FE_DIVBYZERO</code><code></code> ... are not something that are necessarily defined, this is why their use has been protected if <code></code><code>ifdefs</code><code></code> and you are having the compilation error on <code></code><code>02f9a561bc8003cb38fcc5b0863482459a38ea4f</code><code></code> </li><li><code></code><code>feenableexcept/fedisableexcept</code><code></code> are <a class="ext-link" href="http://www.gnu.org/software/libc/manual/html_node/Control-Functions.html"><span class="icon">​</span>GNU extensions</a>, this is why the latest status on this is to check for the macros <code></code><code>__GLIBC__</code><code></code> and <code></code><code>__USE_GNU</code><code></code> and restrict the code to that case. </li></ul><p> So I have 2 hypothesis in mind: </p> <ul><li>you are not compiling the code with the same options as you did before: the rationale behind is that C++11 is now defining <code></code><code>&lt;cfenv&gt;</code><code></code> which automatically would avoid the definition of <code></code><code>BOOST_NO_FENV_H</code><code></code>, while it was defined before </li><li>for the cross compilation, more restrictions should be applied on how to check for the existence of <code></code><code>feenableexcept/fedisableexcept</code><code></code> (which means additional/other macros than <code></code><code>__GLIBC__</code><code></code> and <code></code><code>__USE_GNU</code><code></code>), but in that case I do not understand why it would have been working with boost 1.61 </li></ul><p> So ... would you check again with boost 1.61? Sorry to ask you that, but I am really lost there :-) </p> <p> To nail down further the cause of those issues, it would be even better if you could (still based on the assumption that it was working with boost 1.61): </p> <ul><li>check with the entire boost 1.61 </li><li>check with the latest boost develop but with boost.test 1.61 </li></ul><p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 16:47:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:51 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:51</guid> <description> <p> We can also iterate further: </p> <ul><li>you may tell me how to set up this environment from eg. Ubuntu or a docker image </li><li>you may also tell me the values of those macros: <a href="http://www.boost.org/doc/libs/1_63_0/doc/html/predef/reference.html#predef.reference.boost_lib_library_macros.boost_lib_c_gnu">BOOST_LIB_C_GNU</a> as well as <a href="http://www.boost.org/doc/libs/1_63_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.boost_informational_macros">BOOST_GCC</a> </li></ul><p> Thanks again, Raffi </p> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 18:12:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:52 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:52</guid> <description> <p> I figured something out! </p> <p> It is working for version 1.61.0 (and 1.62.0) for this toolchain because Buildroot is patching config/platform/linux.hpp: </p> <pre class="wiki">+// uClibc has no support for fenv.h, and also a few architectures +// don't have fenv.h support at all (or incomplete support) even with +// glibc. + +// +#if defined(__UCLIBC__) || defined(__nios2__) || defined(__microblaze__) +# define BOOST_NO_FENV_H +#endif </pre><p> Now let me explain my confusion about <code>BOOST_NO_FENV_H</code>: </p> <p> When I wrote <code>BOOST_NO_FENV_H</code> <strong>is</strong> defined it was because of I was building a patched "in-tree" boost. When I wrote <code>BOOST_NO_FENV_H</code> is <strong>not</strong> defined it was because of I was building an unpatched "out-of-tree" version of boost. Note, Buildroot applies patches to in-tree packages, but does not apply the patches to out-of-tree packages. In this case, I was using the git clone for an out-of-tree build. Therefore, the git clone does not had the patch applied, and <code>BOOST_NO_FENV_H</code> was not set by the patch. May bad, sorry! </p> <p> In short, for an unpatched boost <code>BOOST_NO_FENV_H</code> is <strong>not</strong> defined for that toolchain. </p> <hr /> <p> Nevertheless, I did a git bisect (with the patch applied) for the test submodule: bisect says that eec86d1fbe68aea190ce05a080d20e1569fb82a9 (trac 11756: fix usage of floating point exception macros) is the bad commit. That means: when <code>BOOST_NO_FENV_H</code> is set because of the patch, boost compiles before this commit, but not after. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 18:29:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:53 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:53</guid> <description> <p> Thanks again for the quick feedback. So the problem does not seem to be totally related to boost.test :) </p> <p> I believe that the last version of the branch <code></code><code>topic/11756-non-standards-fpexception-intel</code><code></code> should work fine with <code></code><code>BOOST_NO_FENV_H</code><code></code>. I kindly ask you to checkout this version (<code></code><code>6f0d88ca9db00b449a795afa3218b815fe8c01b0</code><code></code>) and test with <code></code><code>BOOST_NO_FENV_H</code><code></code> set. </p> <p> For the definition of <code></code><code>BOOST_NO_FENV_H</code><code></code>, we can </p> <ul><li>ask to boost.build </li><li>and/or mimic the behaviour of the patching inside boost.test directly, not directly by setting the <code></code><code>BOOST_NO_FENV_H</code><code></code> but by indicating the lack of those GNU extensions via the non definition of the macro <code></code><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code><code></code> </li></ul> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 18:59:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:54 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:54</guid> <description> <p> Yes, with <code>BOOST_NO_FENV_H</code> set by the patch, version 1.63.0 of boost and the test module updated to commit 6f0d88ca9db00b449a795afa3218b815fe8c01b0 compiles for that toolchain. </p> <p> I would say it is best to check for fenv.h, instead of depending on macro definition. But I do not know the boost build system... </p> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 18:59:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:54 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:54</guid> <description> <p> Yes, with <code>BOOST_NO_FENV_H</code> set by the patch, version 1.63.0 of boost and the test module updated to commit 6f0d88ca9db00b449a795afa3218b815fe8c01b0 compiles for that toolchain. </p> <p> I would say it is best to check for fenv.h, instead of depending on macro definition. But I do not know the boost build system... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 11 Mar 2017 19:40:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:55 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:55</guid> <description> <p> The thing is that <code></code><code>fenv.h</code><code></code> is there, and hence this is normal that <code></code><code>BOOST_NO_FENV_H</code><code></code> is not defined. What is not normal is that <code></code><code>__GLIBC__</code><code></code> and <code></code><code>__USE_GNU</code><code></code> are also defined, which should not be the case (this is ulibC after all). </p> <p> So my suggestion is not to define <code></code><code>BOOST_NO_FENV_H</code><code></code>, but to not define <code></code><code>BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__</code><code></code> for the ulibC (this is the purpose of the macro). </p> <p> I wanted to know if something outside of boost.test has changed, and this is indeed the case (boost.build or config). </p> <p> But maybe I am missing sthg? </p> </description> <category>Ticket</category> </item> <item> <author>Jörg Krause <joerg.krause@…></author> <pubDate>Sat, 11 Mar 2017 20:01:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:56 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:56</guid> <description> <p> For whatever reasons uclibc defines both <code>__UCLIBC__</code> <strong>and</strong> <code>__GLIBC__</code>, whereas musl does not define any such macro, e.g. there is no <code>__MUSL__</code> and will never be. </p> <p> This is the commit log from the fenv.h patch used in Buildroot (I cannot add links here): </p> <pre class="wiki">The boost build system does not properly test whether fenv.h is available, and if it is, if it supports all the features used by Boost. This causes build failures with uClibc (reported upstream at https://svn.boost.org/trac/boost/ticket/11756) but also with glibc on specific architectures that don't have a full fenv implementation, such as NIOSII or Microblaze. To address this, we forcefully disable the use of fenv support in the affected configurations. </pre><p> I am afraid I am not much of help here. From my point of view, it should be checked if fenv.h is available, and then check for the GLIBC extensions. </p> </description> <category>Ticket</category> </item> <item> <author>André Draszik <git@…></author> <pubDate>Sun, 12 Mar 2017 08:03:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:57 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:57</guid> <description> <p> I think it all makes sense, just re-iterating <a class="ticket" href="https://svn.boost.org/trac10/ticket/11756#comment:12" title="Comment 12">comment 12</a>: </p> <blockquote class="citation"> <p> <em>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.</em> </p> <p> So correct usage requires a triple check: </p> <p> 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 <em>any</em> 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. [...] </p> </blockquote> <p> <a class="ticket" href="https://svn.boost.org/trac10/ticket/11756#comment:56" title="Comment 56">comment 56</a>: </p> <blockquote class="citation"> <p> From my point of view, it should be checked if fenv.h is available, and then check for the GLIBC extensions. </p> </blockquote> <p> So this is what is being done now. The fact that uclibc defines <code>__GLIBC__</code> and <code>__USE_GNU</code> without implementing the glibc extensions (on all arches it supports?) is the problem here. </p> <p> Just adding a check for <code>__UCLIBC__</code> into boost.test to guard usage of feenableexcept() etc. would be right <strong>if</strong> uclibc didn't implement them at all. I don't know if it does or not. I think it might for some arches? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 12 Mar 2017 10:14:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:58 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:58</guid> <description> <p> I also agree that the problem seems to rather be on the side of uLibC right now. So what I suggest is to mimic the behavior of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11756#comment:52" title="#11756: Patches: boost.Test: non standards compliant use of FE_* macros (unable to ... (closed: fixed)">#comment:52</a> by adding this </p> <pre class="wiki">// ... #if !defined(BOOST_NO_FENV_H) &amp;&amp; !defined(BOOST_CLANG) &amp;&amp; \ defined(__GLIBC__) &amp;&amp; defined(__USE_GNU) &amp;&amp; \ !(defined(__UCLIBC__) || defined(__nios2__) || defined(__microblaze__)) #define BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__ #endif // ... </pre><p> like it was done for boost 1.61. This has the advantage to not define <code></code><code>BOOST_NO_FENV_H</code><code></code> and focus the macro on the glibC extensions availability. </p> <p> Can you quickly test the branch <code></code><code>topic/11756-ulibc-disabling</code><code></code> ? </p> <p> Thanks </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jörg Krause</dc:creator> <pubDate>Sun, 12 Mar 2017 15:06:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:59 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:59</guid> <description> <p> Unfortunately, trac does not accept my posting because it thinks it is spam. Now, my comment is lost... </p> <p> So, I rewrite... </p> <p> uClibc does have a fenv.h in the system directory path. It installs fenv.h to the sysroot path if it was configured with UCLIBC_HAS_FENV. However, this feature is only implemented for i386. </p> <p> So, uClibc does have fenv.h, but does not necessarily implements and installs it. Furthermore, the following macros are defined: </p> <ul><li><code>BOOST_NO_FENV_H</code> is not defined </li><li><code>__UCLIBC__</code> is defined </li><li><code>__USE_GNU</code> is defined </li><li><code>__GLIBC__</code> is defined </li></ul><p> However, I think it is better to check with a test program if certain features are available, instead of relying on a bunch of macros: </p> <p> 1) check if <code>feclearexcept()</code> is available =&gt; HAS_FENV 2) check for the macros =&gt; HAS_FENV_FE_xxx 3) check for the GNU extension =&gt; HAS_FENV_GNU </p> <p> However, I am not familiar with the Boost build system. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 12 Mar 2017 15:22:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:60 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:60</guid> <description> <p> Would you please quickly try the branch <code></code><code>topic/11756-ulibc-disabling</code><code></code> and let me know if that works for you? </p> <p> Again, uclibC should not define <code></code><code>__USE_GNU</code><code></code> and/or <code></code><code>__GLIBC__</code><code></code> from my understanding. But it is more the level of the workaround what we are doing now. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jörg Krause</dc:creator> <pubDate>Sun, 12 Mar 2017 15:27:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:61 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:61</guid> <description> <p> Sorry, that part got lost because I had to rewrite: I've checked the branch without any patches from Buildroot and it compiles successfully. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 18 Mar 2017 13:35:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11756#comment:62 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11756#comment:62</guid> <description> <p> Merged to develop rev <code></code><code>e4db0d6d2c900807f8aa68406469876b7ef78262</code><code></code> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 19 Mar 2017 22:01:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11756#comment:63 https://svn.boost.org/trac10/ticket/11756#comment:63 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged to master, rev <code></code><code>af78890325948bed598361966fa7f5fc9560c41d</code><code></code>. Closing as fixed, until next time :) </p> Ticket