title: ninja: build stopped: subcommand failed when building llvm10 on Fedora 35
body: <p>I have been trying to build llvm10 from source. I downloaded the source from llvm's github and have been trying for the past few days to complete the build but each and everytime towards the end of the ninja process, the error pops up -<code>ninja: build stopped: subcommand failed</code></p>
  <p>I am using the following commands to build:</p>
  <pre><code>cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/llvm -DLLVM_ENABLE_PROJECTS=clang -DLLVM_LIBDIR_SUFFIX=64 -DLLVM_TARGETS_TO_BUILD=&quot;AMDGPU&quot; -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_PARALLEL_LINK_JOBS=1
  </code></pre>
  <p>Since multiple of my attempts failed, I also tried running by setting the parallel jobs to 1 as many threads recommended. Also did <code>ninja -j1</code> but none of this helps.</p>
  <p>I remember having done this successfully on Fedora 34, so, I reinstalled Fedora 34, but, it too gives me the same error.</p>
  <p>This is the portion where the error pops up:</p>
  <pre><code>[1/17] Building CXX object utils/bench.../benchmark.dir/benchmark_register.cc.o
  FAILED: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o 
  /bin/c++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/build/utils/benchmark/src -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src -I/usr/include/libxml2 -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/build/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/../include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections  -std=c++11  -Wall  -Wextra  -Wshadow  -pedantic  -pedantic-errors  -Wfloat-equal  -fstrict-aliasing  -fno-exceptions  -Wstrict-aliasing -O3 -DNDEBUG -std=c++14 -MD -MT utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o -MF utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o.d -o utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o -c /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc
  In file included from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc:15:
  /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h: In function ‘void AddRange(std::vector&lt;T&gt;*, T, T, int)’:
  /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:30: error: ‘numeric_limits’ is not a member of ‘std’
     17 |   static const T kmax = std::numeric_limits&lt;T&gt;::max();
        |                              ^~~~~~~~~~~~~~
  /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:46: error: expected primary-expression before ‘&gt;’ token
     17 |   static const T kmax = std::numeric_limits&lt;T&gt;::max();
        |                                              ^
  /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:49: error: ‘::max’ has not been declared; did you mean ‘std::max’?
     17 |   static const T kmax = std::numeric_limits&lt;T&gt;::max();
        |                                                 ^~~
        |                                                 std::max
  In file included from /usr/include/c++/11/algorithm:62,
                   from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/include/benchmark/benchmark.h:175,
                   from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/internal_macros.h:4,
                   from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/check.h:8,
                   from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:6,
                   from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc:15:
  /usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
   3467 |     max(initializer_list&lt;_Tp&gt; __l, _Compare __comp)
        |     ^~~
  ninja: build stopped: subcommand failed.
  </code></pre>
  <p>Any help is appreciated.</p>