summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2017-11-15 16:53:40 -0800
committerDylan Baker <[email protected]>2017-11-22 12:46:00 -0800
commit2d62fc06465281d3d45b8a7c7fd2b17ef718448c (patch)
tree19f6429fdb5c701e2ba9b14d41e14266f0e6cb5a
parent84486f64626ad2b51291b84965d1bc96f68d8127 (diff)
meson: disable x86 asm in fewer cases.
This patch allows building asm for x86 on x86_64 platforms, when the operating system is the same. Previously cross compile always turned off assembly. This allows using a cross file to cross compile x86 binaries on x86_64 with asm. This could probably be relaxed further thanks to meson's "exe_wrapper", which is way to specify an emulator or compatibility layer (wine) that can run the foreign binaries on the build system. Since the meson build at this point only supports building on Linux I can't test this and I don't want to write/enable code that cannot even be build tested. v4: - set condition to build == x86_64 and host == x86 and build.system == host.system Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
-rw-r--r--meson.build17
1 files changed, 10 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 049c9a24e4a..23ed42ec0f9 100644
--- a/meson.build
+++ b/meson.build
@@ -542,13 +542,16 @@ endif
# TODO: texture-float (gallium/mesa only)
-# TODO: cross-compiling. I don't think this is relavent to meson
-
-# FIXME: enable asm when cross compiler
-# This is doable (autotools does it), but it's not of immediate concern
-if meson.is_cross_build() and host_machine.cpu_family().startswith('x86')
- message('Cross compiling, disabling x86/x86_64 asm')
- with_asm = false
+# Building x86 assembly code requires running x86 binaries. It is possible for
+# x86_64 OSes to run x86 binaries, so don't disable asm in those cases
+# 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'
+ and build_machine.system() == host_machine.system())
+ message('Cross compiling to x86 from non-x86, disabling asm')
+ with_asm = false
+ endif
endif
with_asm_arch = ''