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

    <tr>
        <th>Summary</th>
        <td>
             cannot build llvm-libc with gcc 6.3
        </td>
    </tr>

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

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

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

<pre>
    This is maybe related to #53574  ("cannot build llvm-libc-13 with gcc")

Context: I'm trying to build Qt6 using a recent LLVM compiler on manylinux_2_24 in order to use PySide6 to build a native python binding for a C++ project for python 10. That's why I try to build llvm on a so old system.

I read elsewhere that a recent gcc is necessary but if this is the cause of the failure, there should be a check enforcing that.

The Dockerfile doing the build is here: https://github.com/aymara/lima/blob/port-to-qt6/continuous_integration/Dockerfile-manylinux_2_24_with_llvm
The build traces are there: https://github.com/aymara/lima/runs/7475225160

This is the cmake command with the compiler detection trace:
```
Step 15/22 : RUN cmake -S llvm -B build -G Ninja -DLLVM_PARALLEL_LINK_JOBS=1 -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;libc;libclc;lld;lldb;openmp;pstl" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_INSTALL_PREFIX=/opt/llvm
 ---> Running in 0b757e605084
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- The ASM compiler identification is GNU
```

And the build error:
```
[1937/7600] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o
FAILED: projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o 
/usr/bin/c++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/llvm-project-llvmorg-14.0.6/build/projects/libc/src/string -I/llvm-project-llvmorg-14.0.6/libc/src/string -I/llvm-project-llvmorg-14.0.6/build/include -I/llvm-project-llvmorg-14.0.6/llvm/include -I/llvm-project-llvmorg-14.0.6/build/projects/libc/include -I/llvm-project-llvmorg-14.0.6/libc -I/llvm-project-llvmorg-14.0.6/build/projects/libc -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-builtin-bzero -mllvm -combiner-global-alias-analysis -fpie -ffreestanding -DLLVM_LIBC_PUBLIC_PACKAGING -std=c++14 -MD -MT projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o -MF projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o.d -o projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o -c /llvm-project-llvmorg-14.0.6/libc/src/string/bzero.cpp
c++: error: unrecognized command line option '-mllvm'
c++: error: unrecognized command line option '-combiner-global-alias-analysis'
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1V1lz2jgc_zTmRSOPsTnCAw-cGbccWSCb9skj2wLUGMlryU3YT78_2U5Idttu005mjM7_fYpYpefh7ig0wXdi55iTgmfM8JQYRRw_6AbdfodgdeX4fsKkVIbEpchSkmVfTzQTcULbAXkQ5kgOSQIgxx843tTxRvU4UdLwR-MEIxI6fv9ETHEW8mDJ13T-MD1SanvEwDvh0pDF4s8lSdQpFxkviJKQTJ4zIcvHyI_8DhGSqCLFFYiUmpOb81akvHehyYhkRnzlJD-bI_BjIVPLYa8K3E0cf4yP5IX6whNTnTaAbc8luyMzkFSTh-OZhFbeC2GrtBWIEa2IwoE-a8NP7k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