[igt-dev] [PATCH v3 2/7] lib/igt_aux.h: Fix musl build

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Oct 31 18:01:59 UTC 2023


Hi Bernd,
On 2023-10-30 at 20:58:04 +0100, Bernd Kuhls wrote:
> 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 at kuhls.net>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
> v3: no changes
> 
>  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 4d887045a..4664559dc 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
> 


More information about the igt-dev mailing list