Closed Kojoley closed 2 years ago
Support for multiarch/cross-comp. must be implemented inside boost.build.
Cross compilation is implemented for some toolsets in B2 already, the mentioned code above which is not compatible with cross compilation is in Context.
Boost.Build does not detect the ABI and BIANRY_FORMAT for which the code has to be compiled (I think there is no proper way to do it).
The only way is that Boost.Context guesses the ABI and BINARY_FORMAT depending on the platform it is build on.
For cross compilation you can override the properties at command line - for instance abi=aapcs binary_format=elf
Values for
binary-format
andabi
are calculated using information about host, not the target: https://github.com/boostorg/context/blob/83f998828c377ebd27d32455154f1f9cebf09b93/build/Jamfile.v2#L57-L65 https://github.com/boostorg/context/blob/83f998828c377ebd27d32455154f1f9cebf09b93/build/Jamfile.v2#L77-L86The actual user was hit by this https://github.com/bfgroup/b2/issues/105#issuecomment-996115240
The logic also will yield incorrect results where a compiler is producing multiarch binaries, for example on apple clang it should at the same time deduce both
x86
andarm
for<architecture>
, andsysv
andaapcs
for<abi>
.