Repository: spack/spack

Issue:
From a clean install Spack cannot build/install anything.
### Steps to reproduce

From a clean install of spack, e.g.,
```console
mkdir empty
cd empty
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
```
And then bringing that Spack into effect:
```console
. spack/share/spack/setup-env.sh
```
And then trying to install something will fail, e.g.,
```console
spack install intel-oneapi-compilers
```
The errors output are the same for any package. It reports errors that it could not detect the libc used by any of the compilers installed on the system and then fails to concretize anything.

### Error message

Notice in the output below the lines with "Warning: cannot detect libc from " for each of the compilers installed on the system. Since this is with all compilers nothing is built or installed.

```console
$ spack --debug --stacktrace install intel-oneapi-compilers
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.717968] Reading config from file /home/preney/empty/spack/etc/spack/defaults/config.yaml
lib/spack/spack/cmd/__init__.py:119 ==> [2024-05-13-00:40:15.750725] Imported install from built-in commands
lib/spack/spack/cmd/__init__.py:119 ==> [2024-05-13-00:40:15.751583] Imported install from built-in commands
lib/spack/spack/database.py:646 ==> [2024-05-13-00:40:15.753290] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:181 ==> [2024-05-13-00:40:15.753408] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.753621] Reading config from file /home/preney/empty/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.758516] Reading config from file /home/preney/empty/spack/etc/spack/defaults/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.781530] Reading config from file /home/preney/empty/spack/etc/spack/defaults/linux/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.783808] Reading config from file /home/preney/empty/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:15.857980] Reading config from file /home/preney/.spack/linux/compilers.yaml
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:15.874788] '/usr/lib/llvm/16/bin/clang' '-v' '/tmp/spack-implicit-link-infov_ur5w68/main.c' '-o' '/tmp/spack-implicit-link-infov_ur5w68/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:15.922965] '/usr/lib/llvm/17/bin/clang' '-v' '/tmp/spack-implicit-link-infovtpbclwc/main.c' '-o' '/tmp/spack-implicit-link-infovtpbclwc/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:15.963811] '/usr/bin/gcc-10' '-v' '/tmp/spack-implicit-link-info8ciqt1bj/main.c' '-o' '/tmp/spack-implicit-link-info8ciqt1bj/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:15.990184] '/usr/bin/gcc' '-v' '/tmp/spack-implicit-link-info61pzkh4g/main.c' '-o' '/tmp/spack-implicit-link-info61pzkh4g/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.016368] '/usr/bin/gcc-14' '-v' '/tmp/spack-implicit-link-info7ticqxlr/main.c' '-o' '/tmp/spack-implicit-link-info7ticqxlr/output'
lib/spack/spack/database.py:646 ==> [2024-05-13-00:40:16.115862] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:181 ==> [2024-05-13-00:40:16.116000] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.116872] Reading config from file /home/preney/empty/spack/etc/spack/defaults/mirrors.yaml
lib/spack/spack/database.py:646 ==> [2024-05-13-00:40:16.120274] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:181 ==> [2024-05-13-00:40:16.120413] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.120628] Reading config from file /home/preney/empty/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.125722] Reading config from file /home/preney/empty/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/bootstrap/config.py:125 ==> [2024-05-13-00:40:16.127523] [BOOTSTRAP CONFIG SCOPE] name=_builtin
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.127861] Reading config from file /home/preney/empty/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/config.py:138 ==> [2024-05-13-00:40:16.132629] [BOOTSTRAP CONFIG SCOPE] name=defaults, path=/home/preney/empty/spack/etc/spack/defaults
lib/spack/spack/bootstrap/config.py:139 ==> [2024-05-13-00:40:16.132748] [BOOTSTRAP CONFIG SCOPE] name=defaults/linux, path=/home/preney/empty/spack/etc/spack/defaults/linux
lib/spack/spack/bootstrap/config.py:138 ==> [2024-05-13-00:40:16.132857] [BOOTSTRAP CONFIG SCOPE] name=bootstrap, path=/home/preney/.spack/bootstrap/config
lib/spack/spack/bootstrap/config.py:139 ==> [2024-05-13-00:40:16.132959] [BOOTSTRAP CONFIG SCOPE] name=bootstrap/linux, path=/home/preney/.spack/bootstrap/config/linux
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.133680] Reading config from file /home/preney/empty/spack/etc/spack/defaults/config.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.146999] Reading config from file /home/preney/.spack/bootstrap/config/linux/config.yaml
lib/spack/spack/database.py:646 ==> [2024-05-13-00:40:16.154769] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:181 ==> [2024-05-13-00:40:16.154909] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.155154] Reading config from file /home/preney/empty/spack/etc/spack/defaults/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.178763] Reading config from file /home/preney/empty/spack/etc/spack/defaults/linux/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.181959] Reading config from file /home/preney/.spack/bootstrap/config/linux/compilers.yaml
lib/spack/spack/bootstrap/_common.py:228 ==> [2024-05-13-00:40:16.207875] [BOOTSTRAP ROOT SPEC] clingo-bootstrap@spack+python %gcc target=x86_64
lib/spack/spack/bootstrap/core.py:355 ==> [2024-05-13-00:40:16.208012] [BOOTSTRAP MODULE clingo] Try importing from Python
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.208279] Reading config from file /home/preney/empty/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/_common.py:83 ==> [2024-05-13-00:40:16.281488] [BOOTSTRAP MODULE clingo] The installed spec "clingo-bootstrap@spack+python %gcc target=x86_64 ^python@3.11/55qeu52pkt5shpwd7ulugv7wzt5j7vqd" provides the "clingo" Python module
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.281951] Reading config from file /home/preney/empty/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.295152] Reading config from file /home/preney/empty/spack/etc/spack/defaults/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.319902] Reading config from file /home/preney/empty/spack/etc/spack/defaults/linux/packages.yaml
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.654268] Reading config from file /home/preney/.spack/linux/compilers.yaml
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.670037] '/usr/lib/llvm/16/bin/clang' '-v' '/tmp/spack-implicit-link-infongqt77ov/main.c' '-o' '/tmp/spack-implicit-link-infongqt77ov/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.719714] '/usr/lib/llvm/17/bin/clang' '-v' '/tmp/spack-implicit-link-infoccmus1_k/main.c' '-o' '/tmp/spack-implicit-link-infoccmus1_k/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.761252] '/usr/bin/gcc-10' '-v' '/tmp/spack-implicit-link-infozav6ovjr/main.c' '-o' '/tmp/spack-implicit-link-infozav6ovjr/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.788504] '/usr/bin/gcc' '-v' '/tmp/spack-implicit-link-info5a0ni0_f/main.c' '-o' '/tmp/spack-implicit-link-info5a0ni0_f/output'
lib/spack/spack/util/executable.py:233 ==> [2024-05-13-00:40:16.817541] '/usr/bin/gcc-14' '-v' '/tmp/spack-implicit-link-infoxym15ihg/main.c' '-o' '/tmp/spack-implicit-link-infoxym15ihg/output'
lib/spack/spack/main.py:566 ==> [2024-05-13-00:40:16.851040] Warning: cannot detect libc from clang@=16.0.6. The compiler will not be used during concretization.
lib/spack/spack/main.py:566 ==> [2024-05-13-00:40:16.853398] Warning: cannot detect libc from clang@=17.0.6. The compiler will not be used during concretization.
lib/spack/spack/main.py:566 ==> [2024-05-13-00:40:16.857039] Warning: cannot detect libc from gcc@=10.3.1. The compiler will not be used during concretization.
lib/spack/spack/main.py:566 ==> [2024-05-13-00:40:16.859506] Warning: cannot detect libc from gcc@=13.2.1. The compiler will not be used during concretization.
lib/spack/spack/main.py:566 ==> [2024-05-13-00:40:16.862388] Warning: cannot detect libc from gcc@=14.1.0. The compiler will not be used during concretization.
lib/spack/spack/config.py:1123 ==> [2024-05-13-00:40:16.863676] Reading config from file /home/preney/empty/spack/etc/spack/defaults/config.yaml
/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1081:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1082:6-43: info: atom does not occur in any rule head:
  compiler_version(CompilerID,Version)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1118:44-67: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1126:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1127:6-51: info: atom does not occur in any rule head:
  compiler_version(CompilerID,CompilerVersion)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1133:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1134:6-51: info: atom does not occur in any rule head:
  compiler_version(CompilerID,CompilerVersion)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1173:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1194:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1195:6-43: info: atom does not occur in any rule head:
  compiler_version(CompilerID,Version)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1196:6-41: info: atom does not occur in any rule head:
  compiler_os(CompilerID,CompilerOS)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1222:5-40: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1223:5-36: info: atom does not occur in any rule head:
  compiler_version(CompilerID,V)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1224:5-40: info: atom does not occur in any rule head:
  compiler_weight(CompilerID,Weight)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1228:5-40: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1229:5-36: info: atom does not occur in any rule head:
  compiler_version(CompilerID,V)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1230:9-39: info: atom does not occur in any rule head:
  compiler_weight(#X0,#P1)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1254:6-29: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1289:6-29: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/empty/spack/lib/spack/spack/solver/concretize.lp:1290:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

lib/spack/spack/cmd/install.py:437 ==> [2024-05-13-00:40:18.448109] SolverError: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    intel-oneapi-compilers is unsatisfiable
lib/spack/spack/main.py:1072 ==> [2024-05-13-00:40:18.448224] SolverError: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    intel-oneapi-compilers is unsatisfiable
lib/spack/spack/error.py:52 ==> [2024-05-13-00:40:18.448373] Error: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    intel-oneapi-compilers is unsatisfiable
Traceback (most recent call last):
  File "/home/preney/empty/spack/lib/spack/spack/main.py", line 1069, in main
    return _main(argv)
           ^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/main.py", line 1022, in _main
    return finish_parse_and_run(parser, cmd_name, args, env_format_error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/main.py", line 1052, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/main.py", line 649, in _invoke_command
    return_val = command(parser, args)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/cmd/install.py", line 354, in install
    install_without_active_env(args, install_kwargs, reporter_factory)
  File "/home/preney/empty/spack/lib/spack/spack/cmd/install.py", line 466, in install_without_active_env
    concrete_specs = concrete_specs_from_cli(args, install_kwargs) + concrete_specs_from_file(args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/cmd/install.py", line 433, in concrete_specs_from_cli
    concrete_specs = spack.cmd.parse_specs(
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/cmd/__init__.py", line 177, in parse_specs
    spec.concretize(tests=tests)
  File "/home/preney/empty/spack/lib/spack/spack/spec.py", line 2995, in concretize
    self._new_concretize(tests)
  File "/home/preney/empty/spack/lib/spack/spack/spec.py", line 2968, in _new_concretize
    result = solver.solve([self], tests=tests, allow_deprecated=allow_deprecated)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/solver/asp.py", line 3833, in solve
    result, _, _ = self.driver.solve(
                   ^^^^^^^^^^^^^^^^^^
  File "/home/preney/empty/spack/lib/spack/spack/solver/asp.py", line 925, in solve
    result.raise_if_unsat()
  File "/home/preney/empty/spack/lib/spack/spack/solver/asp.py", line 468, in raise_if_unsat
    raise SolverError(constraints, conflicts=conflicts)
spack.solver.asp.SolverError: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    intel-oneapi-compilers is unsatisfiable
```

### Information on your system

* **Spack:** 0.23.0.dev0 (32b3e91ef721457acdb7ffed248e7e02441f5404)
* **Python:** 3.11.9
* **Platform:** linux-gentoo2-zen2
* **Concretizer:** clingo

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have searched the issues of this repo and believe this is not a duplicate
- [X] I have run the failing commands in debug mode and reported the output


Discussion:
Could it be that the config files in `~/.spack` are outdated? Do these compilers exist on the system?
Not possible as I did a ```rm -rf ~/.spack``` completely to ensure it was a fresh install.  Those compilers all exist on my system.

I did everything again like this (with the same results): 
```console
$ rm -rf ~/.spack
$ cd ~/sw ; rm -rf spack
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
Cloning into 'spack'...
remote: Enumerating objects: 547676, done.
remote: Counting objects: 100% (1687/1687), done.
remote: Compressing objects: 100% (957/957), done.
remote: Total 547676 (delta 704), reused 1244 (delta 417), pack-reused 545989
Receiving objects: 100% (547676/547676), 183.09 MiB | 54.75 MiB/s, done.
Resolving deltas: 100% (257074/257074), done.
$ . spack/share/spack/setup-env.sh
$ spack compiler find
==> Added 5 new compilers to /home/preney/.spack/linux/compilers.yaml
    gcc@14.1.0  gcc@13.2.1  gcc@10.3.1  clang@17.0.6  clang@16.0.6
==> Compilers are defined in the following files:
    /home/preney/.spack/linux/compilers.yaml
$ spack compiler list
==> Available compilers
-- clang gentoo2-x86_64 -----------------------------------------
clang@17.0.6  clang@16.0.6

-- gcc gentoo2-x86_64 -------------------------------------------
gcc@14.1.0  gcc@13.2.1  gcc@10.3.1
$ spack install ncdu
==> Fetching https://mirror.spack.io/bootstrap/github-actions/v0.5/build_cache/linux-centos7-x86_64-gcc-10.2.1-clingo-bootstrap-spack-55qeu52pkt5shpwd7ulugv7wzt5j7vqd.spec.json
==> Fetching https://mirror.spack.io/bootstrap/github-actions/v0.5/build_cache/linux-centos7-x86_64/gcc-10.2.1/clingo-bootstrap-spack/linux-centos7-x86_64-gcc-10.2.1-clingo-bootstrap-spack-55qeu52pkt5shpwd7ulugv7wzt5j7vqd.spack
==> Installing "clingo-bootstrap@=spack%gcc@=10.2.1~docs+ipo+optimized+python+static_libstdcpp build_system=cmake build_type=Release generator=make patches=bebb819,ec99431 arch=linux-centos7-x86_64" from a buildcache
==> Warning: cannot detect libc from clang@=16.0.6. The compiler will not be used during concretization.
==> Warning: cannot detect libc from clang@=17.0.6. The compiler will not be used during concretization.
==> Warning: cannot detect libc from gcc@=10.3.1. The compiler will not be used during concretization.
==> Warning: cannot detect libc from gcc@=13.2.1. The compiler will not be used during concretization.
==> Warning: cannot detect libc from gcc@=14.1.0. The compiler will not be used during concretization.
/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1081:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1082:6-43: info: atom does not occur in any rule head:
  compiler_version(CompilerID,Version)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1118:44-67: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1126:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1127:6-51: info: atom does not occur in any rule head:
  compiler_version(CompilerID,CompilerVersion)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1133:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1134:6-51: info: atom does not occur in any rule head:
  compiler_version(CompilerID,CompilerVersion)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1173:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1194:6-41: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1195:6-43: info: atom does not occur in any rule head:
  compiler_version(CompilerID,Version)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1196:6-41: info: atom does not occur in any rule head:
  compiler_os(CompilerID,CompilerOS)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1222:5-40: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1223:5-36: info: atom does not occur in any rule head:
  compiler_version(CompilerID,V)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1224:5-40: info: atom does not occur in any rule head:
  compiler_weight(CompilerID,Weight)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1228:5-40: info: atom does not occur in any rule head:
  compiler_name(CompilerID,Compiler)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1229:5-36: info: atom does not occur in any rule head:
  compiler_version(CompilerID,V)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1230:9-39: info: atom does not occur in any rule head:
  compiler_weight(#X0,#P1)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1254:6-29: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1289:6-29: info: atom does not occur in any rule head:
  compiler_id(CompilerID)

/home/preney/sw/spack/lib/spack/spack/solver/concretize.lp:1290:6-45: info: atom does not occur in any rule head:
  compiler_name(CompilerID,CompilerName)

==> Error: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    ncdu is unsatisfiable
$
```

The `spack install` command is what gets output for any package that I've tried, i.e., no compilers are used since libc cannot be "detected".
Can you share

```python
$ spack python

for c in spack.compilers.all_compilers():
  print(c)
  print(c.compiler_verbose_output)
  print()
```

I guess we need more verbose output for troubleshooting.
```console
spack python
Spack version 0.23.0.dev0
Python 3.11.9, Linux x86_64
>>> for c in spack.compilers.all_compilers():
...   print(c)
...   print(c.compiler_verbose_output)
...   print()
... 
clang(/usr/lib/llvm/16/bin/clang
     /usr/lib/llvm/16/bin/clang++
     None
     None
     []
     gentoo2)
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
System configuration file directory: /etc/clang
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/13
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Found HIP installation: /usr, version 5.7.31921
 "/usr/lib/llvm/16/bin/clang-16" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/preney/sw -resource-dir /usr/lib/llvm/16/bin/../../../../lib/clang/16 -include /usr/include/gentoo/fortify.h -include /usr/include/gentoo/maybe-stddefs.h -internal-isystem /usr/lib/llvm/16/bin/../../../../lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/home/preney/sw -ferror-limit 19 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/main-34877f.o -x c /tmp/spack-implicit-link-info_w19xpne/main.c
clang -cc1 version 16.0.6 based upon LLVM 16.0.6 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm/16/bin/../../../../lib/clang/16/include
 /usr/include
End of search list.
 "/usr/lib/llvm/17/bin/ld.lld" -pie --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /tmp/spack-implicit-link-info_w19xpne/output /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/clang_rt.crtbegin-x86_64.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib -L/lib -L/usr/lib -z relro -z now /tmp/main-34877f.o /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed -lc /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/clang_rt.crtend-x86_64.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crtn.o


clang(/usr/lib/llvm/17/bin/clang
     /usr/lib/llvm/17/bin/clang++
     None
     None
     []
     gentoo2)
clang version 17.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
System configuration file directory: /etc/clang
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/13
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Found HIP installation: /usr, version 5.7.31921
 "/usr/lib/llvm/17/bin/clang-17" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -dumpdir /tmp/spack-implicit-link-infocfa3ow8c/output- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/preney/sw -resource-dir /usr/lib/llvm/17/bin/../../../../lib/clang/17 -include /usr/include/gentoo/fortify.h -include /usr/include/gentoo/maybe-stddefs.h -internal-isystem /usr/lib/llvm/17/bin/../../../../lib/clang/17/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/home/preney/sw -ferror-limit 19 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/main-8394df.o -x c /tmp/spack-implicit-link-infocfa3ow8c/main.c
clang -cc1 version 17.0.6 based upon LLVM 17.0.6 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm/17/bin/../../../../lib/clang/17/include
 /usr/include
End of search list.
 "/usr/lib/llvm/17/bin/ld.lld" -pie --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /tmp/spack-implicit-link-infocfa3ow8c/output /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o /usr/lib/llvm/17/bin/../../../../lib/clang/17/lib/linux/clang_rt.crtbegin-x86_64.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib -L/lib -L/usr/lib -z relro -z now /tmp/main-8394df.o /usr/lib/llvm/17/bin/../../../../lib/clang/17/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed -lc /usr/lib/llvm/17/bin/../../../../lib/clang/17/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed /usr/lib/llvm/17/bin/../../../../lib/clang/17/lib/linux/clang_rt.crtend-x86_64.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crtn.o


gcc(/usr/bin/gcc-10
     /usr/bin/g++-10
     /usr/bin/gfortran-10
     /usr/bin/gfortran-10
     []
     gentoo2)
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-10
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/10/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/dev-lang/gnat-gpl-2021-r5/work/gcc-10-2021-20210519-19A74-src/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/10 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/10/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/10/include/g++-v10 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/10/python --enable-languages=c,c++,fortran,ada --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 10.3.1-r5 p4' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --disable-vtable-verify --disable-libvtv --without-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie --disable-host-bind-now --enable-default-ssp --with-build-config=bootstrap-O3
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210520 (Gentoo 10.3.1-r5 p4) 
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infodm87uumr/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infodm87uumr/output-'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/10/cc1 -quiet -v -isystem /usr/include/x86_64-linux-gnu /tmp/spack-implicit-link-infodm87uumr/main.c -quiet -dumpdir /tmp/spack-implicit-link-infodm87uumr/output- -dumpbase main.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccFZmQSy.s
GNU C17 (Gentoo 10.3.1-r5 p4) version 10.3.1 20210520 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.3.1 20210520, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/10/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/10/include-fixed
 /usr/include
End of search list.
GNU C17 (Gentoo 10.3.1-r5 p4) version 10.3.1 20210520 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.3.1 20210520, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 108e3a8d1e2124246aadd52b06ada7ee
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infodm87uumr/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infodm87uumr/output-'
 /usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../x86_64-pc-linux-gnu/bin/as -v --64 -o /tmp/cctzuAwQ.o /tmp/ccFZmQSy.s
GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (Gentoo 2.42 p3) 2.42.0
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/10/:/usr/libexec/gcc/x86_64-pc-linux-gnu/10/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/10/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/10/:/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infodm87uumr/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infodm87uumr/output.'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/10/collect2 -plugin /usr/libexec/gcc/x86_64-pc-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-pc-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/cczCHYtx.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o /tmp/spack-implicit-link-infodm87uumr/output /usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/10 -L/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/10/../../.. /tmp/cctzuAwQ.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/10/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infodm87uumr/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infodm87uumr/output.'


gcc(/usr/bin/gcc
     /usr/bin/g++
     /usr/bin/gfortran
     /usr/bin/gfortran
     []
     gentoo2)
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-13.2.1_p20240503/work/gcc-13-20240503/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/13/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20240503 p15' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp --disable-fixincludes --with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20240503 (Gentoo 13.2.1_p20240503 p15) 
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infohgsy__8a/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infohgsy__8a/output-'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/13/cc1 -quiet -v /tmp/spack-implicit-link-infohgsy__8a/main.c -quiet -dumpdir /tmp/spack-implicit-link-infohgsy__8a/output- -dumpbase main.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -fcf-protection -o /tmp/ccOfzzVq.s
GNU C17 (Gentoo 13.2.1_p20240503 p15) version 13.2.1 20240503 (x86_64-pc-linux-gnu)
        compiled by GNU C version 13.2.1 20240503, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/13/include
 /usr/include
End of search list.
Compiler executable checksum: 51b7e55c491f4d95f40b5579526fa407
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infohgsy__8a/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infohgsy__8a/output-'
 /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/as -v --64 -o /tmp/ccQWFUR5.o /tmp/ccOfzzVq.s
GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (Gentoo 2.42 p3) 2.42.0
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/:/usr/libexec/gcc/x86_64-pc-linux-gnu/13/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/13/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/13/:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infohgsy__8a/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infohgsy__8a/output.'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccQSjClO.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -o /tmp/spack-implicit-link-infohgsy__8a/output /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../.. /tmp/ccQWFUR5.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infohgsy__8a/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infohgsy__8a/output.'


gcc(/usr/bin/gcc-14
     /usr/bin/g++-14
     /usr/bin/gfortran-14
     /usr/bin/gfortran-14
     []
     gentoo2)
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-14
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-14.1.0-r1/work/gcc-14.1.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/14/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 14.1.0-r1 p1' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie --enable-host-bind-now --enable-default-ssp --disable-fixincludes --with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.0 (Gentoo 14.1.0-r1 p1) 
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infod41amg24/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infod41amg24/output-'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/14/cc1 -quiet -v /tmp/spack-implicit-link-infod41amg24/main.c -quiet -dumpdir /tmp/spack-implicit-link-infod41amg24/output- -dumpbase main.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -fcf-protection -o /tmp/ccih7GYX.s
GNU C17 (Gentoo 14.1.0-r1 p1) version 14.1.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 14.1.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/include
 /usr/include
End of search list.
Compiler executable checksum: 82fb52ded42b539d1b050011bd83f586
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infod41amg24/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infod41amg24/output-'
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/as -v --64 -o /tmp/cch9iQrr.o /tmp/ccih7GYX.s
GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (Gentoo 2.42 p3) 2.42.0
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/:/usr/libexec/gcc/x86_64-pc-linux-gnu/14/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14/:/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infod41amg24/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infod41amg24/output.'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/14/collect2 -plugin /usr/libexec/gcc/x86_64-pc-linux-gnu/14/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper -plugin-opt=-fresolution=/tmp/ccDltWRz.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -o /tmp/spack-implicit-link-infod41amg24/output /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../.. /tmp/cch9iQrr.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' '/tmp/spack-implicit-link-infod41amg24/output' '-mtune=generic' '-march=x86-64' '-dumpdir' '/tmp/spack-implicit-link-infod41amg24/output.'


>>> 
now exiting InteractiveConsole...
```
Okay, what does

```
/lib64/ld-linux-x86-64.so.2 --version
```

say?

And/or `/usr/bin/ldd --version`?
```console
$ /lib64/ld-linux-x86-64.so.2 --version
ld.so (Gentoo 2.38-r13 (patchset 13)) stable release version 2.38.
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
```
and
```console
$ /usr/bin/ldd --version
ldd (Gentoo 2.38-r13 (patchset 13)) 2.38
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
```
Ah OK, our regex expects `gnu` for glibc, but apparently that's too strict.

Maybe we should look for `Free Software Foundation` then.


Resolving patch:
diff --git a/lib/spack/spack/util/libc.py b/lib/spack/spack/util/libc.py
--- a/lib/spack/spack/util/libc.py
+++ b/lib/spack/spack/util/libc.py
@@ -22,7 +22,7 @@ def _libc_from_ldd(ldd: str) -> Optional["spack.spec.Spec"]:
     except Exception:
         return None
 
-    if not re.search(r"\b(?:gnu|glibc|arm)\b", stdout, re.IGNORECASE):
+    if not re.search(r"\bFree Software Foundation\b", stdout):
         return None
 
     version_str = re.match(r".+\(.+\) (.+)", stdout)
@@ -75,7 +75,7 @@ def libc_from_dynamic_linker(dynamic_linker: str) -> Optional["spack.spec.Spec"]
             return spec
         except Exception:
             return None
-    elif re.search(r"\b(?:gnu|glibc|arm)\b", stdout, re.IGNORECASE):
+    elif re.search(r"\bFree Software Foundation\b", stdout):
         # output is like "ld.so (...) stable release version 2.33."
         match = re.search(r"version (\d+\.\d+(?:\.\d+)?)", stdout)
         if not match:


Test patch: