[rtems_waf commit] Allow vendor field in toolchain target triplet

Chris Johns chrisj at rtems.org
Wed May 24 22:26:58 UTC 2023


Module:    rtems_waf
Branch:    master
Commit:    c721249146a510a6746b37e7d731cb1467f91f48
Changeset: http://git.rtems.org/rtems_waf/commit/?id=c721249146a510a6746b37e7d731cb1467f91f48

Author:    Martin Erik Werner <martinerikwerner.aac at gmail.com>
Date:      Wed May 24 20:13:10 2023 +0200

Allow vendor field in toolchain target triplet

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.

---

 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 vc mailing list