void-packages/srcpkgs/igt-gpu-tools/patches/musl.patch

241 lines
6.5 KiB
Diff

diff --git benchmarks/gem_syslatency.c benchmarks/gem_syslatency.c
index 7671dc4..3ac9544 100644
--- benchmarks/gem_syslatency.c
+++ benchmarks/gem_syslatency.c
@@ -44,7 +44,11 @@
#include <linux/unistd.h>
-#define sigev_notify_thread_id _sigev_un._tid
+#ifndef __GLIBC__
+#include "signal_compat.h"
+#endif
+
+#define sigev_notify_thread_id sigev_notify_function
static volatile int done;
diff --git lib/igt_aux.c lib/igt_aux.c
index 578f857..3e98cf0 100644
--- lib/igt_aux.c
+++ lib/igt_aux.c
@@ -31,6 +31,7 @@
#endif
#include <stdio.h>
#include <fcntl.h>
+#include <limits.h> // PATH_MAX
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <string.h>
@@ -73,6 +74,12 @@
#include <libgen.h> /* for dirname() */
#endif
+#ifndef __GLIBC__
+#include "signal_compat.h"
+#endif
+
+//#include <asm-generic/siginfo.h>
+
/**
* SECTION:igt_aux
* @short_description: Auxiliary libraries and support functions
diff --git lib/igt_aux.h lib/igt_aux.h
index 04d2290..a0ada9e 100644
--- lib/igt_aux.h
+++ lib/igt_aux.h
@@ -46,7 +46,7 @@
# define gettid() (pid_t)(syscall(__NR_gettid))
# endif
#endif
-#define sigev_notify_thread_id _sigev_un._tid
+#define sigev_notify_thread_id sigev_notify_function
/* auxialiary igt helpers from igt_aux.c */
/* generally useful helpers */
diff --git lib/igt_eld.c lib/igt_eld.c
index 3d7fd4d..d51774b 100644
--- lib/igt_eld.c
+++ lib/igt_eld.c
@@ -29,6 +29,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "igt_core.h"
#include "igt_eld.h"
diff --git lib/igt_halffloat.c lib/igt_halffloat.c
index 08ab05f..7d6a6e6 100644
--- lib/igt_halffloat.c
+++ lib/igt_halffloat.c
@@ -162,7 +162,7 @@ static inline float _half_to_float(uint16_t val)
return fi.f;
}
-#if defined(__x86_64__) && !defined(__clang__)
+#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__)
#pragma GCC push_options
#pragma GCC target("f16c")
diff --git lib/igt_x86.c lib/igt_x86.c
index 6ac700d..ddf5edd 100644
--- lib/igt_x86.c
+++ lib/igt_x86.c
@@ -190,7 +190,7 @@ char *igt_x86_features_to_string(unsigned features, char *line)
}
#endif
-#if defined(__x86_64__) && !defined(__clang__)
+#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__)
#pragma GCC push_options
#pragma GCC target("sse4.1")
#pragma GCC diagnostic ignored "-Wpointer-arith"
diff --git lib/signal_compat.h lib/signal_compat.h
new file mode 100644
index 0000000..acae648
--- /dev/null
+++ lib/signal_compat.h
@@ -0,0 +1,4 @@
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+#define SIGEV_THREAD_ID 4 /* deliver to thread */
diff --git tests/drm_read.c tests/drm_read.c
index cfb1c04..18be922 100644
--- tests/drm_read.c
+++ tests/drm_read.c
@@ -220,7 +220,7 @@ static void test_short_buffer_wakeup(int in, enum pipe pipe)
pthread_mutex_unlock(&w.mutex);
/* Give each thread a chance to sleep in drm_read() */
- pthread_yield();
+ sched_yield();
/* One event should wake all threads as none consume */
generate_event(w.fd, pipe);
diff --git tests/kms_hdmi_inject.c tests/kms_hdmi_inject.c
index 8c0d133..f272418 100644
--- tests/kms_hdmi_inject.c
+++ tests/kms_hdmi_inject.c
@@ -25,7 +25,7 @@
#include "config.h"
#include <dirent.h>
-
+#include <limits.h>
#include "igt.h"
#include "igt_edid.h"
#include "igt_eld.h"
diff --git tests/kms_sysfs_edid_timing.c tests/kms_sysfs_edid_timing.c
index 1201388..e75c7e9 100644
--- tests/kms_sysfs_edid_timing.c
+++ tests/kms_sysfs_edid_timing.c
@@ -24,6 +24,7 @@
#include <dirent.h>
#include <fcntl.h>
+#include <limits.h>
#include <sys/stat.h>
#define THRESHOLD_PER_CONNECTOR 10
diff --git tools/aubdump.c tools/aubdump.c
index 00e1971..af894fe 100644
--- tools/aubdump.c
+++ tools/aubdump.c
@@ -42,6 +42,12 @@
#include "intel_aub.h"
#include "intel_chipset.h"
+#ifdef __GLIBC__
+typedef unsigned long request_t;
+#else
+typedef int request_t;
+#endif
+
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
#endif
@@ -226,10 +232,10 @@ static const uint32_t video_context_init[GEN8_LR_CONTEXT_OTHER_SIZE /
};
static int close_init_helper(int fd);
-static int ioctl_init_helper(int fd, unsigned long request, ...);
+static int ioctl_init_helper(int fd, request_t request, ...);
static int (*libc_close)(int fd) = close_init_helper;
-static int (*libc_ioctl)(int fd, unsigned long request, ...) = ioctl_init_helper;
+static int (*libc_ioctl)(int fd, request_t request, ...) = ioctl_init_helper;
static int drm_fd = -1;
static char *filename = NULL;
@@ -856,7 +862,7 @@ relocate_bo(struct bo *bo, const struct drm_i915_gem_execbuffer2 *execbuffer2,
}
static int
-gem_ioctl(int fd, unsigned long request, void *argp)
+gem_ioctl(int fd, request_t request, void *argp)
{
int ret;
@@ -1150,7 +1156,7 @@ maybe_init(void)
DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
int
-ioctl(int fd, unsigned long request, ...)
+ioctl(int fd, request_t request, ...)
{
va_list args;
void *argp;
@@ -1290,7 +1296,7 @@ close_init_helper(int fd)
}
static int
-ioctl_init_helper(int fd, unsigned long request, ...)
+ioctl_init_helper(int fd, request_t request, ...)
{
va_list args;
void *argp;
diff --git tests/i915/gem_close_race.c tests/i915/gem_close_race.c
index 57e0048..ad5f504 100644
--- tests/i915/gem_close_race.c
+++ tests/i915/gem_close_race.c
@@ -51,7 +51,11 @@
static uint32_t devid;
static bool has_64bit_relocations;
-#define sigev_notify_thread_id _sigev_un._tid
+#ifndef __GLIBC__
+#include "signal_compat.h"
+#endif
+
+#define sigev_notify_thread_id sigev_notify_function
static void selfcopy(int fd, uint32_t handle, int loops)
{
diff --git tests/i915/i915_pm_rpm.c tests/i915/i915_pm_rpm.c
index e2c7ba2..08e44b7 100644
--- tests/i915/i915_pm_rpm.c
+++ tests/i915/i915_pm_rpm.c
@@ -36,6 +36,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
+#include <limits.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
diff --git tests/panfrost_submit.c tests/panfrost_submit.c
index 13ce85b..ceb2e6d 100644
--- tests/panfrost_submit.c
+++ tests/panfrost_submit.c
@@ -68,7 +68,7 @@ static void check_error(int fd, struct panfrost_submit *submit)
static void check_fb(int fd, struct panfrost_bo *bo)
{
int gpu_prod_id = igt_panfrost_get_param(fd, DRM_PANFROST_PARAM_GPU_PROD_ID);
- __uint32_t *fbo;
+ uint32_t *fbo;
int i;
fbo = bo->map;