[meta-xilinx] [PATCH] xilinx-versions: Change default main version
Nathan Rossi
nathan at nathanrossi.com
Sun Dec 20 20:17:19 PST 2015
On Sat, Dec 19, 2015 at 11:21 AM, Manjukumar Matha
<manjukumar.harthikote-matha at xilinx.com> wrote:
> Allow CSL_VER_MAIN to be defined in local.conf.
> Fetch libc version correctly from toolchain path
This should be split into two patches. Please also provide a bit more
info in the commit message for the reasons for these changes.
>
> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha at xilinx.com>
> ---
> conf/distro/include/xilinx-versions.inc | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/conf/distro/include/xilinx-versions.inc b/conf/distro/include/xilinx-versions.inc
> index 4e44f07..6b0ca79 100644
> --- a/conf/distro/include/xilinx-versions.inc
> +++ b/conf/distro/include/xilinx-versions.inc
> @@ -28,7 +28,8 @@ def csl_get_version(d):
> return 'UNKNOWN'
>
> def csl_get_main_version(d):
> - version = csl_get_version(d)
> + toolchain_version = d.getVar('CSL_VER_MAIN')
> + version = (csl_get_version(d), toolchain_version)[toolchain_version != '']
What is the exact reason for this other than just allowing it to be
defined in local.conf? If you are trying to support toolchains which
have a version that cannot be detected by
csl_get_version/csl_get_main_version, please update those functions
instead so it can just auto detect the different scheme. If this is
really only needed for obscure testing scenarios it would be simpler
to manually override the PV of the recipe (since that is the instance
where CSL_VER_MAIN is used), that can easily be done in local.conf
with something like 'PV_pn-external-xilinx-toolchain = "<version>"'.
Also this change causes breakages when CSL_VER_MAIN is not set in local.conf:
ERROR: Execution of event handler 'xilinx_version_handler' failed
Traceback (most recent call last):
File "/home/nathan/dev/meta-xilinx/conf/distro/include/xilinx-versions.inc",
line 102, in xilinx_version_handler(e=<bb.event.ConfigParsed object at
0x7f8373cb00d0>):
> d.setVar('CSL_VER_MAIN', csl_get_main_version(ld))
d.setVar('CSL_VER_GCC', csl_get_gcc_version(ld))
File "/home/nathan/dev/meta-xilinx/conf/distro/include/xilinx-versions.inc",
line 34, in csl_get_main_version(d=<bb.data_smart.DataSmart object at
0x7f83737e60d0>):
if version != 'UNKNOWN':
> return version.split()[-1].rstrip(')')
else:
AttributeError: 'NoneType' object has no attribute 'split'
> if version != 'UNKNOWN':
> return version.split()[-1].rstrip(')')
> else:
> @@ -42,6 +43,8 @@ def csl_get_gcc_version(d):
> return version
>
> def xilinx_get_libc_version(d):
> + import fnmatch
> +
> syspath = d.expand('${EXTERNAL_TOOLCHAIN_SYSROOT}')
> if not syspath:
> return 'UNKNOWN'
> @@ -51,9 +54,9 @@ def xilinx_get_libc_version(d):
> libpath = syspath + '/sgxx-glibc/lib/'
>
> if os.path.exists(libpath):
> - for file in os.listdir(libpath):
> - if file.find('libc-') == 0:
> - return file[5:-3]
> + for root,dirs,files in os.walk(libpath):
> + for filename in fnmatch.filter(files,'libc-*.so'):
> + return filename[5:-3]
Same here, what is the reason? if libc-*.so is not in <sys-root>/lib/
then isn't the rest of the toolchain recipe broken also? since it
won't be able to find it and populate it into the packages/oe sysroot.
Regards,
Nathan
> return 'UNKNOWN'
>
> def xilinx_get_kernel_version(d):
> --
> 2.1.4
>
> --
> _______________________________________________
> meta-xilinx mailing list
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx
More information about the meta-xilinx
mailing list