summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/test/lit.cfg.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index 0c6c6b5f1e9..05efee9e2f3 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -83,8 +83,10 @@ if (lit.util.which('cvtres', config.environment['PATH'])) or \
if (config.llvm_libxml2_enabled == '1'):
config.available_features.add('libxml2')
-tar_version = subprocess.Popen(
- ['tar', '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
-if 'GNU tar' in tar_version.stdout.read().decode():
- config.available_features.add('gnutar')
-tar_version.wait()
+tar_executable = lit.util.which('tar', config.environment['PATH'])
+if tar_executable:
+ tar_version = subprocess.Popen(
+ [tar_executable, '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
+ if 'GNU tar' in tar_version.stdout.read().decode():
+ config.available_features.add('gnutar')
+ tar_version.wait()
OpenPOWER on IntegriCloud