]> git.ipfire.org Git - thirdparty/xz.git/commit
liblzma: Fix x86-64 movzw compatibility in range_decoder.h
authorYifeng Li <tomli@tomli.me>
Thu, 22 Aug 2024 02:18:49 +0000 (02:18 +0000)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 6 Sep 2024 16:33:20 +0000 (19:33 +0300)
commit3a4a05d75eb41ddc41899324df0511670ceaaf1e
tree8c49badfbc7bc7ce43aa8569dd3cb9ba24706066
parent4669f06d1a8d31de4b8b5861b5e8afd82cacd721
liblzma: Fix x86-64 movzw compatibility in range_decoder.h

Support for instruction "movzw" without suffix in "GNU as" was
added in commit [1] and stabilized in binutils 2.27, released
in August 2016. Earlier systems don't accept this instruction
without a suffix, making range_decoder.h's inline assembly
unable to build on old systems such as Ubuntu 16.04, creating
error messages like:

    lzma_decoder.c: Assembler messages:
    lzma_decoder.c:371: Error: no such instruction: `movzw 2(%r11),%esi'
    lzma_decoder.c:373: Error: no such instruction: `movzw 4(%r11),%edi'
    lzma_decoder.c:388: Error: no such instruction: `movzw 6(%r11),%edx'
    lzma_decoder.c:398: Error: no such instruction: `movzw (%r11,%r14,4),%esi'

Change "movzw" to "movzwl" for compatibility.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c07315e0c610e0e3317b4c02266f81793df253d2

Suggested-by: Lasse Collin <lasse.collin@tukaani.org>
Tested-by: Yifeng Li <tomli@tomli.me>
Signed-off-by: Yifeng Li <tomli@tomli.me>
Fixes: 3182a330c1512cc1f5c87b5c5a272578e60a5158
Fixes: https://github.com/tukaani-project/xz/issues/121
Closes: https://github.com/tukaani-project/xz/pull/136
(cherry picked from commit 6cd7c8607843c337edfe2c472aa316602a393754)
src/liblzma/rangecoder/range_decoder.h