mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-01-12 03:10:15 +00:00
external-arm-toolchain-versions: Use ldd to get libc version
Arm GCC 11.2 binary release has moved away from keeping libc library
versioning info as libc-{EAT_VER_LIBC}.so. So rather switch to
retrieving libc version by parsing output from "$ ldd --version".
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -50,37 +50,26 @@ def eat_get_gcc_version(d):
|
||||
|
||||
def eat_get_libc_version(d):
|
||||
import os,bb
|
||||
import subprocess
|
||||
|
||||
syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}', d)
|
||||
if not syspath:
|
||||
return 'UNKNOWN'
|
||||
|
||||
libpath = syspath + '/libc/' + bb.data.expand('${EAT_LIBDIR}/${EAT_TARGET_SYS}/', d)
|
||||
topdir = d.getVar('TOPDIR', True)
|
||||
lddpath = syspath + '/libc/usr/bin/ldd'
|
||||
|
||||
if os.path.exists(libpath):
|
||||
for file in os.listdir(libpath):
|
||||
if file.find('libc-') == 0:
|
||||
return file[5:-3]
|
||||
if os.path.exists(lddpath):
|
||||
cmd = '/bin/sh ' + lddpath + ' --version'
|
||||
try:
|
||||
stdout, stderr = bb.process.run(cmd, cwd=topdir, stderr=subprocess.PIPE)
|
||||
except bb.process.CmdError as exc:
|
||||
bb.error('Failed to obtain external Arm libc version: %s' % exc)
|
||||
return 'UNKNOWN'
|
||||
else:
|
||||
first_line = stdout.splitlines()[0]
|
||||
return first_line.split()[2]
|
||||
|
||||
libpath = syspath + '/libc/' + bb.data.expand('${EAT_LIBDIR}/', d)
|
||||
|
||||
if os.path.exists(libpath):
|
||||
for file in os.listdir(libpath):
|
||||
if file.find('libc-') == 0:
|
||||
return file[5:-3]
|
||||
|
||||
libpath = syspath + '/libc/usr/' + bb.data.expand('${EAT_LIBDIR}/${EAT_TARGET_SYS}/', d)
|
||||
|
||||
if os.path.exists(libpath):
|
||||
for file in os.listdir(libpath):
|
||||
if file.find('libc-') == 0:
|
||||
return file[5:-3]
|
||||
|
||||
libpath = syspath + '/libc/usr/' + bb.data.expand('${EAT_LIBDIR}/', d)
|
||||
|
||||
if os.path.exists(libpath):
|
||||
for file in os.listdir(libpath):
|
||||
if file.find('libc-') == 0:
|
||||
return file[5:-3]
|
||||
return 'UNKNOWN'
|
||||
|
||||
def eat_get_kernel_version(d):
|
||||
|
||||
Reference in New Issue
Block a user