From 80d5e40fd1392af9401db3d0bbcbcc6b7276675c Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 18 Oct 2021 11:42:45 -0700 Subject: [PATCH] freedreno/afuc: Disable the disassembler on 32-bit builds. There's an mmap(2 << 32), which armhf can't handle. Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5514 Part-of: --- src/freedreno/afuc/meson.build | 92 ++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/src/freedreno/afuc/meson.build b/src/freedreno/afuc/meson.build index 247834dc7c1..b779b2dd39f 100644 --- a/src/freedreno/afuc/meson.build +++ b/src/freedreno/afuc/meson.build @@ -18,6 +18,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +if with_tests + diff = find_program('diff') +endif + afuc_parser = custom_target( 'parser.[ch]', input: 'parser.y', @@ -55,50 +59,7 @@ asm = executable( build_by_default : with_tools.contains('freedreno'), install: install_fd_decode_tools, ) - -disasm = executable( - 'afuc-disasm', - [ - 'disasm.c', - 'emu.c', - 'emu.h', - 'emu-ds.c', - 'emu-regs.c', - 'emu-ui.c', - 'util.c', - 'util.h', - ], - include_directories: [ - inc_freedreno, - inc_freedreno_rnn, - inc_include, - inc_src, - inc_util, - ], - link_with: [ - libfreedreno_rnn, - ], - dependencies: [ - ], - build_by_default : with_tools.contains('freedreno'), - install: install_fd_decode_tools, -) - if with_tests - diff = find_program('diff') - - disasm_fw = custom_target('afuc_test.asm', - output: 'afuc_test.asm', - command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'], - capture: true - ) - test('afuc-disasm', - diff, - args: ['-u', files('../.gitlab-ci/reference/afuc_test.asm'), disasm_fw], - suite: 'freedreno', - workdir: meson.source_root() - ) - asm_fw = custom_target('afuc_test.fw', output: 'afuc_test.fw', command: [asm, '-g', '6', files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'], @@ -110,3 +71,48 @@ if with_tests workdir: meson.source_root() ) endif + +# Disasm requires mmaping >4GB +if cc.sizeof('size_t') > 4 + disasm = executable( + 'afuc-disasm', + [ + 'disasm.c', + 'emu.c', + 'emu.h', + 'emu-ds.c', + 'emu-regs.c', + 'emu-ui.c', + 'util.c', + 'util.h', + ], + include_directories: [ + inc_freedreno, + inc_freedreno_rnn, + inc_include, + inc_src, + inc_util, + ], + link_with: [ + libfreedreno_rnn, + ], + dependencies: [ + ], + build_by_default : with_tools.contains('freedreno'), + install: install_fd_decode_tools, + ) + + if with_tests + disasm_fw = custom_target('afuc_test.asm', + output: 'afuc_test.asm', + command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'], + capture: true + ) + test('afuc-disasm', + diff, + args: ['-u', files('../.gitlab-ci/reference/afuc_test.asm'), disasm_fw], + suite: 'freedreno', + workdir: meson.source_root() + ) + endif +endif