libc: detect ARM flavor (#43959)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
jdomke 2024-05-02 22:59:29 +09:00 committed by GitHub
parent beebe2c9d3
commit 97dc353cb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@ def _libc_from_ldd(ldd: str) -> Optional["spack.spec.Spec"]:
except Exception: except Exception:
return None return None
if not re.search("gnu|glibc", stdout, re.IGNORECASE): if not re.search(r"\b(?:gnu|glibc|arm)\b", stdout, re.IGNORECASE):
return None return None
version_str = re.match(r".+\(.+\) (.+)", stdout) version_str = re.match(r".+\(.+\) (.+)", stdout)
@ -75,8 +75,8 @@ def libc_from_dynamic_linker(dynamic_linker: str) -> Optional["spack.spec.Spec"]
return spec return spec
except Exception: except Exception:
return None return None
elif re.search("gnu|glibc", stdout, re.IGNORECASE): elif re.search(r"\b(?:gnu|glibc|arm)\b", stdout, re.IGNORECASE):
# output is like "ld.so (...) stable release version 2.33." write a regex for it # output is like "ld.so (...) stable release version 2.33."
match = re.search(r"version (\d+\.\d+(?:\.\d+)?)", stdout) match = re.search(r"version (\d+\.\d+(?:\.\d+)?)", stdout)
if not match: if not match:
return None return None