[igt-dev] [PATCH v3 5/7] benchmarks/gem_exec_tracer.c: Fix musl build

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


Hi Bernd,
On 2023-10-30 at 20:58:07 +0100, Bernd Kuhls wrote:
> From: Mohammed Anas <triallax at tutanota.com>
> 
> Original patch was added to void-linux:
> https://github.com/void-linux/void-packages/commit/111918317d06598fe1459dbe139923404f3f4b9d
> 
> Fixes build error:
> ../benchmarks/gem_exec_tracer.c:274:1: error: conflicting types for ‘ioctl’; have ‘int(int,  long unsigned int, ...)’
>   274 | ioctl(int fd, unsigned long request, ...)
> 
> Bug report with request to split the original patch into some
> functional changes:
> Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
> 
> Signed-off-by: Mohammed Anas <triallax at tutanota.com>
> Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
> ---
> v3: no changes
> 
>  benchmarks/gem_exec_tracer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
> index 7e86473e4..3156dfc23 100644
> --- a/benchmarks/gem_exec_tracer.c
> +++ b/benchmarks/gem_exec_tracer.c
> @@ -271,7 +271,11 @@ static int is_i915(int fd)
>  }
>  
>  int
> +#ifdef __GLIBC__
>  ioctl(int fd, unsigned long request, ...)
> +#else
> +ioctl(int fd, int request, ...)
> +#endif

While it works it looks ugly, what about introduce type request_t?
We can then use:

int ioctl(int fd, ioctl_request_t request, ...)

Btw did you look at lib, there is also:
ioctl_wrappers.h: * igt_ioctl:

Did you test linking? Or only compiling? Is a basic test working,
like core_getversion?

+cc Petri

Regards,
Kamil

>  {
>  	struct trace *t, **p;
>  	va_list args;
> -- 
> 2.39.2
> 


More information about the igt-dev mailing list