summaryrefslogtreecommitdiff
path: root/graphics/mesa-dri/files
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/mesa-dri/files')
-rw-r--r--graphics/mesa-dri/files/patch-meson.build48
-rw-r--r--graphics/mesa-dri/files/patch-src_util_u__memory.h13
-rw-r--r--graphics/mesa-dri/files/patch-src_util_u__qsort.h26
3 files changed, 13 insertions, 74 deletions
diff --git a/graphics/mesa-dri/files/patch-meson.build b/graphics/mesa-dri/files/patch-meson.build
deleted file mode 100644
index af9122cb85ff..000000000000
--- a/graphics/mesa-dri/files/patch-meson.build
+++ /dev/null
@@ -1,48 +0,0 @@
---- meson.build.orig 2022-10-11 18:53:31 UTC
-+++ meson.build
-@@ -1436,7 +1436,6 @@ functions_to_detect = {
- 'flock': '',
- 'strtok_r': '',
- 'getrandom': '',
-- 'qsort_r': '',
- 'qsort_s': '',
- }
-
-@@ -1445,6 +1444,37 @@ endforeach
- pre_args += '-DHAVE_@0@'.format(f.to_upper())
- endif
- endforeach
-+
-+if cpp.links('''
-+ #define _GNU_SOURCE
-+ #include <stdlib.h>
-+
-+ static int dcomp(const void *l, const void *r, void *t) { return 0; }
-+
-+ int main(int ac, char **av) {
-+ int arr[] = { 1 };
-+ void *t = NULL;
-+ qsort_r((void*)&arr[0], 1, 1, dcomp, t);
-+ return (0);
-+ }''',
-+ args : pre_args,
-+ name : 'GNU qsort_r')
-+ pre_args += '-DHAVE_GNU_QSORT_R'
-+elif cpp.links('''
-+ #include <stdlib.h>
-+
-+ static int dcomp(void *t, const void *l, const void *r) { return 0; }
-+
-+ int main(int ac, char **av) {
-+ int arr[] = { 1 };
-+ void *t = NULL;
-+ qsort_r((void*)&arr[0], 1, 1, t, dcomp);
-+ return (0);
-+ }''',
-+ args : pre_args,
-+ name : 'BSD qsort_r')
-+ pre_args += '-DHAVE_BSD_QSORT_R'
-+endif
-
- if cc.has_header_symbol('time.h', 'struct timespec')
- pre_args += '-DHAVE_STRUCT_TIMESPEC'
diff --git a/graphics/mesa-dri/files/patch-src_util_u__memory.h b/graphics/mesa-dri/files/patch-src_util_u__memory.h
new file mode 100644
index 000000000000..41d696f9d69b
--- /dev/null
+++ b/graphics/mesa-dri/files/patch-src_util_u__memory.h
@@ -0,0 +1,13 @@
+--- src/util/u_memory.h.orig 2022-12-01 11:58:25 UTC
++++ src/util/u_memory.h
+@@ -91,8 +91,8 @@ mem_dup(const void *src, size_t size)
+
+
+ /* Allocate a structure aligned to a cache line. (used to make atomic ops faster) */
+-#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), CACHE_LINE_SIZE)
+-#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), CACHE_LINE_SIZE)
++#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), MESA_CACHE_LINE_SIZE)
++#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), MESA_CACHE_LINE_SIZE)
+ #define FREE_CL(ptr) align_free(ptr)
+
+ #ifdef __cplusplus
diff --git a/graphics/mesa-dri/files/patch-src_util_u__qsort.h b/graphics/mesa-dri/files/patch-src_util_u__qsort.h
deleted file mode 100644
index f199fecd7b56..000000000000
--- a/graphics/mesa-dri/files/patch-src_util_u__qsort.h
+++ /dev/null
@@ -1,26 +0,0 @@
---- src/util/u_qsort.h.orig 2022-03-18 19:26:47 UTC
-+++ src/util/u_qsort.h
-@@ -56,8 +56,10 @@ util_qsort_r(void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *, void *),
- void *arg)
- {
--#if HAVE_QSORT_R
--# if DETECT_OS_APPLE || DETECT_OS_BSD
-+#if HAVE_GNU_QSORT_R
-+ /* GNU extension added in glibc 2.8 */
-+ qsort_r(base, nmemb, size, compar, arg);
-+#elif HAVE_BSD_QSORT_R
- /* BSD/macOS qsort_r takes "arg" before the comparison function and it
- * pass the "arg" before the elements.
- */
-@@ -66,10 +68,6 @@ util_qsort_r(void *base, size_t nmemb, size_t size,
- arg
- };
- qsort_r(base, nmemb, size, &data, util_qsort_adapter);
--# else
-- /* GNU extension added in glibc 2.8 */
-- qsort_r(base, nmemb, size, compar, arg);
--# endif
- #elif HAVE_QSORT_S
- # ifdef _WIN32
- /* MSVC/MinGW qsort_s takes "arg" after the comparison function and it