Boost C++ Libraries: Ticket #12114: boost context does not preserve fpu context on ios arm64 devices https://svn.boost.org/trac10/ticket/12114 <p> The problem with floating point calculations was observed when trying to use boost context on arm64 ios devices. It looks like, in certain conditions floating point arithmetic stops working properly. </p> <p> It is hard to provide exact way how to reproduce the issue, but after investigation it has been found out that <span class="underline">VFP_FP</span> is not defined by clang++ when the following command is executed: </p> <blockquote> <p> "<a class="missing wiki">/Applications/Xcode</a>.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -DBUNDLE_VERSION=1.60.0.yandex.4 -DYANDEX_BOOST -DMOBILE_BUILD -O2 -Wno-unused-variable -Wno-unknown-pragmas -Wno-reorder -Wno-unused-local-typedefs -stdlib=libc++ -fobjc-arc -fvisibility=hidden -Qunused-arguments -lc++ -miphoneos-version-min=6.1 -isysroot <a class="missing wiki">/Applications/Xcode</a>.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -isystem <a class="missing wiki">/Applications/Xcode</a>.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/include -arch arm64 -fembed-bitcode -O2 -arch arm64 -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_DISABLE_ASSERTS -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/6a8dcaa993b5623b8882ae19f514636b/asm/jump_arm64_aapcs_macho_gas.o" "libs/context/src/asm/jump_arm64_aapcs_macho_gas.S" </p> </blockquote> <p> As a result floating point context is not stored/restored and eventually leads to some mysterious issues. </p> <p> The problem can be solved by defining <span class="underline">VFP_FP</span> directly, however, better way to fix it is to remove #if (defined(<span class="underline">VFP_FP</span>) &amp;&amp; !defined(<span class="underline">SOFTFP</span>)) from jump_arm64_aapcs_macho_gas.S. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12114 Trac 1.4.3 olli Wed, 06 Apr 2016 06:38:56 GMT <link>https://svn.boost.org/trac10/ticket/12114#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:1</guid> <description> <p> hmm - preserving FPU is removed in version 1.61. Could you check branch develop? </p> </description> <category>Ticket</category> </item> <item> <author>ykirpichev@…</author> <pubDate>Wed, 06 Apr 2016 13:45:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12114#comment:1" title="Comment 1">olli</a>: </p> <blockquote class="citation"> <p> hmm - preserving FPU is removed in version 1.61. Could you check branch develop? </p> </blockquote> <p> Yes, I saw it, that is why I'm wondering why it is removed in version 1.61? It will break usage of floating point in coroutines on arm64 ios devices. </p> </description> <category>Ticket</category> </item> <item> <author>ykirpichev@…</author> <pubDate>Wed, 06 Apr 2016 13:45:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12114#comment:1" title="Comment 1">olli</a>: </p> <blockquote class="citation"> <p> hmm - preserving FPU is removed in version 1.61. Could you check branch develop? </p> </blockquote> <p> Yes, I saw it, that is why I'm wondering why it is removed in version 1.61? It will break usage of floating point in coroutines on arm64 ios devices. </p> </description> <category>Ticket</category> </item> <item> <author>ykirpichev@…</author> <pubDate>Wed, 06 Apr 2016 13:45:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12114#comment:1" title="Comment 1">olli</a>: </p> <blockquote class="citation"> <p> hmm - preserving FPU is removed in version 1.61. Could you check branch develop? </p> </blockquote> <p> Yes, I saw it, that is why I'm wondering why it is removed in version 1.61? It will break usage of floating point in coroutines on arm64 ios devices. </p> </description> <category>Ticket</category> </item> <item> <author>Yury Kirpichev <ykirpichev@…></author> <pubDate>Wed, 06 Apr 2016 13:58:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:3</guid> <description> <p> Sorry, I added previous comment several time by accident. Do you want me to try newer boost version and check whether problem exist? I can relatively easily check version 1.61 beta. Is it ok? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Wed, 27 Apr 2016 08:09:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12114#comment:3" title="Comment 3">Yury Kirpichev &lt;ykirpichev@…&gt;</a>: </p> <blockquote class="citation"> <p> Sorry, I added previous comment several time by accident. Do you want me to try newer boost version and check whether problem exist? I can relatively easily check version 1.61 beta. Is it ok? </p> </blockquote> <p> would be nice, if you could test 1.61 on this platform </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Sun, 27 Nov 2016 11:42:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12114#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12114#comment:5</guid> <description> <p> fixed in commit f3d3ca3ab8b747c3efde7d1b26602be1f01eafbf (branch develop). could you verify that the fix works on IOS, please? ARM64 + ELF (Linux) seams to work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Sun, 27 Nov 2016 12:44:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12114#comment:6 https://svn.boost.org/trac10/ticket/12114#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket