[compiler-rt] Provide better llvm-lit failure when llvm-config fails.
authorMitch Phillips <mitchphillips@outlook.com>
Tue, 26 Feb 2019 18:41:54 +0000 (18:41 +0000)
committerMitch Phillips <mitchphillips@outlook.com>
Tue, 26 Feb 2019 18:41:54 +0000 (18:41 +0000)
Summary:
The current error message can cause confusion if llvm-config can't be
executed for reasons other than "not found". In my example, cross
compiling generated an llvm-config binary for aarch64 which couldn't be
executed natively. Instead of telling me that the error was with the
file architecture, it reports the file as not being present.

Reviewers: pcc

Subscribers: dberris, javed.absar, kristof.beyls, jdoerfert, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354907

compiler-rt/test/lit.common.cfg

index 40b377e..26e5f43 100644 (file)
@@ -389,7 +389,8 @@ try:
       stdout = subprocess.PIPE,
       env=config.environment)
 except OSError:
-  print("Could not find llvm-config in " + config.llvm_tools_dir)
+  print("Could not launch llvm-config in " + config.llvm_tools_dir)
+  print("    Failed with error #{0}: {1}".format(e.errno, e.strerror))
   exit(42)
 
 if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):