diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-07-12 14:03:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-12 14:03:00 +0200 |
commit | d9033d8dacb5de7a25cf5d1bd65fcda94b513ab5 (patch) | |
tree | 8208f0366cd1568c327d5fe76262be243c087574 | |
parent | 517b7fb0c991b8b764f82d291ee288b4d249d4e0 (diff) | |
download | spack-d9033d8dacb5de7a25cf5d1bd65fcda94b513ab5.tar.gz spack-d9033d8dacb5de7a25cf5d1bd65fcda94b513ab5.tar.bz2 spack-d9033d8dacb5de7a25cf5d1bd65fcda94b513ab5.tar.xz spack-d9033d8dacb5de7a25cf5d1bd65fcda94b513ab5.zip |
llvm: detect short executable names (#45171)
Also, remove annotations for "ld.lld" and "lldb"
-rw-r--r-- | var/spack/repos/builtin/packages/llvm/detection_test.yaml | 1 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/llvm/package.py | 10 |
2 files changed, 4 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/detection_test.yaml b/var/spack/repos/builtin/packages/llvm/detection_test.yaml index e979a83626..c5bf5aff64 100644 --- a/var/spack/repos/builtin/packages/llvm/detection_test.yaml +++ b/var/spack/repos/builtin/packages/llvm/detection_test.yaml @@ -53,7 +53,6 @@ paths: compilers: c: ".*/bin/clang-8$" cxx: ".*/bin/clang[+][+]-8$" - ld: ".*/bin/ld.lld-8$" - spec: 'llvm@3.9.1+clang~lld~lldb' extra_attributes: diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index bcc0ca7557..c6f2000ee6 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -669,21 +669,19 @@ class Llvm(CMakePackage, CudaPackage, CompilerPackage): # because LLVM has kindly named compilers variants, compilers = ["+clang"], {} lld_found, lldb_found = False, False - for exe in exes: + for exe in sorted(exes, key=len): name = os.path.basename(exe) if "clang++" in name: - compilers["cxx"] = exe + compilers.setdefault("cxx", exe) elif "clang" in name: - compilers["c"] = exe + compilers.setdefault("c", exe) elif "flang" in name: variants.append("+flang") - compilers["fortran"] = exe + compilers.setdefault("fortran", exe) elif "ld.lld" in name: lld_found = True - compilers["ld"] = exe elif "lldb" in name: lldb_found = True - compilers["lldb"] = exe variants.append("+lld" if lld_found else "~lld") variants.append("+lldb" if lldb_found else "~lldb") |