aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-06-07 08:38:07 -0700
committerDylan Baker <[email protected]>2018-06-07 10:40:35 -0700
commitc267f46ef2910cb72438bf6d9fe4de9fc33d6931 (patch)
treee50d240f3ff82fb3c027f7c8906138f22241d62a
parentf436ae237b6019059ac7f19d1c81627423c5b08e (diff)
meson: Clarify why asm cannot be used in cross compile
This makes the reasoning for why a cross compile is not using asm clearer (hopefully). v2: - fix typos Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
-rw-r--r--meson.build24
1 files changed, 17 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 4d4ca5d5578..32ab30faa4b 100644
--- a/meson.build
+++ b/meson.build
@@ -841,14 +841,24 @@ endif
# TODO: powr8
# TODO: shared/static? Is this even worth doing?
-# 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.
+# When cross compiling we generally need to turn off the use of assembly,
+# because mesa's assembly relies on building an executable for the host system,
+# and running it to get information about struct sizes. There is at least one
+# case of cross compiling where we can use asm, and that's x86_64 -> x86 when
+# host OS == build OS, since in that case the build machine can run the host's
+# binaries.
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')
+ if build_machine.system() != host_machine.system()
+ # TODO: It may be possible to do this with an exe_wrapper (like wine).
+ message('Cross compiling from one OS to another, disabling assembly.')
+ with_asm = false
+ elif not (build_machine.cpu_family() == 'x86_64' and host_machine.cpu_family() == 'x86')
+ # TODO: There may be other cases where the 64 bit version of the
+ # architecture can run 32 bit binaries (aarch64 and armv7 for example)
+ message('''
+ Cross compiling to different architectures, and the host cannot run
+ the build machine's binaries. Disabling assembly.
+ ''')
with_asm = false
endif
endif