build icon indicating copy to clipboard operation
build copied to clipboard

[cross-build] Simple C++/asm files are not built correctly

Open theodelrieu opened this issue 7 years ago • 1 comments

Hello,

I opened an issue on Boost.Context a while ago, and I'm currently trying to solve it "properly".

First, here is the small project I created to reproduce the issue: boost_build_bug.zip

One of the problems is that the cross-compiling flags are not given to the compiler (I'm on macOS, and target iOS arm64/armv8):

$ b2 toolset=clang architecture=arm address-model=64 target-os=iphone asm -d+2

Here is the compiler invocation:

"clang++" -x assembler-with-cpp -fPIC -O0 -fno-inline -Wall -g -c -o "bin/clang-darwin-10.0/debug/address-model-64/architecture-arm/target-os-iphone/make_arm64_aapcs_macho_gas.o" "make_arm64_aapcs_macho_gas.S"

I would expect at least the -arch arm64 flag. Trying to build the cpp target is no different in this case (this behaviour looks global, not specific to assembly files).

I've read the user manual, and the cross-building section mentions the use of user-config.jam. Is this the only way to support cross-building?

I do not mind writing a user-config.jam, but I find it confusing that there is no mapping between configuration flags (e.g. architecture + address-model) and compiler/linker flags (-arch arm64 in this case).

I'm a Boost.Build novice though, so I'm likely to have missed the point.

theodelrieu avatar Nov 09 '18 09:11 theodelrieu

Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2 This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.

stale[bot] avatar Jun 26 '21 03:06 stale[bot]