Skip to contentSkip to conversation

grub: disable build on armv7ve/a with hardfp

PATCH In review [email protected] 2 participants 2 messages Oct 19, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 grub: disable build on armv7ve/a with hardfp

From: Mingli Yu <[email protected]>

The commit(75dbdea940 grub: Allow build on armv7ve/a with softfp) enable build on armv7ve/a with softfp, but it acutally enable build on armv7ve/a with hardfp altogether and result in below build failure:

 | checking for compile options to get strict alignment... -mno-unaligned-access
 | checking if compiler generates unaligned accesses... no
 | checking if C symbols get an underscore after compilation... no
 | checking whether target compiler is working... no
 | configure: error: cannot compile for the target

So update the check to disable build on armv7ve/a with hardfp.

---
 meta/recipes-bsp/grub/grub2.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-bsp/grub/grub2.inc +2 -2
index 2545b99b6a..7161c4560b 100644
@@ -50,8 +50,8 @@ COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
 # Grub doesn't support hard float toolchain and won't be able to forcefully
 # disable it on some of the target CPUs. See 'configure.ac' for
 # supported/unsupported CPUs in hardfp.
-COMPATIBLE_HOST:armv7a = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
-COMPATIBLE_HOST:armv7ve = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
+COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
+COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
 
 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
Signature · 1 line
2.25.1
#2 lore raw

Hi,

Quoted 28 lines · Mingli

From: Mingli Yu <[email protected]>

The commit(75dbdea940 grub: Allow build on armv7ve/a with softfp) enable build on armv7ve/a with softfp, but it acutally enable build on armv7ve/a with hardfp altogether and result in below build failure:
| checking for compile options to get strict alignment...
-mno-unaligned-access

 | checking if compiler generates unaligned accesses... no
 | checking if C symbols get an underscore after compilation... no
 | checking whether target compiler is working... no
 | configure: error: cannot compile for the target

So update the check to disable build on armv7ve/a with hardfp.

---
 meta/recipes-bsp/grub/grub2.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-bsp/grub/grub2.inc +0 -0
index 2545b99b6a..7161c4560b 100644
@@ -50,8 +50,8 @@ COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
 # Grub doesn't support hard float toolchain and won't be able to

forcefully

Quoted 13 lines
 # disable it on some of the target CPUs. See 'configure.ac' for
 # supported/unsupported CPUs in hardfp.
-COMPATIBLE_HOST:armv7a = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') ==
'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
-COMPATIBLE_HOST:armv7ve = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') ==
'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
+COMPATIBLE_HOST:armv7a = "${@'null' if
bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else
d.getVar('GRUB_COMPATIBLE_HOST')}"
+COMPATIBLE_HOST:armv7ve = "${@'null' if
bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else
d.getVar('GRUB_COMPATIBLE_HOST')}"

Sounds like a typo on my side. I'll check my testing as I'm curious how I've managed to miss this. Thanks for fixing it!

Andrei