Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Kuhls <bernd@kuhls.net>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH v2 3/6] lib/igt_aux.h: Fix musl build
Date: Thu, 26 Oct 2023 19:14:37 +0200	[thread overview]
Message-ID: <20231026171440.4046190-4-bernd@kuhls.net> (raw)
In-Reply-To: <20231026171440.4046190-1-bernd@kuhls.net>

Inspired by https://www.openwall.com/lists/musl/2020/10/28/11

Define sigev_notify_thread_id only when needed, quoting
https://sourceware.org/bugzilla/show_bug.cgi?id=27417
Both freebsd and musl actually have this macro defined under <signal.h>

Fixes build error:

../lib/igt_aux.c:191:20: error: ‘struct sigevent’ has no member named ‘_sigev_un’
  191 |                 sev.sigev_notify_thread_id = __igt_sigiter.tid;

../lib/igt_aux.c:1994:12: error: ‘struct sigevent’ has no member named ‘_sigev_un’
 1994 |         sev.sigev_notify_thread_id = gettid();

Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 lib/igt_aux.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index fb76b0313..55f0aa3b5 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -29,6 +29,7 @@
 #define IGT_AUX_H
 
 #include <inttypes.h>
+#include <signal.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <sys/time.h>
@@ -48,7 +49,9 @@
 # ifndef HAVE_GETTID
 #  define gettid() (pid_t)(syscall(__NR_gettid))
 # endif
-# define sigev_notify_thread_id _sigev_un._tid
+# ifndef sigev_notify_thread_id
+#  define sigev_notify_thread_id _sigev_un._tid
+# endif
 #endif
 
 /* auxialiary igt helpers from igt_aux.c */
-- 
2.39.2

  parent reply	other threads:[~2023-10-26 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 17:14 [igt-dev] [PATCH v2 0/6] Fix musl/uclibc build Bernd Kuhls
2023-10-26 17:14 ` [igt-dev] [PATCH v2 1/6] build: check that outb is present in io.h Bernd Kuhls
2023-10-26 17:14 ` [igt-dev] [PATCH v2 2/6] Include limits.h to fix build with musl libc Bernd Kuhls
2023-10-30 14:52   ` Kamil Konieczny
2023-10-26 17:14 ` Bernd Kuhls [this message]
2023-10-26 17:14 ` [igt-dev] [PATCH v2 4/6] lib/igt_x86.c: Fix musl/uclibc build Bernd Kuhls
2023-10-26 17:14 ` [igt-dev] [PATCH v2 5/6] lib/igt_halffloat.c: " Bernd Kuhls
2023-10-26 17:14 ` [igt-dev] [PATCH v2 6/6] benchmarks/gem_exec_tracer.c: Fix musl build Bernd Kuhls
2023-10-26 19:13 ` [igt-dev] ✓ CI.xeBAT: success for Fix musl/uclibc build Patchwork
2023-10-26 19:17 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-10-28  3:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231026171440.4046190-4-bernd@kuhls.net \
    --to=bernd@kuhls.net \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox