<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/107062>107062</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Build error on CentOS release 6.3 (Final)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          zh794390558
      </td>
    </tr>
</table>

<pre>
    
```
cmake -B build -S llvm -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra' -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_STATIC_LINK_CXX_STDLIB=on -DCMAKE_CXX_COMPILER=/opt/compiler/gcc-8.2/bin/g++ -DCMAKE_C_COMPILER=/opt/compiler/gcc-8.2/bin/gcc

cmake --build build
```
When building llvm encounter this problem, how to fix it?

```
In file included from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/cstdlib:75,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/ext/string_conversions.h:41,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/bits/basic_string.h:6391,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/string:52,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/stdexcept:39,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/array:39,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/tuple:39,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:20,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/ADT/StringRef.h:12,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/Support/AMDGPUMetadata.h:18,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/lib/Support/AMDGPUMetadata.cpp:15:
/opt/compiler/gcc-8.2/include/stdlib.h:510:35: error: expected initializer before ‘__attribute_alloc_size__’
      __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/ext/string_conversions.h:41,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/bits/basic_string.h:6391,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/string:52,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/stdexcept:39,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/array:39,
                 from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/tuple:39,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:20,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/ADT/StringRef.h:12,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/include/llvm/Support/AMDGPUMetadata.h:18,
                 from /home/disk1/zhanghui/baidu/speech-spil-nlu/asr-ice/tools/llvm-project/llvm/lib/Support/AMDGPUMetadata.cpp:15:
/home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/cstdlib:132:11: error: ‘::aligned_alloc’ has not been declared
   using ::aligned_alloc;
           ^~~~~~~~~~~~~
gmake[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:90: lib/Support/CMakeFiles/LLVMSupport.dir/AMDGPUMetadata.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:14225: lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWFFzm7gT_zTyiwYPSMaGBx7AmP79r91kYufae2KEkI2ussRIonXzcJ_9RuAkTppmrjcd3z2E8YCQtLs_7a7080KM4XvJWALCDIT5iHS2UTq5a2bxBMd-GEajStXfEuDnwE_B1D_9-ld6IJ8Z9DJYdVzU0NtAIb4coPcOAoRuJT_CNfnMdlwwAxCCXj5fp-8XZXa7XOXl9vfrBcB5zqpuD718tfptXS4-pNlqUV7fXP1_Md9uAM4BmlFB5B7grH96VilhPHa0mgA0eyZ4c_thu1wvBkFE1aHlgmlPW4AzwSt6PD40SMWHdie_clkP-Hpd2_Tm3WK7KbdXA9JB2adoejZns023y3m5Wn54X84_fSo323y1zADOlXxYpuufX62vl6vFTa-jUK0FqLiHBVCxp9SLxgigouLSvQOUAZQ9qvhpBZSeInUeIG-IT39_MZAfGyaHYS73QxCZpKqTlmloG25gq1Ul2AGgOWzUV2gV3PEj5Bbg4tzgM71LCV30IZdUdDWr4U6rAwSoaNSBvb6ex9ZJ2E0c3ANQEY3R2Hc9xtaCVwCnsxCg-WAVPr9-tVV2dAqM1VzuS6rkF6YNV9KMG4DTSXA5IBW3xj2I4bQc8PQYpji-IIrBMMBpiC5ptGZHyloLcIrjy9klWpNvF7Zpu1awn7NZc_M5AKi4a4jcNx3vs4TXnfNcyxhtPNNy4UnheojRHqdOrD9dASrcEeC1Wv3BqD29PsF46kjzLUBFzqRha9Iu5U716Yf8_yTOTZ-nN2zXgwz-frJeBuSma1ul3Yx0nb-7vl0zS2piyYA2-nfRukP2FYi0bR3IEOB7Ing17R_XPpzf_RLDwHc57nRAprXSfePYMmpZDbnklhPB75iGFdspzSBYIBD5II7KkliredVZVhIhFC0Nv2NleT8hPndcWW7_d3P1EZ4LHQapE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