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

    <tr>
        <th>Summary</th>
        <td>
            mlir build failure: aligned_alloc did not exist until android api version 28
        </td>
    </tr>

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

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

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

<pre>
    ```
[1665/2830] Building CXX object tools/mlir/lib/ExecutionEngine/CMakeFiles/mlir_c_runner_utils.dir/CRunnerUtils.cpp.o
FAILED: tools/mlir/lib/ExecutionEngine/CMakeFiles/mlir_c_runner_utils.dir/CRunnerUtils.cpp.o
/usr/local/bin/clang++ --target=aarch64-linux-android24 --sysroot=/home/cqwrteur/toolchains/sysroots/aarch64-linux-android24 -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Dmlir_c_runner_utils_EXPORTS -I/home/cqwrteur/Projects/myllvm/aarch64-linux-android24/build/llvm-project/tools/mlir/lib/ExecutionEngine -I/home/cqwrteur/Projects/myllvm/llvm-project/mlir/lib/ExecutionEngine -I/home/cqwrteur/Projects/myllvm/aarch64-linux-android24/build/llvm-project/include -I/home/cqwrteur/Projects/myllvm/llvm-project/llvm/include -I/home/cqwrteur/Projects/myllvm/llvm-project/mlir/include -I/home/cqwrteur/Projects/myllvm/aarch64-linux-android24/build/llvm-project/tools/mlir/include -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG -std=c++17 -fPIC  -fno-exceptions -funwind-tables -fno-rtti -Wweak-vtables -MD -MT tools/mlir/lib/ExecutionEngine/CMakeFiles/mlir_c_runner_utils.dir/CRunnerUtils.cpp.o -MF tools/mlir/lib/ExecutionEngine/CMakeFiles/mlir_c_runner_utils.dir/CRunnerUtils.cpp.o.d -o tools/mlir/lib/ExecutionEngine/CMakeFiles/mlir_c_runner_utils.dir/CRunnerUtils.cpp.o -c /home/cqwrteur/Projects/myllvm/llvm-project/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
/home/cqwrteur/Projects/myllvm/llvm-project/mlir/lib/ExecutionEngine/CRunnerUtils.cpp:149:10: error: use of undeclared identifier 'aligned_alloc'
  149 |   return aligned_alloc(alignment, size);
      |          ^
1 error generated.
```
https://github.com/aosp-mirror/platform_bionic/blob/85dd55530a92c4eb2a62150e59cd8e50045033bc/libc/include/stdlib.h#L78
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VluT4jYW_jXiRSXKyJjLAw80xtmuGrqngFnmjZKlgzkbWXJ0obvz67dkYDLJdrKVnZ1xUcY-OtfvO9aR8B4bA7AgxQMpyoGI4WzdIjjpPDpQg9qqtwWZZLdfVpJsSYqH0WRSEF7xWZ6RoqQPEbVC09DV58_U1v8CGWiwVnvCq1ajI7zSWBNerV9BxoDWrE2DBgivVhvxM1So4a57lEcXjQF3jAG1H6refLXtZZ96key6ob3mUi0fP6xLki9_UDzCq-h7_1YKTXhVoyG8klqYhvAHwh8oY0G4BgLJSyGcPE_GTKOJr0wY5SwqPqaM-TfvrE06hFdn26bU5C8vLkBM3lMx8izQpCxvuunxTx2WP-3Xu_3xH8vdcbvfP5K8zCgrNx8et8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