[meta-arm,1/4] external-arm-toolchain-versions: also collect binutils/bfd version

Submitted by Denys Dmytriyenko on June 15, 2020, 8:07 a.m. | Patch ID: 173568

Details

Message ID 1592208433-28086-1-git-send-email-denis@denix.org
State New
Headers show

Commit Message

Denys Dmytriyenko June 15, 2020, 8:07 a.m.
From: Denys Dmytriyenko <denys@ti.com>

To be used by SDK packaging for binutils cross.

This code is upstreamed from meta-arago layer.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 .../conf/distro/include/external-arm-toolchain-versions.inc    | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta-arm-toolchain/conf/distro/include/external-arm-toolchain-versions.inc b/meta-arm-toolchain/conf/distro/include/external-arm-toolchain-versions.inc
index 5c40af2..a89f2f0 100644
--- a/meta-arm-toolchain/conf/distro/include/external-arm-toolchain-versions.inc
+++ b/meta-arm-toolchain/conf/distro/include/external-arm-toolchain-versions.inc
@@ -117,6 +117,15 @@  def eat_get_gdb_version(d):
         first_line = stdout.splitlines()[0]
         return first_line.split()[-1]
 
+def eat_get_bfd_version(d):
+    try:
+        stdout, stderr = eat_run(d, 'as', '--version')
+    except bb.process.CmdError:
+        return 'UNKNOWN'
+    else:
+        first_line = stdout.splitlines()[0]
+        return first_line.split()[-1]
+
 python external_arm_toolchain_version_handler () {
     if not isinstance(e, bb.event.ConfigParsed):
         return
@@ -129,5 +138,6 @@  python external_arm_toolchain_version_handler () {
     d.setVar('EAT_VER_LIBC', eat_get_libc_version(ld))
     d.setVar('EAT_VER_KERNEL', eat_get_kernel_version(ld))
     d.setVar('EAT_VER_GDB', eat_get_gdb_version(ld))
+    d.setVar('EAT_VER_BFD', eat_get_bfd_version(ld))
 }
 addhandler external_arm_toolchain_version_handler