[Mesa-dev] [PATCH] meson: allow x86 asm on x86_64 cross compiles

Dylan Baker dylan at pnwbakers.com
Thu Jun 7 17:46:03 UTC 2018

This is actually quite wrong, the problem is really that gentoo and the way I've
done mesa's meson have very different expectations. I expected that most people
would treat x86_64 -> x86 as a cross compile, since it gives nice properties
like the ability to use a different pkg-config and to ensure that find_library()
doesn't find an x86_64 lib, gentoo does this via environment variables. So what
happens is the native compiler and the cross compiler get -m32, resulting in an
x86 -> x86 cross compile.

Matt and I talked about it, and at least for now we're going to work around it
in mesa, and he'd ask someone in gentoo if this was fixable, or whether we
needed to resolve this is meson.


Quoting Mike Lothian (2018-06-07 09:07:32)
> This patch allows building asm for x86 on x86_64 cross compiles
> Fixes: 2d62fc064652 ("meson: disable x86 asm in fewer cases.")
> Signed-off-by: Mike Lothian <mike at fireburn.co.uk>
> ---
> If you're happy with this change, please can you commit it as I don't
> have access
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/meson.build b/meson.build
> index 4d4ca5d557..9f2d836e80 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -846,7 +846,7 @@ endif
>  # TODO: it should be possible to use an exe_wrapper to run the binary during
>  # the build. 
>  if meson.is_cross_build() 
> -  if not (build_machine.cpu_family() == 'x86_64' and host_machine.cpu_family() == 'x86'
> +  if not (build_machine.cpu_family() == 'x86' and host_machine.cpu_family() == 'x86'
>            and build_machine.system() == host_machine.system())
>      message('Cross compiling to x86 from non-x86, disabling asm')
>      with_asm = false
> -- 
> 2.17.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180607/c21d3816/attachment.sig>

More information about the mesa-dev mailing list