Repository: spack/spack

Issue:
Installation issue: llvm@11.1.0%gcc@11.1.0 build fails
I have been trying to build older versions of LLVM (<12.0.0) with gcc@11.1.0 without any luck. After a while the build fails with some uninformative error messages like these:
```
make[4]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b/projects/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64-bins'
make[3]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b/projects/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64-bins'
make[2]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b'
[ 22%] Built target libcxx_fuzzer_x86_64-build
make[2]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b'
[ 22%] Built target RTAsan.x86_64
make[2]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b'
[ 22%] Built target RTAsan_dynamic.x86_64
make[1]: Leaving directory '/tmp/amaji/spack-stage-llvm-11.1.0-uvcip6bhjaaepvhzej7czkaemhjgz4wb/spack-build-uvcip6b'
make: *** [Makefile:159: all] Error 2
```

I am wondering if anyone else has experienced this. Is LLVM 11 incompatible with gcc@11?

**Note:** 
`llvm@12.0.0%gcc@11.1.0` builds fine.  
`llvm@11.1.0%gcc@8.3.1` builds fine.  



Discussion:
for reference, my full spec is this:
```
$ spack spec llvm@11.1.0%gcc
Input spec
--------------------------------
llvm@11.1.0%gcc

Concretized
--------------------------------
llvm@11.1.0%gcc@11.1.0~all_targets+clang~code_signing+compiler-rt~cuda~flang+gold+internal_unwind~ipo+libcxx+lld+lldb+llvm_dylib~mlir~omp_debug~omp_tsan+polly~python~shared_libs~split_dwarf build_type=Release cuda_arch=none arch=linux-centos8-zen2
    ^binutils@2.36.1%gcc@11.1.0~gas+gold~headers~interwork+ld~libiberty~lto+nls+plugins libs=shared,static arch=linux-centos8-zen2
        ^diffutils@3.7%gcc@11.1.0 arch=linux-centos8-zen2
            ^libiconv@1.16%gcc@11.1.0 arch=linux-centos8-zen2
        ^gettext@0.21%gcc@11.1.0+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-centos8-zen2
            ^bzip2@1.0.8%gcc@11.1.0~debug~pic+shared arch=linux-centos8-zen2
            ^libxml2@2.9.10%gcc@11.1.0~python arch=linux-centos8-zen2
                ^pkgconf@1.7.4%gcc@11.1.0 arch=linux-centos8-zen2
                ^xz@5.2.5%gcc@11.1.0~pic libs=shared,static arch=linux-centos8-zen2
                ^zlib@1.2.11%gcc@11.1.0+optimize+pic+shared arch=linux-centos8-zen2
            ^ncurses@6.2%gcc@11.1.0~symlinks+termlib abi=none arch=linux-centos8-zen2
            ^tar@1.34%gcc@11.1.0 arch=linux-centos8-zen2
    ^cmake@3.20.0%gcc@11.1.0~doc+ncurses+openssl+ownlibs~qt build_type=Release arch=linux-centos8-zen2
        ^openssl@1.1.1g%gcc@11.1.0~docs+systemcerts arch=linux-centos8-zen2
    ^hwloc@2.5.0%gcc@11.1.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml+pci+shared arch=linux-centos8-zen2
        ^libpciaccess@0.16%gcc@11.1.0 arch=linux-centos8-zen2
            ^libtool@2.4.6%gcc@11.1.0 arch=linux-centos8-zen2
                ^m4@1.4.19%gcc@11.1.0+sigsegv arch=linux-centos8-zen2
                    ^libsigsegv@2.13%gcc@11.1.0 arch=linux-centos8-zen2
            ^util-macros@1.19.1%gcc@11.1.0 arch=linux-centos8-zen2
    ^libedit@3.1-20210216%gcc@11.1.0 arch=linux-centos8-zen2
    ^perl-data-dumper@2.173%gcc@11.1.0 arch=linux-centos8-zen2
        ^perl@5.32.0%gcc@11.1.0+cpanm+shared+threads arch=linux-centos8-zen2
            ^berkeley-db@18.1.40%gcc@11.1.0+cxx~docs+stl patches=b231fcc4d5cff05e5c3a4814f6a5af0e9a966428dc2176540d2c05aff41de522 arch=linux-centos8-zen2
            ^gdbm@1.19%gcc@11.1.0 arch=linux-centos8-zen2
                ^readline@8.1%gcc@11.1.0 arch=linux-centos8-zen2
    ^python@3.9.5%gcc@11.1.0+bz2+ctypes+dbm~debug+libxml2+lzma+nis+optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix+tkinter~ucs4+uuid+zlib patches=0d98e93189bc278fbc37a50ed7f183bd8aaf249a8e1670a465f0db6bb4f8cf87 arch=linux-centos8-zen2
        ^expat@2.3.0%gcc@11.1.0+libbsd arch=linux-centos8-zen2
            ^libbsd@0.11.3%gcc@11.1.0 arch=linux-centos8-zen2
                ^libmd@1.0.3%gcc@11.1.0 arch=linux-centos8-zen2
        ^libffi@3.3%gcc@11.1.0 patches=26f26c6f29a7ce9bf370ad3ab2610f99365b4bdd7b82e7c31df41a3370d685c0 arch=linux-centos8-zen2
        ^libnsl@1.3.0%gcc@11.1.0 arch=linux-centos8-zen2
            ^autoconf@2.69%gcc@11.1.0 arch=linux-centos8-zen2
            ^automake@1.16.3%gcc@11.1.0 arch=linux-centos8-zen2
            ^libtirpc@1.2.6%gcc@11.1.0 arch=linux-centos8-zen2
                ^krb5@1.18.2%gcc@11.1.0+shared patches=3d75052730690579484e65a5bf0f92f6c3b20d9c43a413862d087774f431d9e9 arch=linux-centos8-zen2
                    ^bison@3.7.6%gcc@11.1.0 arch=linux-centos8-zen2
            ^rpcsvc-proto@1.4%gcc@11.1.0 arch=linux-centos8-zen2
        ^sqlite@3.35.5%gcc@11.1.0+column_metadata+fts~functions~rtree arch=linux-centos8-zen2
        ^tcl@8.6.11%gcc@11.1.0 arch=linux-centos8-zen2
        ^tk@8.6.11%gcc@11.1.0+xft+xss arch=linux-centos8-zen2
            ^libx11@1.7.0%gcc@11.1.0 arch=linux-centos8-zen2
                ^inputproto@2.3.2%gcc@11.1.0 arch=linux-centos8-zen2
                ^kbproto@1.0.7%gcc@11.1.0 arch=linux-centos8-zen2
                ^libxcb@1.14%gcc@11.1.0 arch=linux-centos8-zen2
                    ^libpthread-stubs@0.4%gcc@11.1.0 arch=linux-centos8-zen2
                    ^libxau@1.0.8%gcc@11.1.0 arch=linux-centos8-zen2
                        ^xproto@7.0.31%gcc@11.1.0 arch=linux-centos8-zen2
                    ^libxdmcp@1.1.2%gcc@11.1.0 arch=linux-centos8-zen2
                    ^xcb-proto@1.14.1%gcc@11.1.0 arch=linux-centos8-zen2
                ^xextproto@7.3.0%gcc@11.1.0 arch=linux-centos8-zen2
                ^xtrans@1.3.5%gcc@11.1.0 arch=linux-centos8-zen2
            ^libxft@2.3.2%gcc@11.1.0 arch=linux-centos8-zen2
                ^fontconfig@2.12.3%gcc@11.1.0 arch=linux-centos8-zen2
                    ^font-util@1.3.2%gcc@11.1.0 fonts=encodings,font-adobe-100dpi,font-adobe-75dpi,font-adobe-utopia-100dpi,font-adobe-utopia-75dpi,font-adobe-utopia-type1,font-alias,font-arabic-misc,font-bh-100dpi,font-bh-75dpi,font-bh-lucidatypewriter-100dpi,font-bh-lucidatypewriter-75dpi,font-bh-type1,font-bitstream-100dpi,font-bitstream-75dpi,font-bitstream-speedo,font-bitstream-type1,font-cronyx-cyrillic,font-cursor-misc,font-daewoo-misc,font-dec-misc,font-ibm-type1,font-isas-misc,font-jis-misc,font-micro-misc,font-misc-cyrillic,font-misc-ethiopic,font-misc-meltho,font-misc-misc,font-mutt-misc,font-schumacher-misc,font-screen-cyrillic,font-sun-misc,font-winitzki-cyrillic,font-xfree86-type1 arch=linux-centos8-zen2
                        ^bdftopcf@1.0.5%gcc@11.1.0 arch=linux-centos8-zen2
                            ^fontsproto@2.1.3%gcc@11.1.0 arch=linux-centos8-zen2
                            ^libxfont@1.5.2%gcc@11.1.0 arch=linux-centos8-zen2
                                ^freetype@2.7.1%gcc@11.1.0 arch=linux-centos8-zen2
                                    ^libpng@1.6.37%gcc@11.1.0 arch=linux-centos8-zen2
                                ^libfontenc@1.1.3%gcc@11.1.0 arch=linux-centos8-zen2
                        ^mkfontdir@1.0.7%gcc@11.1.0 arch=linux-centos8-zen2
                            ^mkfontscale@1.1.2%gcc@11.1.0 arch=linux-centos8-zen2
                    ^gperf@3.1%gcc@11.1.0 arch=linux-centos8-zen2
                ^libxrender@0.9.10%gcc@11.1.0 arch=linux-centos8-zen2
                    ^renderproto@0.11.1%gcc@11.1.0 arch=linux-centos8-zen2
            ^libxscrnsaver@1.2.2%gcc@11.1.0 arch=linux-centos8-zen2
                ^libxext@1.3.3%gcc@11.1.0 arch=linux-centos8-zen2
                ^scrnsaverproto@1.2.2%gcc@11.1.0 arch=linux-centos8-zen2
        ^util-linux-uuid@2.36.2%gcc@11.1.0 arch=linux-centos8-zen2
    ^swig@4.0.2%gcc@11.1.0 arch=linux-centos8-zen2
        ^pcre@8.44%gcc@11.1.0~jit+multibyte+utf arch=linux-centos8-zen2
    ^z3@4.8.9%gcc@11.1.0~gmp~ipo+python build_type=RelWithDebInfo arch=linux-centos8-zen2
        ^py-setuptools@50.3.2%gcc@11.1.0 arch=linux-centos8-zen2
```
Can you upload the logs here?
```
==> Installing llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq
==> No binary for llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/53/53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79.tar.gz
######################################################################### 100.0%
==> No patches needed for llvm
==> llvm: Executing phase: 'cmake'
==> llvm: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16'

5 errors found in build log:
     4435    make[2]: Entering directory '/tmp/kitayama1/spack-stage/spack-stag
             e-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu
             '
     4436    -- Detecting C compiler ABI info
     4437    [ 12%] Copying CXX header chrono
     4438    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/libcxx/include &
             & /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-cent
             os8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5npem3wd/
             bin/cmake -E copy_if_different /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/libcxx/
             include/chrono /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-
             d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/include/c++/v
             1/chrono
     4439    In file included from /tmp/kitayama1/spack-stage/spack-stage-llvm-
             11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/utils/bench
             mark/src/benchmark_register.cc:15:
     4440    /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7
             dedilceucv76kgthq/spack-src/llvm/utils/benchmark/src/benchmark_reg
             ister.h: In function 'void AddRange(std::vector<T>*, T, T, int)':
  >> 4441    /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7
             dedilceucv76kgthq/spack-src/llvm/utils/benchmark/src/benchmark_reg
             ister.h:17:30: error: 'numeric_limits' is not a member of 'std'
     4442       17 |   static const T kmax = std::numeric_limits<T>::max();
     4443          |                              ^~~~~~~~~~~~~~
  >> 4444    /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7
             dedilceucv76kgthq/spack-src/llvm/utils/benchmark/src/benchmark_reg
             ister.h:17:46: error: expected primary-expression before '>' token
     4445       17 |   static const T kmax = std::numeric_limits<T>::max();
     4446          |                                              ^
  >> 4447    /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7
             dedilceucv76kgthq/spack-src/llvm/utils/benchmark/src/benchmark_reg
             ister.h:17:49: error: '::max' has not been declared; did you mean
             'std::max'?
     4448       17 |   static const T kmax = std::numeric_limits<T>::max();
     4449          |                                                 ^~~
     4450          |                                                 std::max
     4451    In file included from /p/scratch/cjzam11/kitayama1/projects/spack/
             opt/spack/linux-centos8-zen2/gcc-10.3.0/gcc-11.1.0-ezpi4p6pa2dnhk7
             jbdpopjpa5tn7bbbc/include/c++/11.1.0/algorithm:62,
     4452                     from /tmp/kitayama1/spack-stage/spack-stage-llvm-
             11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/utils/bench
             mark/include/benchmark/benchmark.h:175,
     4453                     from /tmp/kitayama1/spack-stage/spack-stage-llvm-
             11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/utils/bench
             mark/src/internal_macros.h:4,

     ...

     4558    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/libcxx/include &
             & /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-cent
             os8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5npem3wd/
             bin/cmake -E copy_if_different /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/libcxx/
             include/cstdint /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0
             -d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/include/c++/
             v1/cstdint
     4559    -- Looking for fopen in c
     4560    [ 12%] Building CXX object projects/compiler-rt/lib/tsan/dd/CMakeF
             iles/clang_rt.dd-x86_64.dir/dd_interceptors.cpp.o
     4561    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/compiler-rt/lib/
             tsan/dd && /p/scratch/cjzam11/kitayama1/projects/spack/lib/spack/e
             nv/gcc/g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_
             MACROS -D__STDC_LIMIT_MACROS -I/tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhb
             du/projects/compiler-rt/lib/tsan/dd -I/tmp/kitayama1/spack-stage/s
             pack-stage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/
             compiler-rt/lib/tsan/dd -I/p/scratch/cjzam11/kitayama1/projects/sp
             ack/opt/spack/linux-centos8-zen2/gcc-11.1.0/libxml2-2.9.10-aor2gag
             hoesbe3y6zne73ebadq6wexyb/include/libxml2 -I/tmp/kitayama1/spack-s
             tage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spac
             k-build-d3fhbdu/include -I/tmp/kitayama1/spack-stage/spack-stage-l
             lvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/include
              -I/tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-src/compiler-rt/lib/tsan/dd/../.. -std=
             c++11 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -W
             extra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missi
             ng-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthro
             ugh -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-m
             ove -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -ffu
             nction-sections -fdata-sections -Wall -std=c++14 -Wno-unused-param
             eter -O3 -DNDEBUG  -m64 -fno-lto -fPIC -fno-builtin -fno-exception
             s -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisi
             bility=hidden -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtua
             l-dtor -fno-rtti -std=c++14 -MD -MT projects/compiler-rt/lib/tsan/
             dd/CMakeFiles/clang_rt.dd-x86_64.dir/dd_interceptors.cpp.o -MF CMa
             keFiles/clang_rt.dd-x86_64.dir/dd_interceptors.cpp.o.d -o CMakeFil
             es/clang_rt.dd-x86_64.dir/dd_interceptors.cpp.o -c /tmp/kitayama1/
             spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgt
             hq/spack-src/compiler-rt/lib/tsan/dd/dd_interceptors.cpp
     4562    [ 12%] Copying CXX header cstdio
     4563    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/libcxx/include &
             & /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-cent
             os8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5npem3wd/
             bin/cmake -E copy_if_different /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/libcxx/
             include/cstdio /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-
             d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/include/c++/v
             1/cstdio
  >> 4564    make[2]: *** [utils/benchmark/src/CMakeFiles/benchmark.dir/build.m
             ake:93: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_reg
             ister.cc.o] Error 1
     4565    make[2]: *** Waiting for unfinished jobs....
     4566    [ 12%] Copying CXX header cstdlib
     4567    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/libcxx/include &
             & /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-cent
             os8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5npem3wd/
             bin/cmake -E copy_if_different /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/libcxx/
             include/cstdlib /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0
             -d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/include/c++/
             v1/cstdlib
     4568    [ 12%] Building CXX object projects/compiler-rt/lib/msan/CMakeFile
             s/clang_rt.msan-x86_64.dir/msan_chained_origin_depot.cpp.o
     4569    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/compiler-rt/lib/
             msan && /p/scratch/cjzam11/kitayama1/projects/spack/lib/spack/env/
             gcc/g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MAC
             ROS -D__STDC_LIMIT_MACROS -I/tmp/kitayama1/spack-stage/spack-stage
             -llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/
             projects/compiler-rt/lib/msan -I/tmp/kitayama1/spack-stage/spack-s
             tage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/compil
             er-rt/lib/msan -I/p/scratch/cjzam11/kitayama1/projects/spack/opt/s
             pack/linux-centos8-zen2/gcc-11.1.0/libxml2-2.9.10-aor2gaghoesbe3y6
             zne73ebadq6wexyb/include/libxml2 -I/tmp/kitayama1/spack-stage/spac
             k-stage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d
             3fhbdu/include -I/tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.
             0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/include -I/tmp/k
             itayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7dedilc
             eucv76kgthq/spack-src/compiler-rt/lib/msan/.. -std=c++11 -fPIC -fv
             isibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unus
             ed-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initia
             lizers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-
             uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexce
             pt-type -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections
              -fdata-sections -Wall -std=c++14 -Wno-unused-parameter -O3 -DNDEB
             UG  -m64 -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-
             pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -
             fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fno-rtt
             i -fPIE -ffreestanding -std=c++14 -MD -MT projects/compiler-rt/lib
             /msan/CMakeFiles/clang_rt.msan-x86_64.dir/msan_chained_origin_depo
             t.cpp.o -MF CMakeFiles/clang_rt.msan-x86_64.dir/msan_chained_origi
             n_depot.cpp.o.d -o CMakeFiles/clang_rt.msan-x86_64.dir/msan_chaine
             d_origin_depot.cpp.o -c /tmp/kitayama1/spack-stage/spack-stage-llv
             m-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/compiler-rt/li
             b/msan/msan_chained_origin_depot.cpp
     4570    [ 12%] Building CXX object projects/compiler-rt/lib/msan/CMakeFile
             s/clang_rt.msan-x86_64.dir/msan_interceptors.cpp.o

     ...

     4828    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/compiler-rt/lib/
             lsan && /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linu
             x-centos8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5np
             em3wd/bin/cmake -P CMakeFiles/clang_rt.lsan-x86_64.dir/cmake_clean
             _target.cmake
     4829    [ 12%] Copying CXX header experimental/set
     4830    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/libcxx/include &
             & /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-cent
             os8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5npem3wd/
             bin/cmake -E copy_if_different /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/libcxx/
             include/experimental/set /tmp/kitayama1/spack-stage/spack-stage-ll
             vm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/inc
             lude/c++/v1/experimental/set
     4831    make[2]: Leaving directory '/tmp/kitayama1/spack-stage/spack-stage
             -llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu'
     4832    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/compiler-rt/lib/
             lsan && /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linu
             x-centos8-zen2/gcc-11.1.0/cmake-3.20.3-hrhd4gotsgod76spdsdoc5yt5np
             em3wd/bin/cmake -E cmake_link_script CMakeFiles/clang_rt.lsan-x86_
             64.dir/link.txt --verbose=1
     4833    make[2]: Leaving directory '/tmp/kitayama1/spack-stage/spack-stage
             -llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu'
  >> 4834    make[1]: *** [CMakeFiles/Makefile2:220297: utils/benchmark/src/CMa
             keFiles/benchmark.dir/all] Error 2
     4835    make[1]: *** Waiting for unfinished jobs....
     4836    [ 12%] Built target clang_rt.dd-x86_64
     4837    /p/scratch/cjzam11/kitayama1/projects/spack/opt/spack/linux-centos
             8-zen2/gcc-11.1.0/binutils-2.36.1-h7wawykcwbiqplxnvtol7nclbaw6hc2y
             /bin/ar Dqc ../../../../lib/clang/11.1.0/lib/linux/libclang_rt.lsa
             n-x86_64.a CMakeFiles/clang_rt.lsan-x86_64.dir/lsan.cpp.o CMakeFil
             es/clang_rt.lsan-x86_64.dir/lsan_allocator.cpp.o CMakeFiles/clang_
             rt.lsan-x86_64.dir/lsan_fuchsia.cpp.o CMakeFiles/clang_rt.lsan-x86
             _64.dir/lsan_interceptors.cpp.o CMakeFiles/clang_rt.lsan-x86_64.di
             r/lsan_linux.cpp.o CMakeFiles/clang_rt.lsan-x86_64.dir/lsan_mac.cp
             p.o CMakeFiles/clang_rt.lsan-x86_64.dir/lsan_malloc_mac.cpp.o CMak
             eFiles/clang_rt.lsan-x86_64.dir/lsan_posix.cpp.o CMakeFiles/clang_
             rt.lsan-x86_64.dir/lsan_preinit.cpp.o CMakeFiles/clang_rt.lsan-x86
             _64.dir/lsan_thread.cpp.o ../interception/CMakeFiles/RTInterceptio
             n.x86_64.dir/interception_linux.cpp.o ../interception/CMakeFiles/R
             TInterception.x86_64.dir/interception_mac.cpp.o ../interception/CM
             akeFiles/RTInterception.x86_64.dir/interception_win.cpp.o ../inter
             ception/CMakeFiles/RTInterception.x86_64.dir/interception_type_tes
             t.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.di
             r/sanitizer_allocator.cpp.o ../sanitizer_common/CMakeFiles/RTSanit
             izerCommon.x86_64.dir/sanitizer_common.cpp.o ../sanitizer_common/C
             MakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_deadlock_detector
             1.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.di
             r/sanitizer_deadlock_detector2.cpp.o ../sanitizer_common/CMakeFile
             s/RTSanitizerCommon.x86_64.dir/sanitizer_errno.cpp.o ../sanitizer_
             common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_file.cpp.
             o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sani
             tizer_flags.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon
             .x86_64.dir/sanitizer_flag_parser.cpp.o ../sanitizer_common/CMakeF
             iles/RTSanitizerCommon.x86_64.dir/sanitizer_fuchsia.cpp.o ../sanit
             izer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libc
             .cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir
             /sanitizer_libignore.cpp.o ../sanitizer_common/CMakeFiles/RTSaniti
             zerCommon.x86_64.dir/sanitizer_linux.cpp.o ../sanitizer_common/CMa
             keFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_s390.cpp.o ..
             /sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitize
             r_mac.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_6
             4.dir/sanitizer_netbsd.cpp.o ../sanitizer_common/CMakeFiles/RTSani
             tizerCommon.x86_64.dir/sanitizer_openbsd.cpp.o ../sanitizer_common
             /CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_persistent_allo
             cator.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_6
             4.dir/sanitizer_platform_limits_freebsd.cpp.o ../sanitizer_common/
             CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_
             linux.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_6
             4.dir/sanitizer_platform_limits_netbsd.cpp.o ../sanitizer_common/C
             MakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_o
             penbsd.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_
             64.dir/sanitizer_platform_limits_posix.cpp.o ../sanitizer_common/C
             MakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_s
             olaris.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_
             64.dir/sanitizer_posix.cpp.o ../sanitizer_common/CMakeFiles/RTSani
             tizerCommon.x86_64.dir/sanitizer_printf.cpp.o ../sanitizer_common/
             CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_common.
             cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/
             sanitizer_procmaps_bsd.cpp.o ../sanitizer_common/CMakeFiles/RTSani
             tizerCommon.x86_64.dir/sanitizer_procmaps_fuchsia.cpp.o ../sanitiz
             er_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procma
             ps_linux.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x8
             6_64.dir/sanitizer_procmaps_mac.cpp.o ../sanitizer_common/CMakeFil
             es/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_solaris.cpp.o .
             ./sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitiz
             er_rtems.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x8
             6_64.dir/sanitizer_solaris.cpp.o ../sanitizer_common/CMakeFiles/RT
             SanitizerCommon.x86_64.dir/sanitizer_stoptheworld_fuchsia.cpp.o ..
             /sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitize
             r_stoptheworld_mac.cpp.o ../sanitizer_common/CMakeFiles/RTSanitize
             rCommon.x86_64.dir/sanitizer_suppressions.cpp.o ../sanitizer_commo
             n/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_tls_get_addr.c
             pp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/s
             anitizer_thread_registry.cpp.o ../sanitizer_common/CMakeFiles/RTSa
             nitizerCommon.x86_64.dir/sanitizer_type_traits.cpp.o ../sanitizer_
             common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_win.cpp.o
              ../sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanit
             izer_termination.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerC
             ommonLibc.x86_64.dir/sanitizer_common_libcdep.cpp.o ../sanitizer_c
             ommon/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_alloca
             tor_checks.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonL
             ibc.x86_64.dir/sanitizer_linux_libcdep.cpp.o ../sanitizer_common/C
             MakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_mac_libcdep.c
             pp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.d
             ir/sanitizer_posix_libcdep.cpp.o ../sanitizer_common/CMakeFiles/RT
             SanitizerCommonLibc.x86_64.dir/sanitizer_stoptheworld_linux_libcde
             p.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_6
             4.dir/sanitizer_stoptheworld_netbsd_libcdep.cpp.o ../sanitizer_com
             mon/CMakeFiles/RTSanitizerCommonCoverage.x86_64.dir/sancov_flags.c
             pp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonCoverage.x86_
             64.dir/sanitizer_coverage_fuchsia.cpp.o ../sanitizer_common/CMakeF
             iles/RTSanitizerCommonCoverage.x86_64.dir/sanitizer_coverage_libcd
             ep_new.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonCover
             age.x86_64.dir/sanitizer_coverage_win_sections.cpp.o ../sanitizer_
             common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer
             _allocator_report.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizer
             CommonSymbolizer.x86_64.dir/sanitizer_stackdepot.cpp.o ../sanitize
             r_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitiz
             er_stacktrace.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerComm
             onSymbolizer.x86_64.dir/sanitizer_stacktrace_libcdep.cpp.o ../sani
             tizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/san
             itizer_stacktrace_printer.cpp.o ../sanitizer_common/CMakeFiles/RTS
             anitizerCommonSymbolizer.x86_64.dir/sanitizer_stacktrace_sparc.cpp
             .o ../sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_
             64.dir/sanitizer_symbolizer.cpp.o ../sanitizer_common/CMakeFiles/R
             TSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_libback
             trace.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonSymbol
             izer.x86_64.dir/sanitizer_symbolizer_libcdep.cpp.o ../sanitizer_co
             mmon/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_s
             ymbolizer_mac.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerComm
             onSymbolizer.x86_64.dir/sanitizer_symbolizer_markup.cpp.o ../sanit
             izer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sani
             tizer_symbolizer_posix_libcdep.cpp.o ../sanitizer_common/CMakeFile
             s/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_repo
             rt.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolize
             r.x86_64.dir/sanitizer_symbolizer_win.cpp.o ../sanitizer_common/CM
             akeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_unwind_l
             inux_libcdep.cpp.o ../sanitizer_common/CMakeFiles/RTSanitizerCommo
             nSymbolizer.x86_64.dir/sanitizer_unwind_win.cpp.o CMakeFiles/RTLSa
             nCommon.x86_64.dir/lsan_common.cpp.o CMakeFiles/RTLSanCommon.x86_6
             4.dir/lsan_common_fuchsia.cpp.o CMakeFiles/RTLSanCommon.x86_64.dir
             /lsan_common_linux.cpp.o CMakeFiles/RTLSanCommon.x86_64.dir/lsan_c
             ommon_mac.cpp.o
     4838    [ 12%] Building CXX object projects/compiler-rt/lib/tsan/CMakeFile
             s/clang_rt.tsan-x86_64.dir/rtl/tsan_interface.cpp.o
     4839    cd /tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiausc
             sd7dedilceucv76kgthq/spack-build-d3fhbdu/projects/compiler-rt/lib/
             tsan && /p/scratch/cjzam11/kitayama1/projects/spack/lib/spack/env/
             gcc/g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MAC
             ROS -D__STDC_LIMIT_MACROS -I/tmp/kitayama1/spack-stage/spack-stage
             -llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d3fhbdu/
             projects/compiler-rt/lib/tsan -I/tmp/kitayama1/spack-stage/spack-s
             tage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/compil
             er-rt/lib/tsan -I/p/scratch/cjzam11/kitayama1/projects/spack/opt/s
             pack/linux-centos8-zen2/gcc-11.1.0/libxml2-2.9.10-aor2gaghoesbe3y6
             zne73ebadq6wexyb/include/libxml2 -I/tmp/kitayama1/spack-stage/spac
             k-stage-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-build-d
             3fhbdu/include -I/tmp/kitayama1/spack-stage/spack-stage-llvm-11.1.
             0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/llvm/include -I/tmp/k
             itayama1/spack-stage/spack-stage-llvm-11.1.0-d3fhbduiauscsd7dedilc
             eucv76kgthq/spack-src/compiler-rt/lib/tsan/.. -std=c++11 -fPIC -fv
             isibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unus
             ed-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initia
             lizers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-
             uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexce
             pt-type -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections
              -fdata-sections -Wall -std=c++14 -Wno-unused-parameter -O3 -DNDEB
             UG  -m64 -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-
             pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -
             fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fPIE -f
             no-rtti -msse3 -Wframe-larger-than=530 -std=c++14 --sysroot=. -MD
             -MT projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.
             dir/rtl/tsan_interface.cpp.o -MF CMakeFiles/clang_rt.tsan-x86_64.d
             ir/rtl/tsan_interface.cpp.o.d -o CMakeFiles/clang_rt.tsan-x86_64.d
             ir/rtl/tsan_interface.cpp.o -c /tmp/kitayama1/spack-stage/spack-st
             age-llvm-11.1.0-d3fhbduiauscsd7dedilceucv76kgthq/spack-src/compile
             r-rt/lib/tsan/rtl/tsan_interface.cpp
     4840    [ 12%] Copying CXX header experimental/simd
```
[spack-build-out.txt](https://github.com/spack/spack/files/6683106/spack-build-out.txt)

I get a similar error trying to build llvm@9.0.1 using clang 9.0.1.
@ikitayama Did you try other GCC versions?

I have seen this before when compiling GROMACS with GCC 11.

It was a missing header in GROMACS, compilation working by a chance. No longer working with newer GCC.

https://gitlab.com/spack/spack/-/commit/862ce517ce96c26c11825c691607ddeb3c36c164

If older GCC works, it means that LLVM needs to be patched in similar way, or requirement of older GCC added to the package.
i think this patch worked for me with `llvm@11 %gcc@11`
https://src.fedoraproject.org/rpms/llvm10/raw/7ce7ebd066955ea95ba2b491c41fbc6e4ee0643a/f/llvm10-gcc11.patch
I'm afraid not, due to the excessive inode usage, I'd already stopped using Spack. Sorry.

> @ikitayama Did you try other GCC versions?
> 
> I have seen this before when compiling GROMACS with GCC 11.
> 
> It was a missing header in GROMACS, compilation working by a chance. No longer working with newer GCC.
> 
> https://gitlab.com/spack/spack/-/commit/862ce517ce96c26c11825c691607ddeb3c36c164
> 
> If older GCC works, it means that LLVM needs to be patched in similar way, or requirement of older GCC added to the package.




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
@@ -310,7 +310,7 @@ class Llvm(CMakePackage, CudaPackage):
     patch('sanitizer-ipc_perm_mode.patch', when="@5:9+compiler-rt%gcc@9:")
 
     # github.com/spack/spack/issues/24270: MicrosoftDemangle for %gcc@10: and %clang@13:
-    patch('missing-includes.patch', when='@8:9')
+    patch('missing-includes.patch', when='@8')
 
     # Backport from llvm master + additional fix
     # see  https://bugs.llvm.org/show_bug.cgi?id=39696
@@ -342,6 +342,8 @@ class Llvm(CMakePackage, CudaPackage):
     patch('no_cyclades.patch', when='@10:12.0.0')
     patch('no_cyclades9.patch', when='@6:9')
 
+    patch('llvm-gcc11.patch', when='@9:11%gcc@11:')
+
     # Add LLVM_VERSION_SUFFIX
     # https://reviews.llvm.org/D115818
     patch('llvm-version-suffix-macro.patch', when='@:13.0.0')


Test patch: