meta-arm.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm-toolchain: grub: fix do_configure() breakage with external-arm toolchain
@ 2021-08-12 18:08 Denys Dmytriyenko
  2021-08-13  3:38 ` [meta-arm] " Jon Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Denys Dmytriyenko @ 2021-08-12 18:08 UTC (permalink / raw)
  To: meta-arm; +Cc: Denys Dmytriyenko, Tom Rini

From: Denys Dmytriyenko <denys@konsulko.com>

grub and grub-efi break in do_configure() when using external-arm toolchain:

| checking for aarch64-poky-linux-objcopy... no
| checking for objcopy... objcopy
| checking for aarch64-poky-linux-strip... no
| checking for strip... strip
| checking for aarch64-poky-linux-nm... no
| checking for nm... nm
| checking for aarch64-poky-linux-ranlib... no
| checking for ranlib... ranlib
...
| checking whether objcopy works for absolute addresses... configure: error: objcopy cannot create binary files

That is due to external-arm toolchain's target triplet aarch64-none-linux-gnu
being different from OE triplet like aarch64-poky-linux and configure script
trying to use it to find binutils binaries like objcopy, falling back to host
ones.

Help configure script to find correct objcopy and other binaries by passing
the correct target triplet with --target parameter set to EAT_TARGET_SYS,
overriding the default OE one.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Cc: Tom Rini <trini@konsulko.com>
---
 meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend

diff --git a/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend b/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend
new file mode 100644
index 0000000..3bdfe3d
--- /dev/null
+++ b/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend
@@ -0,0 +1,9 @@
+# When external-arm toolchain is not in use, EAT_TARGET_SYS is undefined,
+# causing below :append expansion to break - just weakly set it to empty
+EAT_TARGET_SYS ?= ""
+
+# grub uses --target triplet to find binutils binaries such as objcopy
+# Since external-arm toolchain uses aarch64-none-linux-gnu triplet,
+# OE-defined TARGET_SYS differs from EAT_TARGET_SYS used by external-arm
+# toolchain, grub needs passing the correct --target to configure script
+CONFIGUREOPTS:append:class-target = "${@['',' --target=${EAT_TARGET_SYS}'][d.getVar('TCMODE') == 'external-arm']}"
-- 
2.7.4


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

* Re: [meta-arm] [PATCH] arm-toolchain: grub: fix do_configure() breakage with external-arm toolchain
  2021-08-12 18:08 [PATCH] arm-toolchain: grub: fix do_configure() breakage with external-arm toolchain Denys Dmytriyenko
@ 2021-08-13  3:38 ` Jon Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Mason @ 2021-08-13  3:38 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arm, Denys Dmytriyenko, Tom Rini

On Thu, Aug 12, 2021 at 2:09 PM Denys Dmytriyenko <denis@denix.org> wrote:
>
> From: Denys Dmytriyenko <denys@konsulko.com>
>
> grub and grub-efi break in do_configure() when using external-arm toolchain:
>
> | checking for aarch64-poky-linux-objcopy... no
> | checking for objcopy... objcopy
> | checking for aarch64-poky-linux-strip... no
> | checking for strip... strip
> | checking for aarch64-poky-linux-nm... no
> | checking for nm... nm
> | checking for aarch64-poky-linux-ranlib... no
> | checking for ranlib... ranlib
> ...
> | checking whether objcopy works for absolute addresses... configure: error: objcopy cannot create binary files
>
> That is due to external-arm toolchain's target triplet aarch64-none-linux-gnu
> being different from OE triplet like aarch64-poky-linux and configure script
> trying to use it to find binutils binaries like objcopy, falling back to host
> ones.
>
> Help configure script to find correct objcopy and other binaries by passing
> the correct target triplet with --target parameter set to EAT_TARGET_SYS,
> overriding the default OE one.
>
> Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
> Cc: Tom Rini <trini@konsulko.com>

With this change, CI no longer passes check-layers.  See
https://gitlab.com/jonmason00/meta-arm/-/jobs/1500144360


> ---
>  meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend
>
> diff --git a/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend b/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend
> new file mode 100644
> index 0000000..3bdfe3d
> --- /dev/null
> +++ b/meta-arm-toolchain/recipes-bsp/grub/grub%.bbappend
> @@ -0,0 +1,9 @@
> +# When external-arm toolchain is not in use, EAT_TARGET_SYS is undefined,
> +# causing below :append expansion to break - just weakly set it to empty
> +EAT_TARGET_SYS ?= ""
> +
> +# grub uses --target triplet to find binutils binaries such as objcopy
> +# Since external-arm toolchain uses aarch64-none-linux-gnu triplet,
> +# OE-defined TARGET_SYS differs from EAT_TARGET_SYS used by external-arm
> +# toolchain, grub needs passing the correct --target to configure script
> +CONFIGUREOPTS:append:class-target = "${@['',' --target=${EAT_TARGET_SYS}'][d.getVar('TCMODE') == 'external-arm']}"
> --
> 2.7.4
>
>
> 
>

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

end of thread, other threads:[~2021-08-13  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 18:08 [PATCH] arm-toolchain: grub: fix do_configure() breakage with external-arm toolchain Denys Dmytriyenko
2021-08-13  3:38 ` [meta-arm] " Jon Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).