#10742 closed Support Requests (fixed)
context library don't compile for iOS ARM
Reported by: | Owned by: | olli | |
---|---|---|---|
Milestone: | To Be Determined | Component: | context |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I'm trying to use boost::coroutine on iphone, but some compile time error occurs.
libs (random,regex,graph,random,chrono,thread,signals,filesystem,system,date_time) are ok.
Main error:
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-arch" "armv7" "-arch" "armv7s" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-std=c++11" "-stdlib=libc++" -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_CONTEXT_SOURCE -DNDEBUG -D_LITTLE_ENDIAN -I"." -c -o "iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/make_arm_aapcs_macho_gas.o" "libs/context/src/asm/make_arm_aapcs_macho_gas.S" ...failed darwin.compile.asm iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/make_arm_aapcs_macho_gas.o... darwin.compile.asm iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm_aapcs_macho_gas.o libs/context/src/asm/jump_arm_aapcs_macho_gas.S:94:11: error: invalid operand for instruction pop v1 ^ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-arch" "armv7" "-arch" "armv7s" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-std=c++11" "-stdlib=libc++" -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_CONTEXT_SOURCE -DNDEBUG -D_LITTLE_ENDIAN -I"." -c -o "iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm_aapcs_macho_gas.o" "libs/context/src/asm/jump_arm_aapcs_macho_gas.S" ...failed darwin.compile.asm iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm_aapcs_macho_gas.o...
Attachments (2)
Change History (14)
by , 8 years ago
Attachment: | build-iphone-stage.log added |
---|
by , 8 years ago
comment:1 by , 8 years ago
comment:2 by , 8 years ago
You specify address-model=32 at bjam's commandline - but in the output I see "arm64" (seems not to be correct for me). 64bit for ARM is not supported (might work but untested because lack of hardware).
Could you add following to build/Jamfile.v2?
ECHO "OS =" [ os.name ] ;
And tell me the value of 'OS'?
comment:3 by , 8 years ago
Sure.
$ ./bjam -j16 --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=/Users/ryan/Developer/build/src/boost_1_57_0/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=/Users/ryan/Developer/build/ios/prefix abi=aapcs binary-format=mach-o address-model=32 toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-8.1 define=_LITTLE_ENDIAN link=static stage OS = MACOSX
I specify address-model=32 because I see that boost::context Requirements says for cross-compiling I should specify target-os, abi, binary-format, architecture and address-model. Within or without address-model=32. The error will be same"
libs/context/src/asm/jump_arm_aapcs_macho_gas.S:94:11: error: invalid operand for instruction pop v1 ^
But if I ignore abi , binary-formant and address-model. Only architecture specified. Error will be 'platform not supported'
$ ./bjam -j16 --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=/Users/ryan/Developer/build/src/boost_1_57_0/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=/Users/ryan/Developer/build/ios/prefix toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-8.1 define=_LITTLE_ENDIAN link=static stage OS = MACOSX Performing configuration checks - 32-bit : yes (cached) - lockfree boost::atomic_flag : no (cached) - has_icu builds : no (cached) ...some thing ignore.... libs/context/src/unsupported.cpp:7:2: error: "platform not supported" #error "platform not supported" ^ 1 error generated.
comment:4 by , 8 years ago
unfortunately boost.build does not distinguish between Mac OS X an iOS (iphone) in 'os.name' - so you are forced to add the bjam-properties at command-line.
Could you check new version of boost.context? I've updated the missing curly brackets in the asm-file and tell me if it's working?!
follow-up: 6 comment:5 by , 8 years ago
you mean commit 8bc0c17489142f7f7fa698d7142e9085bc845092 on github ? It works. I have this tested on my iphone5s.
BTW. Will this support arm64 later ?
follow-up: 8 comment:6 by , 8 years ago
Replying to n3v3r54y10v3@…:
you mean commit 8bc0c17489142f7f7fa698d7142e9085bc845092 on github ? It works. I have this tested on my iphone5s.
thx
BTW. Will this support arm64 later ?
unfortunately no - the register size is different (4byte vsa 8byte on arm64). do you have access to an arm64 system and you like to test some code?
comment:7 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 9 comment:8 by , 8 years ago
Replying to olli:
Replying to n3v3r54y10v3@…:
you mean commit 8bc0c17489142f7f7fa698d7142e9085bc845092 on github ? It works. I have this tested on my iphone5s.
thx
BTW. Will this support arm64 later ?
unfortunately no - the register size is different (4byte vsa 8byte on arm64). do you have access to an arm64 system and you like to test some code?
Sure, I'm strongly glad to test this. The iphone5s use apple A7 processor and iphone6 use apple A8 processor, Both armv7s and arm64 supported. I don't know arm assembly but I can test your code on both of them.
comment:9 by , 8 years ago
Replying to n3v3r54y10v3@…:
Sure, I'm strongly glad to test this. The iphone5s use apple A7 processor and iphone6 use apple A8 processor, Both armv7s and arm64 supported. I don't know arm assembly but I can test your code on both of them.
fine - but you have to wait till I've finished the ARM64 version
comment:11 by , 8 years ago
Could you compile and test the sources from branch develop on ARM64/MACH-O (iPhone)? It might be that the exception handling will not work.
comment:12 by , 8 years ago
I'm so sorry that I didn't see you post since now. Got lots of of email addresses, and this one doesn't connect to my main box, I have fixed it. I cloned boost from github yesterday and saw your commits, this cannot compile correct.
ryan@T4F-MBP-13594: ~/code/boost master! $ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-std=c++11" "-stdlib=libc++" -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 -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 -D_LITTLE_ENDIAN -I"." -c -o "/Users/ryan/Developer/boost_build_for_cocos2d-x/iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-64/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm64_aapcs_macho_gas.o" "libs/context/src/asm/jump_arm64_aapcs_macho_gas.S" libs/context/src/asm/jump_arm64_aapcs_macho_gas.S:66:7: error: unexpected token at start of statement @ save LR as PC ^ libs/context/src/asm/jump_arm64_aapcs_macho_gas.S:67:11: error: vector register expected push {lr} ^ libs/context/src/asm/jump_arm64_aapcs_macho_gas.S:68:7: error: unexpected token at start of statement
we can compile after replace "-arch" "arm64" to "-arch" "armv7s" or "-arch" "arm", but that result not arm64 version.
more info
and attackment build.sh line number 175 missing http address, cause boost trac attachment should not contains links.