Created attachment 297845 [details] Compressed build log As stated below, 'make check' fails immediately being unable to launch 'llc'. I guess it expects clang to be compiled in built llvm directory. -- >>> Test phase [test]: sys-devel/clang-9999 make -j6 -j1 VERBOSE=1 test make[1]: Entering directory `/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test' Making Clang 'lit.site.cfg' file... Making Clang 'Unit/lit.site.cfg' file... --- Running clang tests for x86_64-pc-linux-gnu --- lit.py: lit.cfg:146: note: using clang: '/tmp/portage/sys-devel/clang-9999/work/llvm/Release/bin/clang' Traceback (most recent call last): File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit.py", line 5, in <module> lit.main() File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/main.py", line 517, in main testSuiteCache, localConfigCache)[1]) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/main.py", line 230, in getTests ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/main.py", line 199, in getTestSuite ts, relative = search(item) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/main.py", line 183, in search cache[path] = res = search1(path) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/main.py", line 174, in search1 cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist = True) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/TestingConfig.py", line 52, in frompath exec f in cfg_globals File "/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test/lit.site.cfg", line 21, in <module> lit.load_config(config, "/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test/../test/lit.cfg") File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/LitConfig.py", line 66, in load_config config = config) File "/tmp/portage/sys-devel/clang-9999/work/llvm/utils/lit/lit/TestingConfig.py", line 52, in frompath exec f in cfg_globals File "/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test/../test/lit.cfg", line 221, in <module> llc_props = get_llc_props(os.path.join(llvm_tools_dir, 'llc')) File "/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test/../test/lit.cfg", line 201, in get_llc_props cmd = subprocess.Popen([tool, '-version'], stdout=subprocess.PIPE) File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1228, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory make[1]: *** [all] Error 1 make[1]: Leaving directory `/tmp/portage/sys-devel/clang-9999/work/llvm/tools/clang/test' make: *** [test] Error 2 emake failed * ERROR: sys-devel/clang-9999 failed (test phase): * Make test failed. See above for details. * * Call stack: * ebuild.sh, line 85: Called src_test * environment, line 4816: Called die * The specific snippet of code: * has test $FEATURES && die "Make test failed. See above for details."; * * If you need support, post the output of 'emerge --info =sys-devel/clang-9999', * the complete build log and the output of 'emerge -pqv =sys-devel/clang-9999'. * The complete build log is located at '/var/log/portage/sys-devel:clang-9999:20120103-211932.log'. * The ebuild environment file is located at '/tmp/portage/sys-devel/clang-9999/temp/environment'. * S: '/tmp/portage/sys-devel/clang-9999/work/llvm'
After some testing, it seems that the following line is reponsible (in test/lit.cfg): llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'], stdout = subprocess.PIPE) where llvm_tools_dir is path to the build directory. I think it should be '/usr/bin' in our case instead. Replacing that path by hand fixes the issue.
Indeed, 3.0 works around this by compiling llvm too when testing. 3.0-r1 and 9999 now have the good sed line to change clang's test/lit.cfg to use system llc, 3.0 test now work without re-compiling llvm (file in live version has not changed that much, so it should work too)