[PATCHv2 rtems_waf] Allow vendor field in toolchain target triplet

Chris Johns chrisj at rtems.org
Wed May 24 22:48:37 UTC 2023


Looks good and thanks. I have pushed this.

If you would like to submit module update patches for the various repos using
rtems_waf please feel free to do so.

Chris

On 25/5/2023 4:13 am, Martin Erik Werner wrote:
> Rework the splitting of arch and bsp to rely on the last field in the
> arch section starting with "rtems", instead of relying on the arch being
> exactly two fields in size.
> 
> This makes sure that toolchains with a vendor field in their target
> triplet can be used with this build system.
> 
> Toolchains produced by the RTEMS source builder tend to omit the vendor
> field, but for example the SPARC LEON/ERC32 toolchain provided by
> Gaisler through the RCC package does include a vendor field.
> ---
> 
> v2 fixes an off-by-one error in list indexing compared to v1.
> 
>  rtems.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/rtems.py b/rtems.py
> index 0b24645..c65a7d2 100644
> --- a/rtems.py
> +++ b/rtems.py
> @@ -858,11 +858,15 @@ def _check_arch_bsps(req, config, path, archs, version):
>  
>  
>  def _arch_from_arch_bsp(arch_bsp):
> -    return '-'.join(arch_bsp.split('-')[:2])
> +    fields = arch_bsp.split('-')
> +    rtems_field_index = next(i for i, field in enumerate(fields) if field.startswith('rtems'))
> +    return '-'.join(fields[:(rtems_field_index + 1)])
>  
>  
>  def _bsp_from_arch_bsp(arch_bsp):
> -    return '-'.join(arch_bsp.split('-')[2:])
> +    fields = arch_bsp.split('-')
> +    rtems_field_index = next(i for i, field in enumerate(fields) if field.startswith('rtems'))
> +    return '-'.join(fields[(rtems_field_index + 1):])
>  
>  
>  def _pkgconfig_path(path):


More information about the devel mailing list