Index: lnt/testing/util/compilers.py =================================================================== --- lnt/testing/util/compilers.py +++ lnt/testing/util/compilers.py @@ -29,32 +29,34 @@ cc = path # Interrogate the compiler. + tf = tempfile.NamedTemporaryFile(suffix='.c') + name = tf.name + tf.close() + tf = open(name, 'w') + print >>tf, "int main() { return 0; }" + tf.close() + cc_version = capture([cc, '-v', '-E'] + cc_flags + - ['-x', 'c', '/dev/null', '-###'], + ['-x', 'c', tf.name, '-###'], include_stderr=True).strip() # Determine the assembler version, as found by the compiler. cc_as_version = capture([cc, "-c", '-Wa,-v', '-o', '/dev/null'] + cc_flags + - ['-x', 'assembler', '/dev/null'], + ['-x', 'assembler', tf.name], include_stderr=True).strip() # Determine the linker version, as found by the compiler. - tf = tempfile.NamedTemporaryFile(suffix='.c') - name = tf.name - tf.close() - tf = open(name, 'w') - print >>tf, "int main() { return 0; }" - tf.close() cc_ld_version = capture(([cc, "-Wl,-v", '-o', '/dev/null'] + cc_flags + [tf.name]), include_stderr=True).strip() - rm_f(tf.name) # Extract the default target .ll (or assembly, for non-LLVM compilers). cc_target_assembly = capture([cc, '-S', '-flto', '-o', '-'] + cc_flags + - ['-x', 'c', '/dev/null'], + ['-x', 'c', tf.name], include_stderr=True).strip() + rm_f(tf.name) + # Extract the compiler's response to -dumpmachine as the target. cc_target = cc_dumpmachine = capture([cc, '-dumpmachine']).strip() @@ -120,7 +122,7 @@ cc_src_tag, = m.groups() else: error('unable to determine gcc build version: %r' % cc_build_string) - elif (cc_name in ('clang', 'LLVM', 'Apple clang', 'Apple LLVM') and + elif (('clang' in cc_name or cc_name in ('LLVM', 'Apple LLVM')) and (cc_extra == '' or 'based on LLVM' in cc_extra or (cc_extra.startswith('(') and cc_extra.endswith(')')))): llvm_capable = True Index: lnt/tests/nt.py =================================================================== --- lnt/tests/nt.py +++ lnt/tests/nt.py @@ -845,8 +845,9 @@ configure_log_path = os.path.join(basedir, 'configure.log') configure_log = open(configure_log_path, 'w') - args = [os.path.realpath(os.path.join(config.test_suite_root, - 'configure'))] + args = ['/bin/sh', os.path.realpath(os.path.join(config.test_suite_root, + 'configure')).replace("\\", "/")] + if config.without_llvm: args.extend(['--without-llvmsrc', '--without-llvmobj']) else: @@ -857,6 +858,10 @@ args.append('--with-externals=%s' % os.path.realpath(config.test_suite_externals)) + cc_target = config.cc_info.get('cc_target') + if cc_target: + args.append('--host=%s' % cc_target) + print >>configure_log, '%s: running: %s' % (timestamp(), ' '.join('"%s"' % a for a in args))