All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] grub: Allow build on armv7ve/a with softfp
@ 2022-09-15 12:50 Andrei Gherzan
  2022-09-15 13:01 ` Andrei Gherzan
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Gherzan @ 2022-09-15 12:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: andrei, Andrei Gherzan

From: Andrei Gherzan <andrei.gherzan@huawei.com>

Grub tries to force the compilation in softfp mode for some known target
CPU. That is because it doesn't use floats or doubles and there are
known limitations of using a configuration with hardfp. There are though
target CPUs that grub won't know how to configure failing with something
similar to:

| checking for options to get soft-float... no
| configure: error: could not force soft-float

This change relaxes a bit the COMPATIBLE_HOST restriction to only apply
for hardfp configuration even for arm7ve/a.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 meta/recipes-bsp/grub/grub2.inc | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 47ea561002..6c9952d2d7 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -43,9 +43,18 @@ CVE_CHECK_IGNORE += "CVE-2021-46705"
 
 DEPENDS = "flex-native bison-native gettext-native"
 
-COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
-COMPATIBLE_HOST:armv7a = 'null'
-COMPATIBLE_HOST:armv7ve = 'null'
+GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
+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')}"
+
+# Grub doesn't use float or doubles and tries to disable forcefully floating
+# point at configure time. That dynamic flags configuration doesn't always work
+# (for example on arm 32bit) so force the compilation in softfp.
+TUNE_CCARGS_MFLOAT:class-target = "softfp"
 
 # 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.
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] grub: Allow build on armv7ve/a with softfp
  2022-09-15 12:50 [PATCH] grub: Allow build on armv7ve/a with softfp Andrei Gherzan
@ 2022-09-15 13:01 ` Andrei Gherzan
  0 siblings, 0 replies; 2+ messages in thread
From: Andrei Gherzan @ 2022-09-15 13:01 UTC (permalink / raw)
  To: openembedded; +Cc: Andrei Gherzan

Hi,

On Thu, 15 Sep 2022, at 13:50, Andrei Gherzan wrote:
> From: Andrei Gherzan <andrei.gherzan@huawei.com>
>
> Grub tries to force the compilation in softfp mode for some known target
> CPU. That is because it doesn't use floats or doubles and there are
> known limitations of using a configuration with hardfp. There are though
> target CPUs that grub won't know how to configure failing with something
> similar to:
>
> | checking for options to get soft-float... no
> | configure: error: could not force soft-float
>
> This change relaxes a bit the COMPATIBLE_HOST restriction to only apply
> for hardfp configuration even for arm7ve/a.
>
> Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
> ---
>  meta/recipes-bsp/grub/grub2.inc | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
> index 47ea561002..6c9952d2d7 100644
> --- a/meta/recipes-bsp/grub/grub2.inc
> +++ b/meta/recipes-bsp/grub/grub2.inc
> @@ -43,9 +43,18 @@ CVE_CHECK_IGNORE += "CVE-2021-46705"
> 
>  DEPENDS = "flex-native bison-native gettext-native"
> 
> -COMPATIBLE_HOST = 
> '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
> -COMPATIBLE_HOST:armv7a = 'null'
> -COMPATIBLE_HOST:armv7ve = 'null'
> +GRUB_COMPATIBLE_HOST = 
> '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
> +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')}"
> +
> +# Grub doesn't use float or doubles and tries to disable forcefully 
> floating
> +# point at configure time. That dynamic flags configuration doesn't 
> always work
> +# (for example on arm 32bit) so force the compilation in softfp.
> +TUNE_CCARGS_MFLOAT:class-target = "softfp"

Please ignore this v1 patch as the above was not supposed to be part of the patch. I've sent a cleaned up v2: https://lists.openembedded.org/g/openembedded-core/message/170695

Thanks,
Andrei


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-15 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 12:50 [PATCH] grub: Allow build on armv7ve/a with softfp Andrei Gherzan
2022-09-15 13:01 ` Andrei Gherzan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.