-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Description
Boost::context build fails for armv7 target with the following error:
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
This is because the assembler command line does not respect the architecture flags specified in the profile. See:
@property
def _build_flags(self):
flags = []
if self._build_cross_flags:
flags.append(f'compileflags="{" ".join(self._build_cross_flags)}"')b2 does not pass cflags or cxxflags to the assembler, only compileflags. These need to contain the -mfpu and -march flags if they are passed in the profile. Whilst the cross compilation toolchain may have suitable defaults, these are not under the control of the profile.
Package and Environment Details
- Package Name/Version: boost/1.89.0
- Operating System+version: Arch Linux 6.17.5-arch1-1
- Compiler+version: GCC 11.3
- Conan version: conan 2.21.0
Conan profile
[settings]
os=Linux
arch=armv7hf
compiler=gcc
compiler.cppstd=gnu17
compiler.version=12
compiler.libcxx=libstdc++11
build_type=Release
{% set triple="arm-rdk-linux-gnueabi" %}
{% set toolchain_bin=os.path.join(os.getenv("SDK_BIN"), triple) %}
{% set toolchain_prefix=os.path.join(toolchain_bin, triple) %}
[conf]
tools.build:cflags=["-march=armv7-a", "-mthumb", "-mfpu=neon", "-mfloat-abi=hard"]
tools.build:compiler_executables={ "c": "{{ toolchain_prefix }}-gcc", "cpp": "{{ toolchain_prefix }}-g++" }
tools.build:verbosity=verbose
[options]
boost/:without_atomic=True
boost/:without_charconv=True
boost/:without_chrono=True
boost/:without_cobalt=True
boost/:without_container=True
boost/:without_context=False
boost/:without_contract=True
boost/:without_coroutine=True
boost/:without_date_time=True
boost/:without_exception=True
boost/:without_fiber=True
boost/:without_filesystem=True
boost/:without_graph=True
boost/:without_graph_parallel=True
boost/:without_iostreams=True
boost/:without_json=True
boost/:without_locale=True
boost/:without_log=True
boost/:without_math=True
boost/:without_mpi=True
boost/:without_nowide=True
boost/:without_process=True
boost/:without_program_options=True
boost/:without_python=True
boost/:without_random=True
boost/:without_regex=True
boost/:without_serialization=True
boost/:without_stacktrace=True
boost/:without_system=True
boost/:without_test=True
boost/:without_thread=True
boost/:without_timer=True
boost/:without_type_erasure=True
boost/:without_url=True
boost/:without_wave=True
boost/:without_cobalt=True
Steps to reproduce
To reproduce the issue, a cross-compilation toolchain capable of compiling for a hard-float abi but where soft-float is the default must be used. I attempted to reproduce using the toolchains from dockcross but these pass default -mfpu flags to the assembler command line so the issue is not seen.
Unfortunately the toolchain I am using is not publicly available.