Index: libcxx/utils/libcxx/test/config.py =================================================================== --- libcxx/utils/libcxx/test/config.py +++ libcxx/utils/libcxx/test/config.py @@ -9,6 +9,7 @@ import copy import os import pkgutil +import platform import pipes import re import shlex @@ -245,8 +246,8 @@ # 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('-', 2) - (sysname, version) = re.match(r'([^0-9]+)([0-9\.]*)', platform).groups() + (arch, vendor, target_platform) = self.config.target_triple.split('-', 2) + (sysname, version) = re.match(r'([^0-9]+)([0-9\.]*)', target_platform).groups() self.config.available_features.add('with_system_cxx_lib={}-{}-{}{}'.format(arch, vendor, sysname, version)) self.config.available_features.add('with_system_cxx_lib={}{}'.format(sysname, version)) @@ -266,6 +267,43 @@ self.config.available_features.add('libcxx_gdb') self.cxx.libcxx_gdb = libcxx_gdb + if platform.system() == 'Darwin': + self.config.available_features.add('system-linker-mach-o') + self.config.available_features.add('system-darwin') + elif platform.system() == 'Windows': + self.config.available_features.add('system-windows') + elif platform.system() == 'Linux': + self.config.available_features.add('system-linux') + elif platform.system() == 'FreeBSD': + self.config.available_features.add('system-freebsd') + elif platform.system() == 'NetBSD': + self.config.available_features.add('system-netbsd') + elif platform.system() == 'AIX': + self.config.available_features.add('system-aix') + elif platform.system() == 'SunOS': + self.config.available_features.add('system-solaris') + + # Native compilation: host arch == default triple arch + host_triple = getattr(self.config, 'host_triple', None) + target_triple = getattr(self.config, 'target_triple', None) + if host_triple and host_triple == target_triple: + self.config.available_features.add('native') + + if target_triple: + if re.match(r'^x86_64.*-apple', target_triple): + self.config.available_features.add('x86_64-apple') + if re.match(r'^x86_64.*-linux', target_triple): + self.config.available_features.add('x86_64-linux') + if re.match(r'^i.86.*', target_triple): + self.config.available_features.add('target-x86') + elif re.match(r'^x86_64.*', target_triple): + self.config.available_features.add('target-x86_64') + elif re.match(r'^aarch64.*', target_triple): + self.config.available_features.add('target-aarch64') + elif re.match(r'^arm.*', target_triple): + self.config.available_features.add('target-arm') + + def configure_compile_flags(self): self.configure_default_compile_flags() # Configure extra flags