llvm: detect short executable names (#45171)

Also, remove annotations for "ld.lld" and "lldb"
This commit is contained in:
Massimiliano Culpo 2024-07-12 14:03:00 +02:00 committed by GitHub
parent 517b7fb0c9
commit d9033d8dac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View File

@ -53,7 +53,6 @@ paths:
compilers: compilers:
c: ".*/bin/clang-8$" c: ".*/bin/clang-8$"
cxx: ".*/bin/clang[+][+]-8$" cxx: ".*/bin/clang[+][+]-8$"
ld: ".*/bin/ld.lld-8$"
- spec: 'llvm@3.9.1+clang~lld~lldb' - spec: 'llvm@3.9.1+clang~lld~lldb'
extra_attributes: extra_attributes:

View File

@ -669,21 +669,19 @@ def determine_variants(cls, exes, version_str):
# because LLVM has kindly named compilers # because LLVM has kindly named compilers
variants, compilers = ["+clang"], {} variants, compilers = ["+clang"], {}
lld_found, lldb_found = False, False lld_found, lldb_found = False, False
for exe in exes: for exe in sorted(exes, key=len):
name = os.path.basename(exe) name = os.path.basename(exe)
if "clang++" in name: if "clang++" in name:
compilers["cxx"] = exe compilers.setdefault("cxx", exe)
elif "clang" in name: elif "clang" in name:
compilers["c"] = exe compilers.setdefault("c", exe)
elif "flang" in name: elif "flang" in name:
variants.append("+flang") variants.append("+flang")
compilers["fortran"] = exe compilers.setdefault("fortran", exe)
elif "ld.lld" in name: elif "ld.lld" in name:
lld_found = True lld_found = True
compilers["ld"] = exe
elif "lldb" in name: elif "lldb" in name:
lldb_found = True lldb_found = True
compilers["lldb"] = exe
variants.append("+lld" if lld_found else "~lld") variants.append("+lld" if lld_found else "~lld")
variants.append("+lldb" if lldb_found else "~lldb") variants.append("+lldb" if lldb_found else "~lldb")