etc: Enable a tty for a serial port by default.
[dragora.git] / patches / gcc / 11 / 0002-posix_memalign.patch
blobff1fbc2a803182884b267ade427e36591718b157
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
6 ---
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
14 @@ -27,12 +27,13 @@
15 #include <stdlib.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. */
20 #ifndef __cplusplus
21 -extern int posix_memalign (void **, size_t, size_t);
22 +extern int _mm_posix_memalign (void **, size_t, size_t)
23 #else
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 ()
26 #endif
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)
37 return __ptr;
38 else
39 return NULL;
40 --
41 2.31.1