Closed brandonros closed 3 years ago
$ uname -a
Darwin Brandons-MacBook-Air.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64
boost.build ist the offical build tool. CMakeLists.txt generates the wrong file name because it selects the wrong ABI - it must be aapcs instead of sysv.
@pdimov Because you introduced cmake support, could you fix it please
@brandonros You should be able to work around this by setting BOOST_CONTEXT_ABI
manually to aapcs
, e.g. by using -DBOOST_CONTEXT_ABI=aapcs
on the command line.
@olk Ordinarily I wouldn't be able to, as I have no access to any ARM or MIPS machines, which is why the original autodetection logic only worked on Intel. However, I see that a pull request has added autodetection for BOOST_CONTEXT_ARCHITECTURE, so I should be able to copy that logic for BOOST_CONTEXT_ABI as well.
This should work: https://github.com/boostorg/context/commit/b996250074f23d87c599b88b43538176c9a369d9
I have no way to test it though. It copies the logic from build/Jamfile and uses the same approach as the architecture detection.
Note that the deadline for 1.78 beta is today, so if you want this to go there, you need to merge it to master soon (a few hours.)
Note that the deadline for 1.78 beta is today, so if you want this to go there, you need to merge it to master soon (a few hours.)
merged to master - ty
[ 12%] Built target boost_chrono
Consolidate compiler generated dependencies of target boost_container
[ 14%] Built target boost_container
Scanning dependencies of target boost_context
[ 15%] Building ASM object deps/boost/libs/context/CMakeFiles/boost_context.dir/src/asm/make_arm64_aapcs_macho_gas.S.o
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:59:21: error: unexpected token in argument list
; shift address in x0 (allocated stack) to lower 16 byte boundary
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:60:5: error: unknown use of instruction mnemonic without a size suffix
and x0, x0, ~0xF
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:62:21: error: unexpected token in argument list
; reserve space for context-data on context-stack
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:63:17: error: unknown token in expression
sub x0, x0, #0xb0
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:65:17: error: unexpected token in argument list
; third arg of make_fcontext() == address of context-function
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:66:21: error: unexpected token in argument list
; store address as a PC to jump in
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:67:13: error: brackets expression not supported on this target
str x2, [x0, #0xa0]
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:69:5: error: invalid instruction mnemonic 'adr'
adr x1, finish
^~~
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:71:20: error: unexpected token in argument list
; save address of finish as return-address for context-function
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:72:15: error: unexpected token in argument list
; will be entered after context-function returns (LR register)
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:73:13: error: brackets expression not supported on this target
str x1, [x0, #0x98]
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:75:5: error: unknown use of instruction mnemonic without a size suffix
ret lr ; return pointer to context-data (x0)
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:75:29: error: unexpected token in argument list
ret lr ; return pointer to context-data (x0)
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:78:17: error: unexpected token in argument list
; exit code is zero
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:79:13: error: unknown token in expression
mov x0, #0
^
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:80:7: error: invalid instruction mnemonic 'exit'
; exit application
^~~~
/Users/brandonros/Desktop/redis-j2534-rpc/deps/boost/libs/context/src/asm/make_arm64_aapcs_macho_gas.S:81:5: error: invalid instruction mnemonic 'bl'
bl __exit
^~
make[2]: *** [deps/boost/libs/context/CMakeFiles/boost_context.dir/src/asm/make_arm64_aapcs_macho_gas.S.o] Error 1
make[1]: *** [deps/boost/libs/context/CMakeFiles/boost_context.dir/all] Error 2
make: *** [all] Error 2
@pdimov
Does it work when you build Context using b2?
What's the entire output of the cmake configure phase with a clean build directory? Something seems to be wrong with the assembler, but it's not clear what.
Seams to me that the wrong assembler tool is selected because of comments are causing errors
Another thing to try is building with cmake --build . -v
or VERBOSE=1 make
so that the commands are displayed; this will show us which assembler is being used. Also, make sure you use the latest CMake, something might have been fixed in its assembler selection.
I was doing something dumb with CMAKE_OSX_ARCHITECTURES
. This is fixed, thank you both of you.
@brandonros I'm running into the same error when compiling for android for arm64-v8a
- do you happen to remember how you fixed this?