[igt-dev] [PATCH v3 1/7] build: check that outb is present in io.h

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


Hi Bernd,
On 2023-10-30 at 20:58:03 +0100, Bernd Kuhls wrote:
> With glibc if io.h exists, inb/outb are always defined.
> However on musl, io.h always exists but it may not define inb/outb.
> 
> Thus, igt-gpu-tools builds with musl on non-x86 platforms will fail to
> link. Fix this by checking for both io.h and that outb() is defined.
> 
> Signed-off-by: Bernd Kuhls <bernd at kuhls.net>

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

> ---
> v3: no changes
> 
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index b35a00faa..cee8a7446 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -220,7 +220,7 @@ endif
>  if cc.has_header('libgen.h')
>  	config.set('HAVE_LIBGEN_H', 1)
>  endif
> -if cc.has_header('sys/io.h')
> +if cc.has_header('sys/io.h') and cc.has_function('outb', prefix: '#include <sys/io.h>')
>  	config.set('HAVE_SYS_IO_H', 1)
>  endif
>  if cc.links('''
> -- 
> 2.39.2
> 


More information about the igt-dev mailing list