[llvm] [flang-rt] Use posix_memalign instead of std::aligned_alloc (PR #207248)
Jason Van Beusekom via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 13:07:31 PDT 2026
https://github.com/Jason-Van-Beusekom requested changes to this pull request.
``` bash
llvm-project/flang-rt/include/flang-rt/runtime/allocator-registry.h:39:9: error: use of undeclared identifier 'posix_memalign'
39 | if (posix_memalign(&ptr, alignment, size) != 0) {
| ^~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-amdgcn-amd-amdhsa-stamps/runtimes-amdgcn-amd-amdhsa-build /llvm-project/build/runtimes/runtimes-amdgcn-amd-amdhsa-stamps/runtimes-amdgcn-amd-amdhsa-build
cd /llvm-project/build/runtimes/runtimes-amdgcn-amd-amdhsa-bins && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
```
amdgcn, build fails for this. I think the simplest solution would be to just disable this change for amdgcn targets, or just used aligned_alloc for that target
https://github.com/llvm/llvm-project/pull/207248
More information about the llvm-commits
mailing list