1 From ba7401783edf0dd9e5503c934b58e1b4fb4595f1 Mon Sep 17 00:00:00 2001
2 From: Szabolcs Nagy <nsz@port70.net>
3 Date: Fri, 26 Jan 2018 20:32:50 +0000
4 Subject: [PATCH 2/5] posix_memalign
7 gcc/config/i386/pmm_malloc.h | 9 +++++----
8 1 file changed, 5 insertions(+), 4 deletions(-)
10 diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
11 index 1b0bfe37852..d7b2b19bb3c 100644
12 --- a/gcc/config/i386/pmm_malloc.h
13 +++ b/gcc/config/i386/pmm_malloc.h
17 /* We can't depend on <stdlib.h> since the prototype of posix_memalign
18 - may not be visible. */
19 + may not be visible and we can't pollute the namespace either. */
21 -extern int posix_memalign (void **, size_t, size_t);
22 +extern int _mm_posix_memalign (void **, size_t, size_t)
24 -extern "C" int posix_memalign (void **, size_t, size_t) throw ();
25 +extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
27 +__asm__("posix_memalign");
29 static __inline void *
30 _mm_malloc (size_t __size, size_t __alignment)
31 @@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
32 return malloc (__size);
33 if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
34 __alignment = sizeof (void *);
35 - if (posix_memalign (&__ptr, __alignment, __size) == 0)
36 + if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)