[Context] Boost.Context ARM64 support
Hi, We currently use boost context on iOS, and as you may know Apple is making it mandatory for application to bundle a 64bits version starting February 1 (https://developer.apple.com/news/?id=10202014a). It is thus crucial for us - and anyone using Boost Context on iOS - to get a working ARM64 backend working. Looking at github, I see code has been contributed, but the build system still bounces to unsupported.hh when building with clang for ARM64. Is that code acutally working but not-yet-released, or is it still incomplete ? In the latter case, is anyone still working on it and do we have any rough idea of the delay before a working version get pushed ? Happy to read some ARM64 doc and contribute if it's in a stale state, of course. Cheers, -- Quentin "mefyl" Hocquet CTO @ infinit.io
the code at github (ranch develop) should work (no unsupported.cpp in
Jamfile.v2)
how do you try to compile the code (cmd line)?
2015-01-09 14:49 GMT+01:00 mefyl
Hi,
We currently use boost context on iOS, and as you may know Apple is making it mandatory for application to bundle a 64bits version starting February 1 (https://developer.apple.com/news/?id=10202014a). It is thus crucial for us - and anyone using Boost Context on iOS - to get a working ARM64 backend working. Looking at github, I see code has been contributed, but the build system still bounces to unsupported.hh when building with clang for ARM64. Is that code acutally working but not-yet-released, or is it still incomplete ? In the latter case, is anyone still working on it and do we have any rough idea of the delay before a working version get pushed ?
Happy to read some ARM64 doc and contribute if it's in a stale state, of course.
Cheers,
-- Quentin "mefyl" Hocquet CTO @ infinit.io _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Friday 09 January 2015 17:42:16 Oliver Kowalke wrote:
the code at github (ranch develop) should work (no unsupported.cpp in Jamfile.v2) how do you try to compile the code (cmd line)?
That's fantastic news ! I have the unsupported issue using: ./b2 -q --user-config=user-config.jam link=static architecture=arm macosx-version=iphone-8.0 address-model=64 My user-config.jam: using darwin : : clang++ -arch arm64 : <striper> <root>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer : <architecture>arm ; Result: "clang++" "-arch" "arm64" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop\ er/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_T\ HREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/darwin-4.2.1/release/address-model-64/architecture-arm/link-static/macosx-version-iphone-8.\ 0/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp" Since you mentioned it was supposed to work, I tried fiddling with options and managed to make it pick the abi-aapcs/address-model-64 files, but compilation fails because "-arch arm" gets passed to clang instead of "-arch arm64": ./b2 -q --user-config=user-config.jam link=static target-os=iphone architecture=arm macosx-version=iphone-8.0 abi=aapcs address-model=64 My user-config.jam: using darwin : : clang++ -arch arm64 : <striper> <root>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer : <architecture>arm <target-os>iphone ; Result: "clang++" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -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/darwin-4.2.1/release/abi-aapcs/address-model-64/architecture-arm/link-static/macosx-version-iphone-8.0/runtime-link-static/target-os-iphone/threading-multi/asm/make_arm64_aapcs_macho_gas.o" "libs/context/src/asm/make_arm64_aapcs_macho_gas.S" Removing the additional "-arch arm" fixes it. I'm probably not using bjam the right way, sorry about that. Thanks for you help, -- Quentin "mefyl" Hocquet CTO @ infinit.io
2015-01-12 13:59 GMT+01:00 mefyl
"clang++" "-arch" "arm64" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop\ er/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_T\ HREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/darwin-4.2.1/release/address-model-64/architecture-arm/link-static/macosx-version-iphone-8.\ 0/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp"
libs/context/src/unsupported.cpp should not be selected - please take care that you use the version from github (branch develop). Please note that you need to specify address-model, architecture, api and binary-format at cmd line if you do cross-compiling.
On Monday 12 January 2015 14:15:08 Oliver Kowalke wrote:
"clang++" "-arch" "arm64" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Dev elop\ er/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_T\ HREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/darwin-4.2.1/release/address-model-64/architect ure-arm/link-static/macosx-version-iphone-8.\ 0/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp"
2015-01-12 13:59 GMT+01:00 mefyl
: libs/context/src/unsupported.cpp should not be selected - please take care that you use the version from github (branch develop). Please note that you need to specify address-model, architecture, api and binary-format at cmd line if you do cross-compiling.
I had missed the "branch develop" part; it's indeed fixed there and works like a charm. Sorry. Thanks for your help ! -- Quentin "mefyl" Hocquet CTO @ infinit.io
On Monday 12 January 2015 15:19:55 mefyl wrote:
On Monday 12 January 2015 14:15:08 Oliver Kowalke wrote:
2015-01-12 13:59 GMT+01:00 mefyl
: "clang++" "-arch" "arm64" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/D ev elop\ er/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_T\ HREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/darwin-4.2.1/release/address-model-64/archite ct ure-arm/link-static/macosx-version-iphone-8.\ 0/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp"
libs/context/src/unsupported.cpp should not be selected - please take care that you use the version from github (branch develop). Please note that you need to specify address-model, architecture, api and binary-format at cmd line if you do cross-compiling.
I had missed the "branch develop" part; it's indeed fixed there and works like a charm. Sorry.
My bad, it actually built for 32 bits. Here's what I have now, starting from scratch, specifying address-model, architecture, abi and binary-format: Branch develop (boost: b991885, context: fae49e0) $ ./bootstrap.sh --with-libraries=context [...] $ ./b2 toolset=clang link=static runtime-link=static --layout=tagged --prefix=/tmp architecture=arm abi=aapcs address-model=64 binary-format=mach-o [...] clang-darwin.compile.asm bin.v2/libs/context/build/clang-darwin-4.2.1/release/abi-aapcs/address-model-64/architecture-arm/link-static/runtime-link-static/threading-multi/asm/make_arm64_aapcs_macho_gas.o libs/context/src/asm/make_arm64_aapcs_macho_gas.S:54:21: error: unexpected token in argument list ; shift address in x0 (allocated stack) to lower 16 byte boundary [ ... many ASM errors ... ] "clang++" -x assembler-with-cpp -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CONTEXT_SOURCE -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/clang-darwin-4.2.1/release/abi-aapcs/address-model-64/architecture-arm/link-static/runtime-link-static/threading-multi/asm/make_arm64_aapcs_macho_gas.o" "libs/context/src/asm/make_arm64_aapcs_macho_gas.S" Running that exact compilation adding "-arch arm64" fixes it. -- Quentin "mefyl" Hocquet CTO @ infinit.io
On Monday 12 January 2015 17:37:44 Oliver Kowalke wrote:
2015-01-12 16:05 GMT+01:00 mefyl
: Running that exact compilation adding "-arch arm64" fixes it.
hmm - seams to be a issue of boost.build if option -arch gets the wrong value
For the record, this was indeed a boost.build issue fixable on develop with this patch: diff --git a/src/tools/clang-darwin.jam b/src/tools/clang-darwin.jam index 51e5fad..2976030 100644 --- a/src/tools/clang-darwin.jam +++ b/src/tools/clang-darwin.jam @@ -72,6 +72,8 @@ rule init ( version ? : command * : options * ) SPACE = " " ; +flags clang-darwin OPTIONS <architecture>arm <address-model>64 : -arch arm64 ; + flags clang-darwin.compile OPTIONS <cflags> ; flags clang-darwin.compile.c++ OPTIONS <cxxflags> ; # flags clang-darwin.compile INCLUDES <include> ; Cheers, -- Quentin "mefyl" Hocquet CTO @ infinit.io
participants (2)
-
mefyl
-
Oliver Kowalke