diff options
| author | Khem Raj <raj.khem@gmail.com> | 2024-01-26 15:31:41 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-02 10:38:28 +0000 |
| commit | 04eac1f2b67eac5f892a9e0f8fcfe54849923af5 (patch) | |
| tree | 877b8431d8ba788beeef9e82b22a498f011908f5 /meta/conf/machine/include/arm/armv8-m | |
| parent | 069d2dfd86e8ba6cc6bcf21d908d87319ac1fcde (diff) | |
| download | poky-04eac1f2b67eac5f892a9e0f8fcfe54849923af5.tar.gz | |
armv8/armv9: Avoid using -march when -mcpu is chosen
Current include logic goes into generic arm v8/v9 architecture tunes and
adds corresponding -march option after synthesizing it from various tune
fragments, this is fine for a machine which is using armv8/armv9 based
tunes but cortex tunes are intentionally using -mcpu option based on
selected tune value. So when cortex based default tune is selected for a
machine, it will add both -mcpu and -march to the compiler commandline
which can result in invalid combinations for this pair in gcc's own
logic. This can then result in compiler warnings/errors reporting this
e.g.
aarch64-yoe-linux-gcc -mcpu=cortex-a72.cortex-a53 -march=armv8-a+crc+crypto -mbranch-protection=standard
...
cc1: error: switch '-mcpu=cortex-a72.cortex-a53' conflicts with '-march=armv8-a+crc+crypto' switch and resulted in options '+crc+crypto' being added [-Werror]
This is seen in lot of configure test results in glibc 2.39 and the
warning is promoted to errors by gcc in some of these checks especially
with gcc-14, the logs also show it as warning in other places in
configure checks.
mcpu option will compute relevant march implicitly as it specifies a cpu
implementation and this will be the right value to use, therefore do not
specify -march when -mcpu is already describing the cpu.
(From OE-Core rev: e64f0c1b6ac5d598a79a21de5f3060f83cb9523e)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@arm.com>
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/machine/include/arm/armv8-m')
3 files changed, 6 insertions, 3 deletions
diff --git a/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc b/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc index 25780bc080..e83e0ba68a 100644 --- a/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc +++ b/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc | |||
| @@ -10,5 +10,6 @@ require conf/machine/include/arm/arch-armv8m-base.inc | |||
| 10 | 10 | ||
| 11 | AVAILTUNES += "cortexm23" | 11 | AVAILTUNES += "cortexm23" |
| 12 | ARMPKGARCH:tune-cortexm23 = "cortexm23" | 12 | ARMPKGARCH:tune-cortexm23 = "cortexm23" |
| 13 | TUNE_FEATURES:tune-cortexm23 = "${TUNE_FEATURES:tune-armv8m-base} cortexm23" | 13 | # We do not want -march since -mcpu is added above to cover for it |
| 14 | TUNE_FEATURES:tune-cortexm23 = "cortexm23" | ||
| 14 | PACKAGE_EXTRA_ARCHS:tune-cortexm23 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-base} cortexm23" | 15 | PACKAGE_EXTRA_ARCHS:tune-cortexm23 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-base} cortexm23" |
diff --git a/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc b/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc index 04d1fe2bde..606900d7a2 100644 --- a/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc +++ b/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc | |||
| @@ -13,5 +13,6 @@ require conf/machine/include/arm/arch-armv8m-main.inc | |||
| 13 | # be fixed in GCC | 13 | # be fixed in GCC |
| 14 | AVAILTUNES += "cortexm33" | 14 | AVAILTUNES += "cortexm33" |
| 15 | ARMPKGARCH:tune-cortexm33 = "cortexm33" | 15 | ARMPKGARCH:tune-cortexm33 = "cortexm33" |
| 16 | TUNE_FEATURES:tune-cortexm33 = "${TUNE_FEATURES:tune-armv8m-maine-vfpv5spd16} cortexm33" | 16 | # We do not want -march since -mcpu is added above to cover for it |
| 17 | TUNE_FEATURES:tune-cortexm33 = "vfpv5spd16 dsp cortexm33" | ||
| 17 | PACKAGE_EXTRA_ARCHS:tune-cortexm33 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm33e-fpv5-spd16" | 18 | PACKAGE_EXTRA_ARCHS:tune-cortexm33 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm33e-fpv5-spd16" |
diff --git a/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc b/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc index 60e978facd..4394adab0b 100644 --- a/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc +++ b/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc | |||
| @@ -13,5 +13,6 @@ require conf/machine/include/arm/arch-armv8m-main.inc | |||
| 13 | # be fixed in GCC | 13 | # be fixed in GCC |
| 14 | AVAILTUNES += "cortexm35p" | 14 | AVAILTUNES += "cortexm35p" |
| 15 | ARMPKGARCH:tune-cortexm35p = "cortexm35p" | 15 | ARMPKGARCH:tune-cortexm35p = "cortexm35p" |
| 16 | TUNE_FEATURES:tune-cortexm35p = "${TUNE_FEATURES:tune-armv8m-maine-vfpv5spd16} cortexm35p" | 16 | # We do not want -march since -mcpu is added above to cover for it |
| 17 | TUNE_FEATURES:tune-cortexm35p = "vfpv5spd16 dsp cortexm35p" | ||
| 17 | PACKAGE_EXTRA_ARCHS:tune-cortexm35p = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm35pe-fpv5-spd16" | 18 | PACKAGE_EXTRA_ARCHS:tune-cortexm35p = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm35pe-fpv5-spd16" |
