Skip to content

Commit c643956

Browse files
brad0tru
authored andcommitted
[mlir] Fix building CRunnerUtils on OpenBSD with 15.x
CRunnerUtils builds as C++11. 9c1d133 broke the build on OpenBSD. aligned_alloc() was only introduced in C++17.
1 parent 1a5c5e0 commit c643956

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

mlir/lib/ExecutionEngine/CRunnerUtils.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,10 @@ extern "C" void *_mlir_alloc(uint64_t size) { return malloc(size); }
127127
extern "C" void *_mlir_aligned_alloc(uint64_t alignment, uint64_t size) {
128128
#ifdef _WIN32
129129
return _aligned_malloc(size, alignment);
130-
#elif defined(__APPLE__)
131-
// aligned_alloc was added in MacOS 10.15. Fall back to posix_memalign to also
132-
// support older versions.
130+
#else
133131
void *result = nullptr;
134132
(void)::posix_memalign(&result, alignment, size);
135133
return result;
136-
#else
137-
return aligned_alloc(alignment, size);
138134
#endif
139135
}
140136

0 commit comments

Comments
 (0)