Index: libcxx/utils/libcxx/test/config.py =================================================================== --- libcxx/utils/libcxx/test/config.py +++ libcxx/utils/libcxx/test/config.py @@ -109,7 +109,7 @@ def make_static_lib_name(self, name): """Return the full filename for the specified library name""" - if self.target_info.is_windows(): + if self.target_info.is_windows() and not self.target_info.is_mingw(): assert name == 'c++' # Only allow libc++ to use this function for now. return 'lib' + name + '.lib' else: @@ -382,9 +382,12 @@ # Configure libraries if self.cxx_stdlib_under_test == 'libc++': - self.cxx.link_flags += ['-nodefaultlibs'] + if self.target_info.is_mingw(): + self.cxx.link_flags += ['-nostdlib++'] + else: + self.cxx.link_flags += ['-nodefaultlibs'] # FIXME: Handle MSVCRT as part of the ABI library handling. - if self.target_info.is_windows(): + if self.target_info.is_windows() and not self.target_info.is_mingw(): self.cxx.link_flags += ['-nostdlib'] self.configure_link_flags_cxx_library() self.configure_link_flags_abi_library() Index: libcxx/utils/libcxx/test/target_info.py =================================================================== --- libcxx/utils/libcxx/test/target_info.py +++ libcxx/utils/libcxx/test/target_info.py @@ -27,6 +27,9 @@ def is_windows(self): return self.platform() == 'win32' + def is_mingw(self): + return False + def is_darwin(self): return self.platform() == 'darwin' @@ -184,6 +187,13 @@ def __init__(self, full_config): super(WindowsLocalTI, self).__init__(full_config) +class MingwLocalTI(WindowsLocalTI): + def __init__(self, full_config): + super(MingwLocalTI, self).__init__(full_config) + + def is_mingw(self): + return True + def make_target_info(full_config): default = "libcxx.test.target_info.LocalTI" info_str = full_config.get_lit_conf('target_info', default)