[libcxx] Handle target triples with dashes in platform name
authorMikhail Maltsev <mikhail.maltsev@arm.com>
Fri, 11 Sep 2020 13:41:36 +0000 (14:41 +0100)
committerMikhail Maltsev <mikhail.maltsev@arm.com>
Fri, 11 Sep 2020 13:42:05 +0000 (14:42 +0100)
Target triples may contain a dash in the platform name (e.g.
"aarch64-arm-none-eabi"). Account for it when splitting the triple
into components.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D87508

libcxx/utils/libcxx/test/config.py

index 086db1d..42438b3 100644 (file)
@@ -245,7 +245,7 @@ class Configuration(object):
         # XFAIL markers for tests that are known to fail with versions of
         # libc++ as were shipped with a particular triple.
         if self.use_system_cxx_lib:
-            (arch, vendor, platform) = self.config.target_triple.split('-')
+            (arch, vendor, platform) = self.config.target_triple.split('-', 2)
             (sysname, version) = re.match(r'([^0-9]+)([0-9\.]*)', platform).groups()
 
             self.config.available_features.add('with_system_cxx_lib={}-{}-{}{}'.format(arch, vendor, sysname, version))