From 9ee0108e580a5c255afb21dff64123fdfc87f8e2 Mon Sep 17 00:00:00 2001 From: hthangir Date: Thu, 27 Jul 2017 17:30:26 -0500 Subject: [PATCH] Fix compilation issue reported with GLIBC 2.12 (RHEL 6.9) Change-Id: I770b72ba1d61475a76aa72d0c52ebfb380db6019 --- runtime/hsa-runtime/core/util/utils.h | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 runtime/hsa-runtime/core/util/utils.h diff --git a/runtime/hsa-runtime/core/util/utils.h b/runtime/hsa-runtime/core/util/utils.h old mode 100644 new mode 100755 index 536d816321..0e9a2aa8bd --- a/runtime/hsa-runtime/core/util/utils.h +++ b/runtime/hsa-runtime/core/util/utils.h @@ -65,7 +65,14 @@ typedef uint64_t uint64; #define __ALIGNED__(x) __attribute__((aligned(x))) static __forceinline void* _aligned_malloc(size_t size, size_t alignment) { +#ifdef _ISOC11_SOURCE return aligned_alloc(alignment, size); +#else + void *mem = NULL; + if (NULL != posix_memalign(&mem, alignment, size)) + return NULL; + return mem; +#endif } static __forceinline void _aligned_free(void* ptr) { return free(ptr); } #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))