OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/pkg/gcc/0001-posix_memalign.patch
  5. # Copyright (C) 2020 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From 399f9e74a691ca6272d460d72d1b47afcad84752 Mon Sep 17 00:00:00 2001
  17. From: Szabolcs Nagy <nsz@port70.net>
  18. Date: Fri, 26 Jan 2018 20:32:50 +0000
  19. Subject: [PATCH 01/30] posix_memalign
  20. ---
  21. gcc/config/i386/pmm_malloc.h | 9 +++++----
  22. 1 file changed, 5 insertions(+), 4 deletions(-)
  23. diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
  24. index 87344d9383f..ece428df487 100644
  25. --- a/gcc/config/i386/pmm_malloc.h
  26. +++ b/gcc/config/i386/pmm_malloc.h
  27. @@ -27,12 +27,13 @@
  28. #include <stdlib.h>
  29. /* We can't depend on <stdlib.h> since the prototype of posix_memalign
  30. - may not be visible. */
  31. + may not be visible and we can't pollute the namespace either. */
  32. #ifndef __cplusplus
  33. -extern int posix_memalign (void **, size_t, size_t);
  34. +extern int _mm_posix_memalign (void **, size_t, size_t)
  35. #else
  36. -extern "C" int posix_memalign (void **, size_t, size_t) throw ();
  37. +extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
  38. #endif
  39. +__asm__("posix_memalign");
  40. static __inline void *
  41. _mm_malloc (size_t __size, size_t __alignment)
  42. @@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
  43. return malloc (__size);
  44. if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
  45. __alignment = sizeof (void *);
  46. - if (posix_memalign (&__ptr, __alignment, __size) == 0)
  47. + if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
  48. return __ptr;
  49. else
  50. return NULL;
  51. --
  52. 2.27.0