diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -410,7 +410,10 @@ # We require both ld.bfd and ld.gold exist and support plugins. They are in # the same repository 'binutils-gdb' and usually built together. for exe in (config.gnu_ld_executable, config.gold_executable): - ld_cmd = subprocess.Popen([exe, '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'}) + try: + ld_cmd = subprocess.Popen([exe, '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'}) + except FileNotFoundError as e: + return False ld_out = ld_cmd.stdout.read().decode() ld_cmd.wait() if not '-plugin' in ld_out: