config/arm: split -march into arch and features
authorJuraj Linkeš <juraj.linkes@pantheon.tech>
Tue, 17 Aug 2021 10:56:49 +0000 (12:56 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 16 Sep 2021 16:12:46 +0000 (18:12 +0200)
commit95e0f23022a36d5d66957af3da7f2925b44a9a80
treed3c8b20b17e901f689714210d0fc7ec2dc33a404
parent328720c594f235aa44c78fe360e8e6f31b5e989f
config/arm: split -march into arch and features

Older compilers may not support all arch versions and all features that
the target SoC supports, in which case it's better to figure out the
highest arch version and features that the compiler supports.
Implement a way to achieve this:
1. Find the highest arch version that the compiler supports,
keeping in mind the SoC arch version we're building.
For example, if the SoC arch version is arm8.2-a,
but the compiler only supports arm8.1-a, use arm8.1-a.
On the other hand, if the compiler supports arm8.3-a (or higher),
use armv8.2-a.
2. With the architecture version locked, iterate over SoC features and
use all that are supported.

In all cases, emit a warning if there's something unsupported by the
compiler.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
config/arm/meson.build