Modify

Ticket #12114 (closed Bugs: fixed)

Opened 11 months ago

Last modified 3 months ago

boost context does not preserve fpu context on ios arm64 devices

Reported by: ykirpichev@… Owned by: olli
Milestone: To Be Determined Component: context
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description

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.

It is hard to provide exact way how to reproduce the issue, but after investigation it has been found out that VFP_FP is not defined by clang++ when the following command is executed:

"/Applications/Xcode?.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 /Applications/Xcode?.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -isystem /Applications/Xcode?.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"

As a result floating point context is not stored/restored and eventually leads to some mysterious issues.

The problem can be solved by defining VFP_FP directly, however, better way to fix it is to remove #if (defined(VFP_FP) && !defined(SOFTFP)) from jump_arm64_aapcs_macho_gas.S.

Attachments

Change History

comment:1 follow-ups: ↓ 2 ↓ 2 ↓ 2 Changed 11 months ago by olli

hmm - preserving FPU is removed in version 1.61. Could you check branch develop?

comment:2 in reply to: ↑ 1 Changed 11 months ago by ykirpichev@…

Replying to olli:

hmm - preserving FPU is removed in version 1.61. Could you check branch develop?

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.

comment:2 in reply to: ↑ 1 Changed 11 months ago by ykirpichev@…

Replying to olli:

hmm - preserving FPU is removed in version 1.61. Could you check branch develop?

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.

comment:2 in reply to: ↑ 1 Changed 11 months ago by ykirpichev@…

Replying to olli:

hmm - preserving FPU is removed in version 1.61. Could you check branch develop?

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.

comment:3 follow-up: ↓ 4 Changed 11 months ago by Yury Kirpichev <ykirpichev@…>

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?

comment:4 in reply to: ↑ 3 Changed 10 months ago by olli

Replying to Yury Kirpichev <ykirpichev@…>:

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?

would be nice, if you could test 1.61 on this platform

comment:5 Changed 3 months ago by olli

fixed in commit f3d3ca3ab8b747c3efde7d1b26602be1f01eafbf (branch develop). could you verify that the fix works on IOS, please? ARM64 + ELF (Linux) seams to work.

Last edited 3 months ago by olli (previous) (diff)

comment:6 Changed 3 months ago by olli

  • Status changed from new to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.