Skip to contentSkip to conversation

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

PATCH New Denys Dmytriyenko 1 participant 1 message Aug 12, 2021

lore
Share & tools
lore
#0 lore raw

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

From: Denys Dmytriyenko <[email protected]>

| 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.

Note: similar patch has been submitted upstream to meta-arm-toolchain:
https://lists.yoctoproject.org/g/meta-arm/message/2163

---
 meta-arago-distro/recipes-bsp/grub/grub%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 meta-arago-distro/recipes-bsp/grub/grub%.bbappend
meta-arago-distro/recipes-bsp/grub/grub%.bbappend new file +9 -0
new file mode 100644
index 0000000..1e5ea43
@@ -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']}"
Signature · 1 line
2.7.4