Repository: spack/spack

Issue:
Installation issue: llvm@10 together with gcc 11
<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: <name-of-the-package>".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

Building llvm@10.0.1 together with gcc 11.1.0 fails

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install llvm@10.0.1 %gcc@11.1.0
```
fails with
```
  >> 4098     $stage/spack-stage-llvm-10.0.1-elhygrmplkbi67vdi64ilopdz6jjdptt/spack-src/llvm/utils/b
              enchmark/src/benchmark_register.h:17:30: error: 'numeric_limits' is not a member of 'std'
     4099        17 |   static const T kmax = std::numeric_limits<T>::max();
     4100           |                              ^~~~~~~~~~~~~~
  >> 4101     $stage/spack-stage-llvm-10.0.1-elhygrmplkbi67vdi64ilopdz6jjdptt/spack-src/llvm/utils/b
              enchmark/src/benchmark_register.h:17:46: error: expected primary-expression before '>' token
     4102        17 |   static const T kmax = std::numeric_limits<T>::max();
     4103           |                                              ^
  >> 4104     $stage/spack-stage/spack-stage-llvm-10.0.1-elhygrmplkbi67vdi64ilopdz6jjdptt/spack-src/llvm/utils/b
              enchmark/src/benchmark_register.h:17:49: error: '::max' has not been declared; did you mean 'std::max'?
     4105        17 |   static const T kmax = std::numeric_limits<T>::max();
     4106           |                                                 ^~~
     4107           |                                                 std::max

```

### Information on your system

<!-- Please include the output of `spack debug report` -->
* **Spack:** 0.13.4-8281-849943c63d
* **Python:** 3.5.3
* **Platform:** linux-debian9-piledriver
* **Concretizer:** clingo

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->
* [spack-build-out.txt](https://github.com/spack/spack/files/6637996/spack-build-out-llvm-10.0.1-gcc-11.1.0.txt)

@trws @naromero77

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -187,7 +187,8 @@ class Llvm(CMakePackage, CudaPackage):
     # Introduced in version 11 as a part of LLVM and not a separate package.
     conflicts("+flang", when="@:10.999")
 
-    # LLVM 4 and 5 does not build with GCC 8
+    # Older LLVM do not build with newer GCC
+    conflicts("%gcc@11:", when="@:10")
     conflicts("%gcc@8:", when="@:5")
     conflicts("%gcc@:5.0.999", when="@8:")
 


Test patch: